The build was failing because repository files were ignored by .gitignore: - backend/src/features/*/data/*.repository.ts files were excluded by 'data/' pattern - These files exist locally but were missing in CI, causing TS2307 module errors - Controllers and services import these repositories, causing cascade failures Changes: - Updated .gitignore to allow TypeScript files in feature data directories - Added fuel-logs.repository.ts, stations.repository.ts, vehicles.repository.ts - Docker build now succeeds (tested with --no-cache) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
MotoVaultPro Backend
Modified Feature Capsule Architecture
Each feature is 100% self-contained in src/features/[name]/:
- api/ - HTTP endpoints and routing
- domain/ - Business logic and types
- data/ - Database operations
- migrations/ - Feature-specific schema
- external/ - External API integrations
- tests/ - All feature tests
- docs/ - Feature documentation
Quick Start (Containerized)
# From project root directory
# Copy environment variables
cp .env.example .env
# Update .env with your credentials
# Build and start all services (including backend)
make setup
# View logs
make logs-backend
# Run migrations
make migrate
# Run tests
make test
Available Commands (Containerized)
From project root:
make dev- Start all services in development modemake test- Run tests in containersmake migrate- Run database migrationsmake logs-backend- View backend logsmake shell-backend- Open shell in backend container
Inside container (via make shell-backend):
npm run dev- Start development server with hot reloadnpm run build- Build for productionnpm start- Run production buildnpm test- Run all testsnpm run test:feature -- --feature=vehicles- Test specific featurenpm run schema:generate- Generate combined schema
Core Modules
Configuration (src/core/config/)
environment.ts- Environment variable validationdatabase.ts- PostgreSQL connection poolredis.ts- Redis client and cache service
Security (src/core/security/)
auth.middleware.ts- JWT authentication via Auth0
Logging (src/core/logging/)
logger.ts- Structured logging with Winston
Feature Development
To create a new feature capsule:
../scripts/generate-feature-capsule.sh feature-name
This creates the complete capsule structure with all necessary files.
Testing
Tests mirror the source structure:
features/vehicles/
├── domain/
│ └── vehicles.service.ts
└── tests/
└── unit/
└── vehicles.service.test.ts
Run tests:
# All tests
npm test
# Specific feature
npm run test:feature -- --feature=vehicles
# Watch mode
npm run test:watch
Environment Variables
See .env.example for required variables. Key variables:
- Database connection (DB_*)
- Redis connection (REDIS_*)
- Auth0 configuration (AUTH0_*)
- External API keys