This is a simple Node.js and Express backend for your application. It uses MongoDB for data storage and JWT for authentication.
Make sure you have Node.js and npm installed on your machine.
-
Clone the repository:
git clone https://github.com/faisalsiddique4400/react-assessment-be
-
Navigate to the project directory:
cd react-assessment-be
-
Install dependencies:
npm install
- Run the development server:
npm run dev
The server will be running at http://localhost:3000 (or the port specified in .env.example).
- Create a copy of .env.example and name it .env:
- Open the .env file and set the following variables:
MONGO_URL: Your MongoDB connection URL PORT: Port for the production server JWT_SECRET: Secret key for JWT authentication
- Build and run the production server:
npm start
The server will be running at http://localhost:3000 (or the port specified in .env).