This is a boilerplate for a full-stack MERN application using Next.js, Express, and MongoDB.
- Clone the repo
- Install dependencies with
npm install
in the root directory and theclient
directory - Create a
.env
file in the root directory and add the following:
MONGODB_URI='YOUR MONGODB URI'
PORT=4000
NODE_ENV='development'
Personal Note: I use MongoDB Atlas with /blogDB as my database name in this project
- Run
npm run dev
to start the development server
- The backend runs on http://localhost:4000
- The client runs on http://localhost:3000
- the client and server should be deployed separately
- update
clientURL.js
file with the correct URL for the client - update
serverURL.ts
file with the correct URL for the server