Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wasswarichard/jwt-nestjs-postgresql-sequelize-docker
Daily Express App - nest postgresql sequelize docker
https://github.com/wasswarichard/jwt-nestjs-postgresql-sequelize-docker
aws aws-ec2 aws-s3 crone-job cronexpression docker jest jwt-authentication jwt-bearer-tokens nestjs node postgresql rest-api sequelize
Last synced: 10 days ago
JSON representation
Daily Express App - nest postgresql sequelize docker
- Host: GitHub
- URL: https://github.com/wasswarichard/jwt-nestjs-postgresql-sequelize-docker
- Owner: wasswarichard
- Created: 2024-01-24T17:27:33.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-01-28T16:58:51.000Z (12 months ago)
- Last Synced: 2024-11-09T06:40:28.731Z (2 months ago)
- Topics: aws, aws-ec2, aws-s3, crone-job, cronexpression, docker, jest, jwt-authentication, jwt-bearer-tokens, nestjs, node, postgresql, rest-api, sequelize
- Language: TypeScript
- Homepage:
- Size: 93.8 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest# NestJS Authentication Application with JWT
This is a NestJS application that provides a basic authentication system. The application exposes a few endpoints for user registration, login, users and posts.
The application uses PostgreSQL for user data persistence. JWT is used for authentication and token generation.
## Prerequisites
Before you begin, ensure you have met the following requirements:
- You have installed the latest version of [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/).
## Running the Application
### Docker
To run the application, follow these steps:
Build and run the Docker containers:
```docker-compose up --build -d``` the api runs on `http://localhost:3000/`## API Endpoints
The application exposes the following endpoints:
- `POST /auth/register`: Register a new user.
- `POST /auth/login`: Authenticate a user and return access token.
- `POST /posts`: creates user post.
- `GET /posts`: returns associated user private and public posts.
- `GET /posts/:id`: returns a single post.
- `PATCH /posts/:id`: updates a user post.
- `DELETE /posts/:id`: removes a user post.
- `GET /users`: returns registered users.
- `GET /users/:id`: returns registered user by id.
- `PATCH /users/:id`: updates user by id.
- `DELETE /users/:id`: deletes user by id.## Environment Variables
The application uses the following environment variables for configuration:
- `POSTGRES_HOST=daily_express_postgres` the postgres database docker container.
- `POSTGRES_PORT`
- `POSTGRES_USER `
- `POSTGRES_PASSWORD`
- `POSTGRES_DATABASE`
- `JWT_SECRET`
- `AWS_S3_REGION `
- `AWS_ACCESS_KEY_ID `
- `AWS_SECRET_ACCESS_KEY`
- `S3_BUCKET`## License
This project uses the following license: [MIT License]().