---
A modern, production-ready Full-Stack Order Management application focused on end-to-end type safety, robust features, and professional UX. Features complete CRUD operations, server-side pagination, and status filtering.
This project uses a pnpm monorepo architecture to share types between the frontend and backend.
| Area | Technology | Purpose |
|---|---|---|
| Backend | Node.js 22, Express | Runtime & Web Framework |
| Database | PostgreSQL 14, Prisma | ORM & Data Persistence |
| Frontend | React 19, Vite | UI Framework & Build Tool |
| Type Safety | TypeScript 5.9, Zod | End-to-end Type Safety & Validation |
| State | React Query | Server State Management & Caching |
- β Full CRUD Operations for orders.
- β Server-side Pagination and Status Filtering (PENDING, COMPLETED, CANCELLED).
- β Real-time Validation using shared Zod schemas.
- β End-to-end Type Safety across the stack.
- β Professional Toast Notifications and clear Status Badges.
- β Responsive Design using TailwindCSS.
- β Docker Support for quick setup.
- β Monorepo Architecture with shared types.
- β Comprehensive Testing (10 backend, 5 frontend tests).
The easiest way to run the entire application with one command. No need to install PostgreSQL or Node.js locally.
- Docker Desktop installed and running.
-
Clone the repository and navigate to the root directory.
-
Run the following command:
docker compose up --build
- π¨ Frontend:
http://localhost:5173 - π Backend API:
http://localhost:3000
π‘ The database is automatically migrated and seeded with 10 sample orders on the first run.
For manual setup, you need Node.js >= 22.0.0, pnpm >= 8.0.0, and a running local PostgreSQL >= 14 instance.
- Clone & Install:
git clone <repository-url> cd RedditTest pnpm install
- Database Setup: Configure your database URL in
apps/backend/.env, then:pnpm --filter backend prisma:generate # Generate Prisma Client pnpm --filter backend prisma:migrate dev # Run migrations pnpm --filter backend prisma:seed # Seed data (optional)
- Start Servers: Run these commands in two separate terminals:
# Terminal 1: Backend API (http://localhost:3000) pnpm dev:backend # Terminal 2: Frontend (http://localhost:5173) pnpm dev:frontend
http://localhost:3000/api
| Method | Endpoint | Description | Query Parameters |
|---|---|---|---|
GET |
/api/orders |
Get paginated orders | page, page_size, status |
GET |
/api/orders/:id |
Get order by ID | - |
POST |
/api/orders |
Create new order | - |
PUT |
/api/orders/:id |
Update order | - |
DELETE |
/api/orders/:id |
Delete order | - |
All successful responses include a success: true flag and a data object. Errors include success: false and an error object with a message and code.
# Example Success Response
```json
{ "success": true, "data": { "id": "uuid", ... } }








