2023-09-02 19:19:41 +00:00
< p align = "center" >
2024-02-15 11:30:41 +00:00
< picture >
2024-02-15 11:32:34 +00:00
< source media = "(prefers-color-scheme: dark)" srcset = "./resources/logo-light.svg" >
< source media = "(prefers-color-scheme: light)" srcset = "./resources/logo-dark.svg" >
2024-02-15 11:30:41 +00:00
< img alt = "Project Knedita" src = "./resources/logo-light.svg" width = "700" >
< / picture >
2023-09-02 19:19:41 +00:00
< / p >
2023-09-02 19:11:41 +00:00
2024-09-27 23:05:00 +00:00
A simple RESTful API made with **NestJS** and **Fastify** .
2024-02-15 13:03:04 +00:00
2024-09-27 23:05:00 +00:00
### 🚀 Preparing the environment
2024-02-15 13:03:04 +00:00
2024-10-12 16:36:41 +00:00
Make sure that you have Bun, Docker and Docker Compose installed on your computer.
This project also works with Node and Npm.
2024-02-15 13:03:04 +00:00
First, install the necessary packages with the following commands:
```bash
2024-10-12 16:36:41 +00:00
bun i
2024-02-15 13:03:04 +00:00
```
After that, you can update the `.env` and the `docker.env` files. The `.env` file is for development environment and the `docker.env` is for production.
You can find the templates for those files on `.env.example` and `docker.env.example` .
To run the necessary services you can execute the following command:
```bash
2024-10-12 16:36:41 +00:00
bun docker:db
2024-02-15 13:03:04 +00:00
```
This will start the following services:
2024-09-27 23:05:00 +00:00
- **PostgreSQL**
- **Redis**
- **MinIO**
2024-02-15 13:03:04 +00:00
2024-02-15 13:43:58 +00:00
Apply the migrations to the database with the following command:
```bash
2024-10-12 16:36:41 +00:00
bun migrate:dev
2024-02-15 13:43:58 +00:00
```
2024-02-15 13:03:04 +00:00
And now, you can start the server with the command:
```bash
2024-10-12 16:36:41 +00:00
bun dev:start
2024-02-15 13:03:04 +00:00
```
You can check the documentation accessing the endpoint `/` in your browser
To run in production you can use the following command:
```bash
2024-10-12 16:36:41 +00:00
bun docker
2024-02-15 13:03:04 +00:00
```
This will start all the previous services and the back-end image.
## 🗄️ Stack
This back-end uses the following stack:
2024-09-27 23:05:00 +00:00
2024-10-12 16:36:41 +00:00
- **NestJS**
2024-09-27 23:05:00 +00:00
- **Fastify**
2024-10-12 16:36:41 +00:00
- **Prisma**
2024-10-24 23:11:08 +00:00
- **Kysely**
2024-09-27 23:05:00 +00:00
- **MinIO**
- **PostgreSQL**
- **Redis**
- **Swagger**
- **Typescript**
2023-06-27 23:24:26 +00:00
2023-06-24 20:38:34 +00:00
## License
[MIT ](https://choosealicense.com/licenses/mit/ )