A full-stack Next.js application for managing ICPC-style programming competitions. Built with modern web technologies and following Next.js 13+ App Router conventions.
- Framework: Next.js 13+ (App Router)
- Database: PostgreSQL with Drizzle ORM
- Styling: CSS Modules
- Authentication: [Add auth provider]
src/ # All source code
├── app/ # Next.js App Router
│ ├── api/ # Backend API endpoints
│ │ ├── auth/ # Authentication endpoints
│ │ │ ├── route.ts # Auth API implementation
│ │ │ └── __tests__/# API tests and documentation
│ │ │ └── auth.rest # REST API tests
│ │ └── training/ # Training management API
│ │
│ ├── (routes)/ # Frontend pages
│ │ ├── create-training/ # Training creation page
│ │ └── profile/ # User profile pages
│ │
│ ├── layout.tsx # Root layout
│ └── page.tsx # Home page
├── lib/ # Shared utilities
│ └── db/ # Database layer
│ ├── schema/ # Database tables & relationships
│ └── index.ts # Database connection
└── components/ # React components
├── ui/ # Basic UI components
└── features/ # Feature-specific components
public/ # Static assets
└── images/ # Image files
drizzle/ # Database management
├── migrations/ # Database migrations
└── schema.ts # Main schema file
The main application code using Next.js App Router:
-
api/: Backend API endpoints- Each feature domain (auth, training) contains:
route.ts: API implementation__tests__/: Tests and API documentation*.rest: HTTP request examples
- Uses Next.js Route Handlers
- Example:
training/route.tshandles training CRUD operations
- Each feature domain (auth, training) contains:
-
(routes)/: Frontend pages- Each folder is a route in the application
page.tsxdefines the page contentlayout.tsxfor shared layouts- CSS Modules for styling
Common utilities and business logic:
db/: Database layerschema/: Table definitions and relationshipsindex.ts: Database connection and configuration- Uses Drizzle ORM for type-safe database operations
Reusable UI components:
ui/: Basic components (buttons, inputs, cards)features/: Complex, feature-specific components
Database version control and schema:
migrations/: Track database changesschema.ts: Central schema definition
page.tsx: Next.js page componentslayout.tsx: Layout componentsroute.ts: API route handlers*.module.css: CSS Modules for stylingindex.ts: Barrel exports
[Add setup instructions here]
[Add development workflow instructions here]