feat: new readme

This commit is contained in:
Hackntosh 2024-02-15 13:03:04 +00:00
parent 59cee20e5e
commit 334efa15b5
3 changed files with 54 additions and 25 deletions

View file

@ -6,29 +6,62 @@
</picture> </picture>
</p> </p>
## Stack A simple RESTful API made with **NestJS** and **Fastify**.
**Client**: NextJS, TailwindCSS and Radix UI Icons. ### 🚀 Preparing the environment
You can find the front-end [here](https://github.com/CookieDasora/project-knedita-client)
**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 ✅ ```bash
- Add post attachments $ npm i
- Create/update/delete Users ✅ ```
- Password recuperation
- Two step verification 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.
- Able to choose a profile picture✅
- Probably gonna use LocalStack to mock Amazon S3✅ You can find the templates for those files on `.env.example` and `docker.env.example`.
- Image compression ✅
- Following/unfollowing features ✅ To run the necessary services you can execute the following command:
- Like posts ✅
- Authentication ✅ ```bash
- Add more verification (like, if the password is too short) ✅ $ npm run docker:db
- Set display name ✅ ```
- Add rate limit ✅
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 ## License

View file

@ -1,8 +1,8 @@
{ {
"name": "project-knedita", "name": "project-knedita",
"version": "0.0.1", "version": "0.1.0",
"description": "A open-source social media", "description": "A open-source social media",
"author": "CookieDasora", "author": "hknsh",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"build": "nest build", "build": "nest build",
@ -11,14 +11,12 @@
"docker": "docker compose --env-file docker.env up -d", "docker": "docker compose --env-file docker.env up -d",
"docker:build": "docker build -t api . && docker compose up -d", "docker:build": "docker build -t api . && docker compose up -d",
"docker:db": "docker compose -f docker-compose.db.yml 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 .", "lint": "npx @biomejs/biome check --apply .",
"migrate:deploy": "prisma migrate deploy", "migrate:deploy": "prisma migrate deploy",
"migrate:dev": "prisma migrate dev", "migrate:dev": "prisma migrate dev",
"migrate:dev:create": "prisma migrate dev --create-only", "migrate:dev:create": "prisma migrate dev --create-only",
"migrate:reset": "prisma migrate reset", "migrate:reset": "prisma migrate reset",
"prisma:generate": "npx prisma generate", "prisma:generate": "npx prisma generate",
"prisma:seed": "prisma db seed",
"prisma:studio": "npx prisma studio", "prisma:studio": "npx prisma studio",
"prepare": "husky", "prepare": "husky",
"prod": "npm run migrate:deploy && node dist/main", "prod": "npm run migrate:deploy && node dist/main",

View file

@ -8,8 +8,6 @@ import { DocumentBuilder, SwaggerModule } from "@nestjs/swagger";
import { patchNestJsSwagger } from "nestjs-zod"; import { patchNestJsSwagger } from "nestjs-zod";
import { AppModule } from "./app.module"; import { AppModule } from "./app.module";
// TODO: File Upload (Posts and User Profile Image)
async function bootstrap() { async function bootstrap() {
const app = await NestFactory.create<NestFastifyApplication>( const app = await NestFactory.create<NestFastifyApplication>(
AppModule, AppModule,