This is the backend system for the Shift Manager application, built with Node.js, Express, and MongoDB. It supports:
- ✅ User registration and login with JWT authentication
- 🔐 Protected routes for shift management
- 🔁 Password reset via email with secure token flow
- 📄 Auto-generated API docs using Swagger (OpenAPI 3.0)
orta-dev-test-be/
├── controllers/ # Route handlers (User, Shift, Forgot Password)
├── middleware/ # JWT authentication middleware
├── models/ # Mongoose schemas (User, Shift)
├── routes/ # API route definitions
├── scheduler/ # Optional job scheduler logic
├── swagger/ # Swagger config for auto docs
├── .env # Environment variables (not committed)
├── .gitignore
├── package.json
├── server.js # Entry point
git clone https://github.com/Wahhab1801/orta-dev-test-be.git
cd orta-dev-test-be
npm install
Create a .env
file in the root with the following variables:
MONGO_URI=<your-mongodb-connection-uri>
PORT=8000
JWT_SECRET=secret1234
NODE_ENV=development
npm run dev
Server will run locally on: http://localhost:8000
Swagger UI is available at:
👉 https://orta-dev-test-be.onrender.com/api/docs
Use the /user/login
route to get a JWT. Then include it in your requests:
Authorization: Bearer <token>
MIT