LinkDesk/.kiro/steering/structure.md

3.5 KiB

Project Structure

Backend Architecture (/backend)

backend/
├── models/          # SQLAlchemy ORM models (User, Project, Asset, Task, etc.)
├── schemas/         # Pydantic schemas for request/response validation
├── routers/         # FastAPI route handlers (auth, users, projects, assets, etc.)
├── services/        # Business logic layer
├── utils/           # Utility functions (auth, file_handler, notifications)
├── docs/            # API documentation
├── uploads/         # File upload storage
├── main.py          # FastAPI application entry point
├── database.py      # Database configuration and session management
└── requirements.txt # Python dependencies

Backend Patterns

  • Models: SQLAlchemy declarative models with relationships
  • Schemas: Pydantic models for validation (separate from ORM models)
  • Routers: API endpoints organized by resource (auth, users, projects, etc.)
  • Database: Dependency injection pattern using get_db() generator
  • Auth: JWT tokens with Bearer authentication, role-based access control
  • CORS: Configured for localhost:5173 and localhost:5174

Frontend Architecture (/frontend)

frontend/
├── src/
│   ├── components/  # Vue components organized by feature
│   │   ├── asset/   # Asset-related components
│   │   ├── auth/    # Login/Register forms
│   │   ├── episode/ # Episode management
│   │   ├── layout/  # AppHeader, AppSidebar, UserMenu
│   │   ├── project/ # Project management components
│   │   ├── settings/# Settings panels
│   │   ├── shot/    # Shot management
│   │   ├── task/    # Task components
│   │   ├── ui/      # shadcn-vue UI primitives
│   │   └── user/    # User management
│   ├── views/       # Page-level components (route targets)
│   │   ├── auth/    # LoginView, RegisterView
│   │   ├── project/ # Project detail sub-views
│   │   └── developer/ # Developer portal views
│   ├── stores/      # Pinia state management (auth, projects, assets, etc.)
│   ├── services/    # API service layer (axios wrappers)
│   ├── types/       # TypeScript type definitions
│   ├── router/      # Vue Router configuration with guards
│   ├── utils/       # Utility functions
│   ├── App.vue      # Root component
│   └── main.ts      # Application entry point
├── components.json  # shadcn-vue configuration
├── vite.config.ts   # Vite build configuration
└── package.json     # Node.js dependencies

Frontend Patterns

  • Components: Feature-based organization, composition API with <script setup>
  • Stores: Pinia stores using composition API pattern (ref, computed)
  • Services: Axios-based API clients with centralized error handling
  • Routing: Nested routes for project details, meta-based auth guards
  • Auth: Token stored in localStorage, axios interceptors for auth headers
  • State: Pinia for global state, local refs for component state
  • Styling: Tailwind utility classes, shadcn-vue for consistent UI

Key Conventions

  • Enums: Shared between backend (Python Enum) and frontend (TypeScript types)
  • API Prefix: All API calls use /api prefix (configured in Vite proxy)
  • File Naming: PascalCase for components/views, camelCase for services/utils
  • Database: SQLite with auto-generated tables via SQLAlchemy metadata