From 334efa15b54273a598818660ec566e46c0ea762a Mon Sep 17 00:00:00 2001
From: hknsh
Date: Thu, 15 Feb 2024 13:03:04 +0000
Subject: [PATCH] feat: new readme
---
README.md | 71 ++++++++++++++++++++++++++++++++++++++--------------
package.json | 6 ++---
src/main.ts | 2 --
3 files changed, 54 insertions(+), 25 deletions(-)
diff --git a/README.md b/README.md
index 7de50a8..c8a489d 100644
--- a/README.md
+++ b/README.md
@@ -6,29 +6,62 @@
-## 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
diff --git a/package.json b/package.json
index d7ba347..33ea3ce 100644
--- a/package.json
+++ b/package.json
@@ -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",
diff --git a/src/main.ts b/src/main.ts
index 0ddd49d..29639dd 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -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(
AppModule,