Mainstack Backend Assessment Test
This is a simple Node.js store application that allows users to register, login, and create products. It uses MongoDB for data storage and JSON Web Tokens (JWT) for authentication.
Before you begin, make sure you have the following installed on your machine:
- Node.js
- MongoDB
- npm or yarn
-
Clone the repository:
git clone https://github.com/jedstroke/mainstack-backend.git . cd nodejs-store npm install
-
Set up environment variables:
Create a
.env
file in the root directory with the following content:PORT=<YOUR PORT> MONGODB_URI=mongodb://localhost:27017/store JWT_SECRET=lookhomewardsangle
-
Run the application:
npm run dev
The server will start at http://localhost:<YOUR_PORT>.
-
Import the API collection into Postman from the
__api__
dir see how requests are made. -
Or pull my Docker image
docker run -d -p 3000:3000 -e MONGODB_URI="mongodb+srv://<username>:%<password>@<username>.9solltw.mongodb.net/store?retryWrites=true&w=majority" -e JWT_SECRET="lookhomewardangle" jedshock/mainstack-play-store:latest
Contributions are welcome! Fork the repository and submit a pull request with your changes.
This project is licensed under the MIT License.