https://github.com/lccodder/fastify-typescript-boilerplate
REST API boilerplate Notion clone written with Fastify, TypeScript and PostgreSQL
https://github.com/lccodder/fastify-typescript-boilerplate
architecture backend-api boilerplate boilerplate-template clean-architecture fastify nodejs rest rest-api template typescript
Last synced: 3 months ago
JSON representation
REST API boilerplate Notion clone written with Fastify, TypeScript and PostgreSQL
- Host: GitHub
- URL: https://github.com/lccodder/fastify-typescript-boilerplate
- Owner: LCcodder
- License: mit
- Created: 2024-04-03T12:45:17.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-30T23:04:41.000Z (11 months ago)
- Last Synced: 2024-07-30T23:52:50.712Z (11 months ago)
- Topics: architecture, backend-api, boilerplate, boilerplate-template, clean-architecture, fastify, nodejs, rest, rest-api, template, typescript
- Language: TypeScript
- Homepage:
- Size: 448 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# `Node.js` and `Fastify` **RESTful API** boilerplate









### REST API and *Clean Architecture* boilerplate/template written in `Node.js` and `Fastify`
This is *notion-like* note application backend and *Clean Architecture boilerplate* with registration, authorization, collaborating, etc. You can create note, add tags to it and filter your notes, add and remove collaborators, customize your profile.### **Features**
+ User registration and authorization by `JWT`
+ User's profile update
+ User password change
+ Note creation with tags and collaborators
+ Note edit
+ Receiving notes with pagination, update date sorting, tags filtering
+ Adding and removing collaborators## **How to launch**
> To launch application you need to install `Docker` and `Docker Compose` on your system1. Clone git repository and go to the directory
``` Shell
git clone https://github.com/LCcodder/NodeNotes
cd NodeNotes
```
2. Edit environment variables in `docker-compose.yaml` as you want
3. Run
```Shell
docker compose up --build
```## **Environment variables**
1. `DATABASE_HOST`
2. `DATABASE_NAME`
3. `DATABASE_USER`
4. `DATABASE_PASSWORD`
5. `REDIS_CONNECTION_STRING` (ex. `redis://127.0.0.1:6379/0`)
6. `JWT_SECRET`
7. `JWT_EXPIRATION` (ex. `24h`)
8. `PORT`## **`Jest` unit tests**
- App covered with `Jest` unit tests
- Coverage `85%`To run all testsheets enter:
```
npm test
```## **`Postman` e2e tests**
+ App covered with e2e tests
+ `100%` coverage, over 280 testsYou can find testsheets in `tests/e2e/api_v1.postman_collection.json`
## **`pgAdmin` panel**
1. Go to the `http://localhost:5050`
2. Log in with email: `[email protected]` and password: `password`
3. Run
```
docker ps -a
```
4. Find and copy `postgres` container id
5. Run
```
docker inspect
```
6. Find `IPAddress` with *172* prefix and copy it
7. Now add server in `pgAdmin` and paste copied IP in `host` input
8. Complete all other inputs
## **`Swagger` API specification**
#### WebApp supports `Swagger` `OpenApi` spec viewer
#### Use `http://localhost:8080/documentation` to go to the `SwaggerUI` page---
### Everything, including `Postman` tests, unit tests, `GitHub ci/cd`, `Docker compose` and API itself was created and written by [LCcodder](https://github.com/LCcodder)