Skip to content

LeSoviet/RedditTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 

Repository files navigation

RedditTest

Ux4WithLogs

Ux3WithLogs

Ux2WithLogs

Ux2 ---

Ux1

503010254-0d710c82-2da1-4163-99b4-5b57c7c38288


503010254-0d710c82-2da1-4163-99b4-5b57c7c38288 (1)


Docker

FrontTests

BackTests

πŸš€ Full-Stack Order Management System

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.


πŸ› οΈ Tech Stack Highlights

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

✨ Key Features

Core Functionality

  • βœ… 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.

User Experience

  • βœ… Professional Toast Notifications and clear Status Badges.
  • βœ… Responsive Design using TailwindCSS.

Developer Experience

  • βœ… Docker Support for quick setup.
  • βœ… Monorepo Architecture with shared types.
  • βœ… Comprehensive Testing (10 backend, 5 frontend tests).

🐳 Quick Start (Recommended: Docker)

The easiest way to run the entire application with one command. No need to install PostgreSQL or Node.js locally.

Prerequisites

  • Docker Desktop installed and running.

Start the Application

  1. Clone the repository and navigate to the root directory.

  2. Run the following command:

    docker compose up --build

Access Points

  • 🎨 Frontend: http://localhost:5173
  • πŸš€ Backend API: http://localhost:3000

πŸ’‘ The database is automatically migrated and seeded with 10 sample orders on the first run.


πŸ’» Manual Setup

For manual setup, you need Node.js >= 22.0.0, pnpm >= 8.0.0, and a running local PostgreSQL >= 14 instance.

  1. Clone & Install:
    git clone <repository-url>
    cd RedditTest
    pnpm install
  2. 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)
  3. 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 

πŸ“š API Documentation

Base URL

http://localhost:3000/api

Endpoints

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 -

Response Format

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", ... } }



About

TypeScript Ecosystem

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published