This is a NestJS application that provides a basic authentication system. The application exposes a few endpoints for user registration, login, token refresh, and token invalidation.
The application uses PostgreSQL for user data persistence, and Redis for storing refresh token data. JWT is used for authentication and token generation.
Before you begin, ensure you have met the following requirements:
- You have installed the latest version of Docker and Docker Compose.
To run the application, follow these steps:
Build and run the Docker containers:
docker-compose up --build -d
The application exposes the following endpoints:
POST /auth/sign-up
: Register a new user.POST /auth/sign-in
: Authenticate a user and return access and refresh tokens.POST /auth/refresh-token
: Refresh the access token using a valid refresh token.POST /auth/invalidate-token
: Invalidate a user's refresh token.
The application uses environment variables for configuration. These variables are defined in the config/database.env
file.
To contribute to the application, follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b <branch_name>
. - Make your changes and commit them:
git commit -m '<commit_message>'
- Push to the original branch:
git push origin <project_name>/<location>
- Create the pull request.
If you want to contact me, you can reach me at aggeloskappos@gmail.com
.
This project uses the following license: MIT License.