3.3 KiB
3.3 KiB
Mnemo Cards Backend - Project Configuration
Project Overview
- Name: mnemo_cards_backend
- Type: Flutter/Dart backend server using Shelf framework
- Purpose: Backend API server for Mnemo Cards application
- Architecture: Clean architecture with dependency injection
Tech Stack
- Language: Dart 3.0+
- Framework: Shelf (HTTP server)
- Database: Isar (local database)
- Dependency Injection: GetIt + Injectable
- Code Generation: Build Runner
- Testing: Dart Test + Mockito
- Authentication: JWT tokens, Google APIs
- Payment: YooKassa integration
Project Structure
lib/- Main source codetest/- Unit testscerts/- SSL certificates for HTTPSbackup/- Database backupspython_folder/- Python utilitiestarget_folder/- Build artifacts
Key Dependencies
mnemo_cards_common- Shared common codemnemo_cards_common_backend- Backend-specific common codeisar- Databaseshelf_*- HTTP server componentsget_it+injectable- Dependency injectiongoogleapis- Google services integrationyookassa_client- Payment processing
Commands
# Development
./run_dev.sh # Start development server
./restart_dev.sh # Restart development server
# Production
./run_http_production.sh # HTTP production server
./run_https_production.sh # HTTPS production server
# Code Generation
./codegen.sh # Run build_runner
flutter pub run build_runner build --delete-conflicting-outputs
# Testing
flutter test # Run all tests
flutter test test/ # Run specific test directory
# Database
# Backup files are in backup/ directory
# Database files are in isar/ directory
# SSL Certificates
./certs/generate_server.sh # Generate server certificates
./certs/generate_domain_cert.sh # Generate domain certificates
Environment Variables
- SSL certificates in
certs/directory - Database files in
isar/directory - Backup files in
backup/directory
Architecture Guidelines
- Use
yx_stateandyx_scopefor state management - Follow clean architecture principles
- Reference
../mnemo_cardsapp for design/features (don't copy architecture) - Use dependency injection with GetIt/Injectable
- Implement proper error handling and validation
Testing Requirements
- Write unit tests for all functionalities
- Use Mockito for mocking dependencies
- Test coverage for business logic
- Integration tests for API endpoints
Acceptance Criteria
- Builds successfully (
flutter build) - All linters pass (
dart analyze) - All existing tests pass (
flutter test) - New tests cover new functionality
- Code generation runs without errors (
./codegen.sh) - Server starts and responds to requests
- SSL certificates are valid
- Database operations work correctly
File Maintenance
- Update
PROGESS.mdafter completing major steps - Update
TODO.mdwith current tasks and priorities - Maintain
workflow_state.mdfor autonomous operation state - Keep backup files organized in
backup/directory
Safety Constraints
- Never run destructive commands without explicit approval
- Always backup database before migrations
- Use HTTPS in production environments
- Validate all user inputs
- Implement proper error handling for external API calls