4.6 KiB
4.6 KiB
File Organization
This document describes the organization of files in the EuchreCamp project.
Root Directory
Essential Files (Keep in Root)
README.md- Main project documentationAGENTS.md- AI agent guideCHANGELOG.md- Version changelogpackage.json- Node.js dependencies and scriptspackage-lock.json- Dependency lock filetsconfig.json- TypeScript configurationnext.config.js- Next.js configuration.gitignore- Git ignore fileDockerfile- Docker build configurationjustfile- Development task automation
Configuration Files (Keep in Root)
.eslintrc.json- ESLint configurationpostcss.config.mjs- PostCSS configurationplaywright.config.ts- Playwright test configurationvitest.config.mts- Vitest configurationvitest.setup.ts- Vitest setup.dockerignore- Docker ignore filemise.toml- Mise version manager config
Docker Files (Keep in Root)
docker-compose.yml- Main Docker Composedocker-compose.dev.yml- Development Docker Composedocker-compose.override.yml- Override for devdocker-compose.casaos.yml- CasaOS specific
Environment Files (Keep in Root, Gitignored)
.env- Environment variables.env.development- Development environment
Organized Directories
.gitea/ - Gitea Actions Workflows
workflows/pr.yml- Pull request workflow (unit + acceptance tests)workflows/test.yml- Test workflow (unit tests on branch pushes)workflows/release.yml- Release workflow (version bump + Docker build)WORKFLOW_ARCHITECTURE.md- Workflow architecture documentation
docs/ - Documentation
deployment/- Deployment documentationCASAOS_DEPLOYMENT.md- CasaOS deployment guideDOCKER.md- Docker deployment instructions
TODO.md- Project TODO list (in docs root for visibility)USER_STORIES.md- User stories organized by epic- Other documentation files (design, implementation, testing, etc.)
scripts/ - Utility Scripts
python/- Python scripts (legacy/old functionality)generate_games.py- Generate sample gamesupdate_partnership_stats.py- Update partnership statsupdate_player_stats.py- Update player stats
bump-version.js- Version bumping scriptbuild-and-push-docker.js- Docker build and push scriptswitch-database.js- Database provider switchingcreate-admin-via-api.js- Admin user creation via APIcreate-admin-better-auth.js- Admin user creation via databaselist-users.js- List all usersupdate-admin-password.js- Update admin passwordseed.js- Database seeding- And other Node.js scripts...
src/ - Source Code
app/- Next.js app directoryapi/- API routesauth/- Authentication pagesadmin/- Admin pagesplayers/- Player pagesrankings/- Rankings pagecomponents/- Shared components
lib/- Utilities and configurationauth.ts- Better Auth configurationprisma.ts- Prisma client (supports SQLite and PostgreSQL)permissions.ts- Authorization functionselo-utils.ts- Elo calculation utilities
__tests__/- Vitest and Playwright testsunit/- Unit testse2e/- End-to-end acceptance tests
prisma/ - Database
schema.prisma- Prisma schemamigrations/- Database migrationsdev.db- SQLite development database (if using SQLite)
public/ - Static Assets
- Images, fonts, and other static files
playwright/ - Playwright Test Data
- Authentication state files
Generated Directories (Gitignored)
.next/- Next.js build outputnode_modules/- Node.js dependenciesplaywright-report/- Playwright test reportstest-results/- Test results
File Organization Principles
- Keep standard files in root: package.json, tsconfig.json, etc.
- Organize by function: Group related files in directories
- Separate generated from source: Keep build outputs and dependencies separate
- Document organization: Use this file to explain structure
- Follow conventions: Use standard naming and organization patterns
CI/CD File Organization
Workflows
.gitea/workflows/pr.yml- Pull request validation.gitea/workflows/test.yml- Branch testing.gitea/workflows/release.yml- Main branch release
Database Strategy
- CI/Testing: SQLite (fast, no server)
- Production: PostgreSQL (production-like)
Testing
- Unit tests:
npm run test:run - Acceptance tests (SQLite):
DATABASE_PROVIDER=sqlite npm run test:acceptance - Acceptance tests (PostgreSQL):
npm run test:acceptance(with Docker)