A Node.js API boilerplate using Express.js, Sequelize ORM, and JWT for secure user authentication. Designed for rapid development, it provides a modular structure for easy customization, enhanced security features including rate limiting and CORS configuration, and is perfect for building scalable and secure APIs.
This backend is designed to work seamlessly with the NextJS Frontend Starter Kit.
Note: The "Task" model provided is just an example to showcase how to manage CRUD resources and can be replaced with any model that suits your application's needs.
- User Authentication with JWT
- Password Hashing with bcrypt
- Sequelize ORM for SQL databases
- Rate Limiting for API security
- CORS Configuration for cross-origin requests
- Environment Variable Management with dotenv
-
Clone the repository:
-
Navigate to the directory:
cd express-jwt-starter-kit
-
Install dependencies:
npm install
Start the server:
npm start
For development, with hot reload:
npm run dev
POST /v1/auth/register
: Register a new userPOST /v1/auth/login
: Log in a userPOST /v1/auth/logout
: Log out a user
GET /v1/tasks
: Get all tasks for a userPOST /v1/tasks
: Create a new taskGET /v1/tasks/:id
: Get a task by IDPUT /v1/tasks/:id
: Update a task by IDDELETE /v1/tasks/:id
: Delete a task by ID
Set environment variables in .env
file, using the .env.example
file as a template.
Contributions are welcome! Please open an issue or submit a pull request with your improvements.
This project is licensed under the ISC License.