-
Installation
-
Clone the repository:
git clone <repository-url> cd <project-folder>
-
Install dependencies:
npm install
-
-
Development
-
Start the development server:
npm run dev
-
Open
http://localhost:3000
in your browser to view the application.
-
-
Build
-
Build the production-ready files:
npm run build
-
The optimized build will be available in the
dist
directory.
-
-
Create a
.env
file in the root directory. -
Add your MongoDB Atlas connection URI to the
.env
file:MONGODB_URI=mongodb+srv://<username>:<password>@<cluster-url>/mydatabase?retryWrites=true&w=majority
-
Use tools like Postman to test your API endpoints.
-
Example API endpoint for creating a user:
- POST
http://localhost:3001/users
- Request body (JSON):
{ "name": "some user", "email": "someuser@example.com" }
- POST
-
Verify data in your MongoDB Atlas cluster using MongoDB Compass or CLI tools.