Comprehensive documentation for the Cobalt Stack Rust backend services.
The Cobalt Stack backend is built with:
- Rust - Core programming language
- Actix-web - Web framework
- PostgreSQL - Database
- Docker - Containerization
backend/
├── src/
│ ├── api/ # API endpoints
│ ├── models/ # Data models
│ ├── services/ # Business logic
│ ├── db/ # Database layer
│ └── main.rs # Application entry point
├── tests/ # Integration tests
└── Cargo.toml # Dependencies
- Repository Pattern: Data access abstraction
- Service Layer: Business logic separation
- Dependency Injection: Loose coupling
- Error Handling: Result types and custom errors
- Rust 1.70+
- PostgreSQL 14+
- Docker (optional)
# Install dependencies
cargo build
# Run migrations
cargo run --bin migrate
# Start development server
cargo run
# Run tests
cargo test- Authentication Service - User authentication and authorization
- User Service - User management
- Data Service - Core data operations
For detailed API documentation, see API Reference.
# Create new migration
cargo run --bin create-migration <name>
# Run migrations
cargo run --bin migrate
# Rollback migration
cargo run --bin rollbackDatabase schema documentation is available in the API Reference.
# Run all tests
cargo test
# Run specific test
cargo test test_name
# Run with output
cargo test -- --nocapture
# Run integration tests
cargo test --test '*'# Install tarpaulin
cargo install cargo-tarpaulin
# Generate coverage report
cargo tarpaulin --out HtmlGenerate and view comprehensive Rust documentation:
# Generate documentation
cargo doc --no-deps --open
# Generate with private items
cargo doc --no-deps --document-private-items --openSee Rust Documentation Guide for more details.
- Document all public APIs
- Include examples in doc comments
- Document error conditions
- Explain non-obvious implementation details