Source Tree Structure
Last updated:
October 6, 2025
Reading time:
6 minutes
File size:
12 KB
Unified Project Structure
BATbern-Platform/
βββ shared-kernel/ # Shared types, events, utilities
βββ services/ # Domain services
β βββ event-management/ # Event Management Service
β βββ speaker-coordination/ # Speaker Coordination Service
β βββ partner-coordination/ # Partner Coordination Service
β βββ attendee-experience/ # Attendee Experience Service
β βββ company-management/ # Company Management Service
βββ api-gateway/ # Unified API Gateway
βββ web-frontend/ # React Frontend Application
βββ infrastructure/ # Infrastructure as Code
β βββ global-stacks/ # Region-independent resources
β βββ core-infrastructure/ # Regional shared resources
β βββ domain-stacks/ # Per-domain infrastructure
β βββ environments/ # Environment-specific configs
βββ e2e-tests/ # End-to-end tests
βββ scripts/ # Build and deployment scripts
βββ docs/ # Documentation
βββ README.md # Project overview
Service Structure Template
services/{domain-service}/
βββ src/main/java/ch/batbern/{domain}/
β βββ controller/ # REST API controllers
β βββ service/ # Business logic layer
β βββ repository/ # Data access layer
β βββ domain/ # Domain models and entities
β βββ dto/ # Data transfer objects
β βββ exception/ # Custom exceptions
β βββ security/ # Security components
βββ src/main/resources/
β βββ application.yml # Configuration
β βββ db/migration/ # Flyway migrations
βββ src/test/java/ # Unit and integration tests
βββ build.gradle # Build configuration
βββ README.md # Service documentation
Frontend Structure
web-frontend/
βββ src/
β βββ components/ # Reusable UI components
β β βββ common/ # Shared components
β β βββ organizer/ # Organizer-specific components
β β βββ speaker/ # Speaker-specific components
β β βββ partner/ # Partner-specific components
β β βββ attendee/ # Attendee-specific components
β βββ hooks/ # Custom React hooks
β βββ services/ # API client services
β βββ stores/ # Zustand state stores
β βββ types/ # TypeScript type definitions
β βββ utils/ # Utility functions
β βββ pages/ # Page components
βββ public/ # Static assets
βββ tests/ # Component and integration tests
βββ e2e/ # End-to-end tests
βββ package.json # Dependencies and scripts
βββ vite.config.ts # Vite configuration
βββ tailwind.config.js # Tailwind CSS configuration
Shared Kernel Structure
shared-kernel/
βββ src/main/java/ch/batbern/shared/
β βββ events/ # Domain events
β β βββ EventCreatedEvent.java
β β βββ SpeakerInvitedEvent.java
β β βββ PartnerAnalyticsEvent.java
β βββ types/ # Shared value objects
β β βββ CompanyId.java
β β βββ EventId.java
β β βββ UserId.java
β βββ exceptions/ # Common exceptions
β β βββ DomainException.java
β β βββ ValidationException.java
β βββ utils/ # Utility classes
β βββ DateTimeUtils.java
β βββ ValidationUtils.java
βββ src/main/resources/
β βββ application-shared.yml # Shared configuration
βββ build.gradle # Shared dependencies
Infrastructure Structure
infrastructure/
βββ lib/ # CDK construct library
β βββ core-infrastructure-stack.ts # Core AWS resources
β βββ domain-service-stack.ts # Service-specific resources
β βββ frontend-stack.ts # Frontend deployment
β βββ monitoring-stack.ts # Observability resources
βββ bin/ # CDK applications
β βββ core-app.ts # Core infrastructure app
β βββ domain-app.ts # Domain services app
β βββ frontend-app.ts # Frontend app
βββ environments/ # Environment configs
β βββ dev.ts # Development environment
β βββ staging.ts # Staging environment
β βββ prod.ts # Production environment
βββ cdk.json # CDK configuration
βββ package.json # CDK dependencies
βββ tsconfig.json # TypeScript configuration
API Gateway Structure
api-gateway/
βββ src/main/java/ch/batbern/gateway/
β βββ config/ # Gateway configuration
β β βββ SecurityConfig.java
β β βββ CorsConfig.java
β β βββ RateLimitConfig.java
β βββ filter/ # Request/response filters
β β βββ AuthenticationFilter.java
β β βββ LoggingFilter.java
β β βββ RateLimitFilter.java
β βββ route/ # Route configurations
β β βββ EventRoutes.java
β β βββ SpeakerRoutes.java
β β βββ PartnerRoutes.java
β βββ exception/ # Gateway exceptions
β βββ GatewayException.java
βββ src/main/resources/
β βββ application.yml # Gateway configuration
β βββ routes/ # Route definitions
βββ build.gradle # Gateway dependencies
End-to-End Tests Structure
e2e-tests/
βββ tests/ # Test specifications
β βββ organizer/ # Organizer workflows
β β βββ event-creation.spec.ts
β β βββ speaker-management.spec.ts
β βββ speaker/ # Speaker workflows
β β βββ invitation-response.spec.ts
β β βββ material-upload.spec.ts
β βββ partner/ # Partner workflows
β β βββ analytics-dashboard.spec.ts
β β βββ roi-reports.spec.ts
β βββ attendee/ # Attendee workflows
β βββ event-registration.spec.ts
β βββ content-search.spec.ts
βββ fixtures/ # Test data
β βββ events.json
β βββ speakers.json
β βββ companies.json
βββ page-objects/ # Page object models
β βββ EventPage.ts
β βββ SpeakerPage.ts
β βββ DashboardPage.ts
βββ utils/ # Test utilities
β βββ auth-helper.ts
β βββ data-factory.ts
βββ playwright.config.ts # Playwright configuration
βββ package.json # Test dependencies
Scripts Structure
scripts/
βββ development/ # Development scripts
β βββ setup-local-env.sh # Local environment setup
β βββ start-services.sh # Start all services
β βββ generate-test-data.sh # Generate test data
βββ deployment/ # Deployment scripts
β βββ deploy-to-staging.sh # Staging deployment
β βββ deploy-to-production.sh # Production deployment
β βββ rollback.sh # Rollback script
βββ maintenance/ # Maintenance scripts
β βββ backup-database.sh # Database backup
β βββ clear-cache.sh # Cache clearing
β βββ health-check.sh # System health check
βββ ci/ # CI/CD scripts
βββ build-and-test.sh # Build and test pipeline
βββ security-scan.sh # Security scanning
βββ performance-test.sh # Performance testing
Documentation Structure
docs/
βββ architecture/ # Architecture documentation
β βββ 01-system-overview.md
β βββ 02-infrastructure-deployment.md
β βββ 03-data-architecture.md
β βββ 04-api-design.md
β βββ 05-frontend-architecture.md
β βββ 06-backend-architecture.md
β βββ 07-development-standards.md
β βββ 08-operations-security.md
β βββ 09-aiml-architecture.md
β βββ coding-standards.md # Coding standards and conventions
β βββ tech-stack.md # Technology stack details
β βββ source-tree.md # This file - source tree structure
β βββ index.md # Architecture overview
βββ api/ # API documentation
β βββ openapi.yml # OpenAPI specification
β βββ endpoints/ # Endpoint documentation
β βββ examples/ # Request/response examples
βββ deployment/ # Deployment guides
β βββ local-setup.md # Local development setup
β βββ staging-deployment.md # Staging deployment guide
β βββ production-deployment.md # Production deployment guide
βββ guides/ # Developer guides
β βββ getting-started.md # Getting started guide
β βββ testing-guide.md # Testing best practices
β βββ troubleshooting.md # Common issues and solutions
βββ prd/ # Product requirements
βββ epic-*.md # Epic specifications
βββ user-stories/ # User story details
Key Directory Conventions
Naming Conventions
- Directories:
kebab-casefor multi-word directories - Java packages:
lowercasefollowing Java conventions - TypeScript files:
camelCase.tsorPascalCase.tsxfor components - Configuration files:
kebab-case.ymlorcamelCase.json
File Organization Principles
- Domain Separation: Each bounded context has its own service directory
- Layered Architecture: Clear separation of concerns within services
- Shared Resources: Common code in shared-kernel, reusable infrastructure
- Test Proximity: Tests close to the code they test
- Configuration Management: Environment-specific configs in dedicated directories
Integration Points
- API Gateway: Central entry point routing to domain services
- Shared Kernel: Common types and events shared across services
- Infrastructure: Shared AWS resources and deployment configurations
- Frontend: Single React application consuming all domain APIs