KeepDesk is a full-stack web application designed to help users manage personal notes with features like user registration, authentication, and full CRUD operations for notes. It includes a React-based frontend, Node.js + Express backend, and MongoDB for data storage.
- User registration and secure login with hashed passwords
- JWT-based authentication for secure API access
- Create, read, update, and delete notes
- User-specific data storage using MongoDB
- React frontend for seamless user experience
- Docker support for easy deployment
Layer | Technology |
---|---|
Frontend | React.js |
Backend | Node.js, Express.js |
Database | MongoDB / MongoDB Atlas |
Auth | JWT, bcrypt |
Tools | Docker, dotenv, cors |
git clone https://github.com/dhingralakshya/KeepDesk.git
cd KeepDesk
Add the following envs:
port=4000
JWT_SECRET=your_jwt_secret
server=mongodb://localhost:27017/keepdesk
For MongoDB Atlas (cloud), use:
server=mongodb+srv://<username>:<password>@cluster.mongodb.net/keepdesk?retryWrites=true&w=majority
- Clone the repository
git clone https://github.com/dhingralakshya/KeepDesk.git
cd KeepDesk
- Run with Docker Compose
docker-compose up --build
- Clone and setup backend
git clone https://github.com/dhingralakshya/KeepDesk.git
cd KeepDesk/backend
npm install
- Start backend server using
node server.js
- Setup frontend (in a new terminal)
cd KeepDesk
npm install
- Start the frontend
npm start
All APIs are protected (except register and login). Use a valid JWT in the Authorization header:
Authorization: Bearer <your_token>
Method | Endpoint | Description | Auth Required |
---|---|---|---|
POST | /register |
Register a new user | ❌ No |
POST | /login |
Login and get JWT token | ❌ No |
GET | / |
Get all notes of the logged-in user | ✅ Yes |
POST | / |
Create a new note | ✅ Yes |
PATCH | /update/:id |
Update a specific note by ID | ✅ Yes |
POST | /delete |
Delete a specific note (pass ID in body) | ✅ Yes |
How to Run Tests
npm test
- Uses Jest, Supertest, and mongodb-memory-server.
- Covers unit, integration, and API tests.
Metric | Coverage |
---|---|
Statements | 76.82% |
Branches | 50.00% |
Functions | 88.88% |
Lines | 82.66% |
✅ Goal of 70%+ coverage achieved!