Project Structure
This guide provides an overview of the FSS project structure, explaining the purpose of each directory and key files.
Root Directory
fss/
├── projects/fss/ # Main project directory
│ ├── backend/ # NestJS backend API
│ ├── frontend/ # Next.js frontend application
│ ├── docs/ # Documentation (Docusaurus)
│ └── ...
├── LICENSE # Project license
└── README.md # Project readme
Backend Structure (NestJS)
backend/
├── src/
│ ├── common/ # Shared utilities
│ │ ├── prisma.service.ts
│ │ └── redis-throttler.storage.ts
│ ├── config/ # Configuration module
│ │ ├── config.controller.ts
│ │ ├── config.module.ts
│ │ └── config.service.ts
│ ├── modules/ # Feature modules
│ │ ├── auth/ # Authentication
│ │ │ ├── controllers/
│ │ │ ├── dto/
│ │ │ ├── guards/
│ │ │ └── services/
│ │ ├── admin/ # Admin panel
│ │ ├── captcha/ # CAPTCHA verification
│ │ ├── email/ # Email service
│ │ ├── health/ # Health checks
│ │ ├── payment/ # Payment processing
│ │ └── ...
│ ├── app.controller.ts
│ ├── app.module.ts
│ ├── app.service.ts
│ └── main.ts # Application entry point
├── prisma/
│ ├── schema.prisma # Database schema
│ └── migrations/ # Database migrations
├── scripts/ # Utility scripts
├── Dockerfile # Docker configuration
├── docker-compose.yml # Docker Compose
└── package.json
Backend Key Files
| File | Description |
|---|---|
backend/src/main.ts | Application entry point |
backend/src/app.module.ts | Root module |
backend/prisma/schema.prisma | Database schema |
backend/Dockerfile | Backend container image |
backend/docker-compose.yml | Local development services |
Frontend Structure (Next.js)
frontend/
├── src/
│ ├── app/ # Next.js 14 App Router
│ │ ├── (auth)/ # Authentication pages
│ │ ├── (dashboard)/ # Dashboard pages
│ │ ├── api/ # API routes
│ │ ├── layout.tsx
│ │ └── page.tsx
│ ├── components/ # React components
│ │ ├── ui/ # Base UI components
│ │ ├── forms/ # Form components
│ │ └── ...
│ ├── lib/ # Utilities and configurations
│ ├── hooks/ # Custom React hooks
│ ├── store/ # State management
│ └── styles/ # Global styles
├── public/ # Static assets
├── next.config.js # Next.js configuration
├── tailwind.config.js # Tailwind CSS configuration
└── package.json
Frontend Key Files
| File | Description |
|---|---|
frontend/src/app/page.tsx | Home page |
frontend/next.config.js | Next.js configuration |
tailwind.config.js | Tailwind configuration |
Documentation Structure (Docusaurus)
docs/
├── docs/ # Documentation markdown files
│ ├── getting-started/
│ ├── core-concepts/
│ ├── configuration/
│ ├── packages/
│ ├── addons/
│ └── guides/
├── docusaurus.config.ts # Docusaurus configuration
├── sidebars.ts # Documentation sidebar
└── src/ # Theme customization
Documentation Key Files
| File | Description |
|---|---|
docs/docusaurus.config.ts | Site configuration |
docs/sidebars.ts | Navigation sidebar |
docs/docs/intro.md | Introduction page |
Database Schema
FSS uses PostgreSQL with Prisma ORM. Key models include:
Users
├── id: UUID
├── email: String (unique)
├── password: String (hashed)
├── role: Enum (user, admin)
├── emailVerified: Boolean
├── mfaEnabled: Boolean
├── createdAt: DateTime
└── updatedAt: DateTime
Products
├── id: UUID
├── name: String
├── description: Text
├── price: Decimal
├── stock: Integer
└── ...
Orders
├── id: UUID
├── userId: UUID
├── status: Enum
├── total: Decimal
└── ...
Environment Configuration
Backend (.env)
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/fss
# JWT
JWT_SECRET=your-secret-key
JWT_EXPIRATION=15m
# Redis
REDIS_URL=redis://localhost:6379
# App
PORT=3001
NODE_ENV=development
Frontend (.env.local)
NEXT_PUBLIC_API_URL=http://localhost:3001
NEXT_PUBLIC_APP_URL=http://localhost:3000
Related Documentation
- Quick Start Guide - Get started quickly
- Prerequisites - Required software
- Installation - Step-by-step setup
- Configuration - Environment configuration