This project is a Node.js and Express backend application developed as part of the backend development syllabus.
- Express.js server
- SQLite database
- User registration
- User login
- Password hashing with bcryptjs
- JWT authentication
- Protected API routes
- Request logging
- Environment variables using dotenv
- Node.js
- Express.js
- SQLite3
- bcryptjs
- jsonwebtoken
- dotenv
- Clone the repository.
- Install dependencies:
npm install- Create a
.envfile:
PORT=3000
JWT_SECRET=your_secret_key- Run the migration:
node src/migrations/migrate.js- Start the server:
node app.js| Method | Endpoint | Description |
|---|---|---|
| GET | / | Home |
| GET | /about | About |
| GET | /contact | Contact |
| GET | /health | Health Check |
| POST | /api/auth/register | Register User |
| POST | /api/auth/login | Login User |
| GET | /api/auth/profile | Protected Profile |
Protected endpoints require an Authorization header:
Authorization: Bearer <JWT_TOKEN>
Akshay