Skip to content

Commit 42f0a12

Browse files
committed
docs: update README with accurate configuration and remove database schema
- Update environment configuration to match actual .env.docker values - Remove database schema section as requested - Correct API endpoints to match actual controller implementations - Update service integration details and configuration - Improve documentation accuracy and user-friendliness
1 parent 83f2dbb commit 42f0a12

File tree

1 file changed

+24
-43
lines changed

1 file changed

+24
-43
lines changed

README.md

Lines changed: 24 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -80,38 +80,40 @@ src/
8080
```
8181

8282
3. **Environment Configuration**
83-
Create `.env` and `.env.docker` files with the following variables:
83+
The service includes a pre-configured `.env.docker` file with the following variables:
8484
```env
8585
# App Configuration
86-
NODE_ENV=development
87-
APP_NAME=NestJS Post Service
88-
APP_DEBUG=false
89-
APP_CORS_ORIGINS=http://localhost:3000
86+
NODE_ENV="local"
87+
APP_NAME="@backendworks/post"
88+
APP_CORS_ORIGINS="*"
89+
APP_DEBUG=true
9090
9191
# HTTP Configuration
9292
HTTP_ENABLE=true
93-
HTTP_HOST=0.0.0.0
93+
HTTP_HOST="0.0.0.0"
9494
HTTP_PORT=9002
95-
HTTP_VERSIONING_ENABLE=false
95+
HTTP_VERSIONING_ENABLE=true
9696
HTTP_VERSION=1
9797
9898
# Database Configuration
99-
DATABASE_URL=postgresql://username:password@localhost:5432/post_db
99+
DATABASE_URL="postgresql://admin:master123@localhost:5432/postgres?schema=public"
100+
101+
# JWT Configuration
102+
ACCESS_TOKEN_SECRET_KEY="EAJYjNJUnRGJ6uq1YfGw4NG1pd1z102J"
103+
ACCESS_TOKEN_EXPIRED="1d"
104+
REFRESH_TOKEN_SECRET_KEY="LcnlpiuHIJ6eS51u1mcOdk0P49r2Crwu"
105+
REFRESH_TOKEN_EXPIRED="7d"
100106
101107
# Redis Configuration
102-
REDIS_URL=redis://localhost:6379
103-
REDIS_KEY_PREFIX=post:
108+
REDIS_URL="redis://localhost:6379"
109+
REDIS_KEY_PREFIX="post:"
104110
REDIS_TTL=3600
105111
106112
# gRPC Configuration
107-
GRPC_URL=0.0.0.0:50052
108-
GRPC_PACKAGE=post
109-
110-
# Auth Service Configuration (for gRPC communication)
111-
AUTH_SERVICE_URL=0.0.0.0:50051
112-
113-
# Monitoring (Optional)
114-
SENTRY_DSN=your-sentry-dsn
113+
GRPC_URL="0.0.0.0:50052"
114+
GRPC_PACKAGE="post"
115+
GRPC_AUTH_URL="0.0.0.0:50051"
116+
GRPC_AUTH_PACKAGE="auth"
115117
```
116118

117119
4. **Database Setup**
@@ -155,14 +157,12 @@ docker run -p 9002:9002 post-service
155157
### Post Management Endpoints
156158

157159
#### Public Endpoints
158-
- `GET /posts` - List all posts (paginated)
159-
- `GET /posts/:id` - Get post by ID
160+
- `GET /post` - List all posts (paginated)
160161

161162
#### Protected Endpoints
162-
- `POST /posts` - Create new post
163-
- `PUT /posts/:id` - Update post
164-
- `DELETE /posts/:id` - Delete post
165-
- `POST /posts/bulk-delete` - Bulk delete posts
163+
- `POST /post` - Create new post
164+
- `PUT /post/:id` - Update post
165+
- `DELETE /post/batch` - Bulk delete posts
166166

167167
### Query Parameters
168168

@@ -193,25 +193,6 @@ docker run -p 9002:9002 post-service
193193
- `UpdatePost` - Update an existing post
194194
- `DeletePost` - Delete a post
195195

196-
## 🗄️ Database Schema
197-
198-
### Post Model
199-
```sql
200-
CREATE TABLE posts (
201-
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
202-
title VARCHAR NOT NULL,
203-
content TEXT NOT NULL,
204-
images TEXT[] DEFAULT '{}',
205-
created_by UUID NOT NULL,
206-
updated_by UUID,
207-
deleted_by UUID,
208-
created_at TIMESTAMP DEFAULT NOW(),
209-
updated_at TIMESTAMP DEFAULT NOW(),
210-
deleted_at TIMESTAMP,
211-
is_deleted BOOLEAN DEFAULT false
212-
);
213-
```
214-
215196
## 🔧 Configuration
216197

217198
The service uses a modular configuration system with environment-specific settings:

0 commit comments

Comments
 (0)