mirror of
https://github.com/hknsh/project-knedita.git
synced 2024-11-28 09:31:16 +00:00
feat: new readme
This commit is contained in:
parent
59cee20e5e
commit
334efa15b5
3 changed files with 54 additions and 25 deletions
71
README.md
71
README.md
|
@ -6,29 +6,62 @@
|
|||
</picture>
|
||||
</p>
|
||||
|
||||
## Stack
|
||||
A simple RESTful API made with **NestJS** and **Fastify**.
|
||||
|
||||
**Client**: NextJS, TailwindCSS and Radix UI Icons.
|
||||
You can find the front-end [here](https://github.com/CookieDasora/project-knedita-client)
|
||||
### 🚀 Preparing the environment
|
||||
|
||||
**Server**: ExpressJS, Jest, Docker, Postgresql, Redis, Prisma, AWS, SWC and Typescript
|
||||
Make sure that you have Node, NPM, Docker and Docker Compose installed on your computer.
|
||||
|
||||
## To-do - Backend
|
||||
First, install the necessary packages with the following commands:
|
||||
|
||||
- Create/update/delete Posts ✅
|
||||
- Add post attachments
|
||||
- Create/update/delete Users ✅
|
||||
- Password recuperation
|
||||
- Two step verification
|
||||
- Able to choose a profile picture✅
|
||||
- Probably gonna use LocalStack to mock Amazon S3✅
|
||||
- Image compression ✅
|
||||
- Following/unfollowing features ✅
|
||||
- Like posts ✅
|
||||
- Authentication ✅
|
||||
- Add more verification (like, if the password is too short) ✅
|
||||
- Set display name ✅
|
||||
- Add rate limit ✅
|
||||
```bash
|
||||
$ npm i
|
||||
```
|
||||
|
||||
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
|
||||
$ npm run docker:db
|
||||
```
|
||||
|
||||
This will start the following services:
|
||||
- **PostgreSQL**
|
||||
- **Redis**
|
||||
- **MinIO**
|
||||
|
||||
And now, you can start the server with the command:
|
||||
|
||||
```bash
|
||||
$ npm run dev:start
|
||||
```
|
||||
|
||||
You can check the documentation accessing the endpoint `/` in your browser
|
||||
|
||||
To run in production you can use the following command:
|
||||
|
||||
```bash
|
||||
$ npm run docker
|
||||
```
|
||||
|
||||
This will start all the previous services and the back-end image.
|
||||
|
||||
## 🗄️ Stack
|
||||
|
||||
This back-end uses the following stack:
|
||||
- **Docker**
|
||||
- **Fastify**
|
||||
- **MinIO**
|
||||
- **NestJS**
|
||||
- **Passport**
|
||||
- **PostgreSQL**
|
||||
- **Prisma**
|
||||
- **Redis**
|
||||
- **Swagger**
|
||||
- **Typescript**
|
||||
|
||||
## License
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"name": "project-knedita",
|
||||
"version": "0.0.1",
|
||||
"version": "0.1.0",
|
||||
"description": "A open-source social media",
|
||||
"author": "CookieDasora",
|
||||
"author": "hknsh",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "nest build",
|
||||
|
@ -11,14 +11,12 @@
|
|||
"docker": "docker compose --env-file docker.env up -d",
|
||||
"docker:build": "docker build -t api . && docker compose up -d",
|
||||
"docker:db": "docker compose -f docker-compose.db.yml up -d",
|
||||
"docker:seed": "docker exec -it api npm run prisma:seed",
|
||||
"lint": "npx @biomejs/biome check --apply .",
|
||||
"migrate:deploy": "prisma migrate deploy",
|
||||
"migrate:dev": "prisma migrate dev",
|
||||
"migrate:dev:create": "prisma migrate dev --create-only",
|
||||
"migrate:reset": "prisma migrate reset",
|
||||
"prisma:generate": "npx prisma generate",
|
||||
"prisma:seed": "prisma db seed",
|
||||
"prisma:studio": "npx prisma studio",
|
||||
"prepare": "husky",
|
||||
"prod": "npm run migrate:deploy && node dist/main",
|
||||
|
|
|
@ -8,8 +8,6 @@ import { DocumentBuilder, SwaggerModule } from "@nestjs/swagger";
|
|||
import { patchNestJsSwagger } from "nestjs-zod";
|
||||
import { AppModule } from "./app.module";
|
||||
|
||||
// TODO: File Upload (Posts and User Profile Image)
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create<NestFastifyApplication>(
|
||||
AppModule,
|
||||
|
|
Loading…
Reference in a new issue