A web application for creating and managing notes with user authentication. This project evolved from my nodejs cli notes app, transforming it into a full-featured web application using Node.js (Express) server with EJS templating engine and Bootstrap for the frontend.
- Docker
- Docker Compose
- Clone the repository:
git clone https://github.com/Wannabeloved/NodejsExpressNotes
cd NodejsExpressNotes- Start the application using Docker Compose:
docker compose up -dAfter launch:
- Web application will be available at: http://localhost:3000
- MongoDB will be available at: mongodb://localhost:27017
The project uses environment variables for configuration. Example values are provided in .env.example:
JWT_SECRET=secret # Secret key for JWT tokens
SALT_ROUNDS=10 # Number of salt rounds for password hashing
MONGODB_URI=... # MongoDB connection string
For development and demonstration purposes, you can use these values as is by copying .env.example to .env. In production, you should change these values and use proper secret management.
If you want to connect to the database using MongoDB Compass, use the following connection string:
mongodb://root:example@localhost:27017/notes?authSource=admin
Default credentials:
- Username: root
- Password: example
- Database: notes
- Auth Database: admin
- User registration and authentication
- Create, view, edit, and delete notes
- Each user sees only their own notes
- Protected routes using JWT tokens
- Responsive Bootstrap UI
- Data persistence using MongoDB
If you want to make changes to the code:
- Stop the containers:
docker compose down-
Make your changes
-
Rebuild and start the containers:
docker compose up -d --build-
For production, it's recommended to change:
- MongoDB password (in compose.yaml)
- JWT_SECRET in constants.js
- Use secure secret storage
-
MongoDB data is stored in a Docker volume, so it persists even after container restarts
- Backend: Node.js with Express
- Database: MongoDB
- View Engine: EJS
- Frontend: Bootstrap
- Authentication: JWT
- Containerization: Docker & Docker Compose