Prompt Details
Model
Chat - (gpt-5.6)
Token size
272
Example input
[Application Concept]: Multi-Tenant B2B Enterprise CRM & Lead Pipeline
[Target Tech Stack]: Next.js 15, FastAPI (Python), PostgreSQL, Redis
[Expected Scale & Concurrency]: 100k Monthly Active Users, 5,000 Concurrent Requests
[Cloud Provider]: AWS (ECS Fargate, RDS Aurora, ElastiCache Redis, CloudFront)
Example output
### 1. System Architecture Overview
The system employs a multi-tenant microservices-lite architecture:
* **Presentation Tier:** Next.js 15 hosted on Edge CDN with Server-Side Rendering (SSR) for initial loads and static asset distribution.
* **API Gateway & Routing:** AWS Application Load Balancer (ALB) directing requests to containerized FastAPI services running on AWS ECS Fargate.
* **Tenant Isolation:** Row-Level Security (RLS) within PostgreSQL mapped to a unique `tenant_id` on all tables, enforced by JWT middleware.
* **Asynchronous Processing:** Redis-backed Celery workers executing long-running export and ingestion tasks out-of-band.
### 2. Database Schema & Data Model
* **tenants:** `id` (UUID, PK), `company_name` (VARCHAR), `plan_tier` (VARCHAR), `created_at` (TIMESTAMP)
* **users:** `id` (UUID, PK), `tenant_id` (UUID, FK -> tenants.id, INDEX), `email` (VARCHAR, UNIQUE), `password_hash` (VARCHAR), `role` (VARCHAR)
* **leads:** `id` (UUID, PK), `tenant_id` (UUID, FK -> tenants.id, INDEX), `assigned_user_id` (UUID, FK -> users.id), `status` (VARCHAR), `deal_value` (NUMERIC(12,2)), `created_at` (TIMESTAMP, INDEX)
* **activity_logs:** `id` (UUID, PK), `tenant_id` (UUID, FK), `lead_id` (UUID, FK), `event_type` (VARCHAR), `payload` (JSONB)
* **Indexing Strategy:** Compound index on `(tenant_id, status)` and `(tenant_id, created_at DESC)` for sub-millisecond filtering.
### 3. Core API Contract Specifications
| Method | Route | Request Payload Structure | Response Codes |
| :--- | :--- | :--- | :--- |
| **POST** | `/api/v1/auth/token` | `{"email": "user@org.com", "password": "..."}` | `200 OK`, `401 Unauthorized` |
| **GET** | `/api/v1/leads` | Query params: `?status=open&page=1&limit=25` | `200 OK`, `403 Forbidden` |
| **POST** | `/api/v1/leads` | `{"name": "Acme Corp", "value": 50000, "assigned_to": "UUID"}` | `201 Created`, `422 Unprocessable` |
| **PATCH** | `/api/v1/leads/{id}/status`| `{"status": "negotiation", "notes": "Demo booked"}` | `200 OK`, `404 Not Found` |
### 4. Cloud Infrastructure & CI/CD Pipeline
* **Compute:** AWS ECS Fargate with auto-scaling triggers (CPU > 70% or Memory > 75%, min 3, max 20 tasks across 3 AZs).
* **Database:** Amazon RDS Aurora PostgreSQL with 1 Writer node and 2 Read Replicas across multi-AZ configurations.
* **Caching Layer:** Amazon ElastiCache (Redis cluster mode enabled) for session store and hot tenant data caching.
* **CI/CD Pipeline:** GitHub Actions running linting, PyTest unit suites, Docker image generation, pushing to AWS ECR, and initiating zero-downtime rolling ECS deployments.
### 5. Security & Performance Optimization
* **Authentication:** Stateless asymmetric RS256 JWT tokens containing `tenant_id`, `user_id`, and `role` claims with 15-minute expirations and Redis refresh token rotation.
* **Rate Limiting:** Token-bucket rate limiter via Redis returning `429 Too Many Requests` (100 req/min per tenant).
* **Caching Topology:** Read-through caching pattern on dashboard metrics with a 60-second TTL to offload Aurora read replicas.
By purchasing this prompt, you agree to our terms of service
GPT-5.6
Generates end-to-end full-stack software system architecture, database ERD schemas, RESTful/GraphQL API endpoints, and cloud infrastructure deployment specs.
...more
Added 2 days ago
