This project involves authentication system within a Node.js environment, using Postgres as database, in TypeScript.
To run this project locally, Node and Postgres must be installed in the system.
Clone the project
git clone https://github.com/ayushjaiz/postgress-typescript-auth
Go to the project directory
cd postgress-typescript-auth
Install dependencies
npm install
Start the server
npm run start
Add the following environment variables in .env file as prescribed in .env.example file at project root level
# app configurations
APP_PORT =
# database configurations
DB_USER = 'postgres'
DB_HOST = 'localhost'
DB_DATABASE_NAME =
DB_PASSWORD =
DB_PORT =
# jwt secret
JWT_SECRET_KEY =
# email configuration
EMAIL_ADMIN =
EMAIL_PASSWORD =
Route | Method | Description |
---|---|---|
/auth/login | POST | Authenticates user and returns JWT token. |
/auth/signup | POST | Registers a new user. |
/auth/logout | POST | Logs out the current user. |
/auth/send-password-reset-email | POST | Sends forget password email to user. |
Route | Method | Description |
---|---|---|
/auth/user-info | GET | Retrieves user profile information. |
/auth/change-password | POST | Updates user password settings. |
- Better error handing
- Dockerize the application