The repository is organized into two main directories:
- client: Contains the frontend code.
- server: Houses the backend code.
To run the app locally, follow these steps:
- Navigate to the client directory in your terminal.
- Run the following command to install dependencies:
$ npm install
- Start the frontend server:
Make sure you have Node.js and npm installed on your machine.
$ npm run start
- Create a MongoDB account on MongoDB Atlas.
- Create a new project and obtain your project credentials.
- In the root directory of the server folder, create a file named
.env
. - Inside the
.env
file, set up theDATABASE_URI
using your MongoDB credentials.DATABASE_URI=mongodb+srv://<username>:<password>@cluster0.mongodb.net/<dbname>?retryWrites=true&w=majority
- Navigate to the server directory in your terminal.
- Run the following command to install backend dependencies:
$ npm install
- Start the backend server:
$ npm run start
Ensure that these steps are followed consistently to set up and run the MERN (MongoDB, Express.js, React, Node.js) app on your local environment.