Project Structure
Concordia follows a well-organized, modular file structure designed for scalability and maintainability.Root Directory Structure
Source Directory (src/)
The src/ directory contains all application source code:
Detailed Structure
Actions (src/actions/)
Server-side business logic and data mutations.
- Encapsulate business logic
- Handle data validation
- Perform database mutations
- Return type-safe results
Components (src/components/)
Reusable UI components organized by domain and purpose.
modules/- Domain-specific components (blog, services, places)templates/- Page-level layouts and sectionsui/- Reusable, generic UI componentsTools/- Layout and utility componentsadmin/- Admin-only components
Database (src/database/)
Database schemas, migrations, loaders, and seed data.
drizzle.ts - Database connection and configuration:
schemas.ts - Centralized schema exports:
loaders/ - Data loading utilities:
Library (src/lib/)
Shared utilities, helpers, and services.
Pages (src/pages/)
File-based routing structure.
[lang]/- Dynamic language parameter (fr, en, ar, es)[slug].astro- Dynamic route for content[...all].ts- Catch-all routeapi/- Server-side API endpoints
Internationalization (src/i18n/)
Translation files organized by locale.
Styles (src/styles/)
Global CSS and design tokens.
Testing Structure
Scripts Directory
Configuration Files
astro.config.mjs
Astro framework configuration:
drizzle.config.ts
Drizzle ORM configuration:
tsconfig.json
TypeScript configuration:
Naming Conventions
Files
- Components:
PascalCase.astro(e.g.,PostCard.astro) - Utilities:
kebab-case.ts(e.g.,locale-url.ts) - Schemas:
entity_name.schema.ts(e.g.,blog_posts.schema.ts) - Tests:
*.test.tsor*.spec.ts
Code
- Variables/Functions:
camelCase - Types/Interfaces:
PascalCase - Constants:
SCREAMING_SNAKE_CASE - Database Tables:
snake_case
Best Practices
- Colocation: Keep related files close (components, styles, tests)
- Feature Modules: Group by domain/feature, not by file type
- Index Files: Use
index.tsfor clean imports - Type Imports: Import types from schemas, not from ORM
- Barrel Exports: Export from
index.tsfor public APIs
Next Steps
- Architecture Overview - System design and patterns
- Tech Stack - Technology details
- Development Guide - Setup and workflow