Git Product home page Git Product logo

enriquemorenotent / express-jwt-starter-kit Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 56 KB

Express-JWT-Starter-Kit: A Node.js API boilerplate with Express.js, Sequelize ORM, and JWT for secure user authentication. Ideal for rapid development, it offers a modular structure for easy customization, enhanced security with rate limiting, and CORS setup. Perfect for building scalable and secure APIs.

JavaScript 100.00%

express-jwt-starter-kit's Introduction

Express-JWT-Starter-Kit

Description

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.

Features

  • 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

Installation

  1. Clone the repository:

  2. Navigate to the directory:

    cd express-jwt-starter-kit
  3. Install dependencies:

    npm install

Usage

Start the server:

npm start

For development, with hot reload:

npm run dev

API Endpoints

Auth

  • POST /v1/auth/register: Register a new user
  • POST /v1/auth/login: Log in a user
  • POST /v1/auth/logout: Log out a user

Tasks

  • GET /v1/tasks: Get all tasks for a user
  • POST /v1/tasks: Create a new task
  • GET /v1/tasks/:id: Get a task by ID
  • PUT /v1/tasks/:id: Update a task by ID
  • DELETE /v1/tasks/:id: Delete a task by ID

Configuration

Set environment variables in .env file, using the .env.example file as a template.

Contributing

Contributions are welcome! Please open an issue or submit a pull request with your improvements.

License

This project is licensed under the ISC License.

express-jwt-starter-kit's People

Contributors

enriquemorenotent avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.