This repository contains a simple authentication system built using Node.js, bcrypt, JSON Web Tokens (JWT), Sequelize ORM, and PostgreSQL as the database, encapsulated within Docker containers for easy deployment and scalability.
- User registration
- User login
- Token-based authentication using JWT
- Password hashing using bcrypt
- PostgreSQL database integration
- Sequelize ORM for database management
Before running this application, ensure you have Docker installed on your system. Setup
Clone the repository:
git clone https://github.com/Pratik1968/JWTAuth.git
Navigate to the project directory:
cd JWTAuth
Build the Docker container:
docker-compose build
Start the Docker containers:
docker-compose up
Once the containers are up and running, navigate to http://localhost:3000 in your web browser.
Once the application is running, you can use the following endpoints:
POST http://localhost:3000/api/auth/signup
Content-Type: application/json
{
"NAME": "name",
"EMAIL": "email",
"PASSWORD": "password",
}
POST http://localhost:3000/api/auth/signin
Content-Type: application/json
{
"EMAIL": "email",
"PASSWORD": "password"
}
GET http://localhost:3000/api/test HTTP/1.1
Authorization: Bearer token
Content-Type: application/json
Contributions are welcome! Feel free to open an issue or submit a pull request.