biotrackr is a personal health platform that integrates with the Fitbit API to collect, analyze, and provide insights on health and fitness data. The application follows a microservices architecture deployed on Azure, with comprehensive CI/CD pipelines and infrastructure as code.
The application follows a microservices architecture with separate services for different health domains:
- Activity Service: Processes and stores physical activity data from Fitbit
- Sleep Service: Manages sleep tracking and analysis
- Weight Service: Handles weight measurements and trends
- Food Service: Tracks nutrition and food logging data from Fitbit
- Auth Service: Manages authentication and authorization with Fitbit API
Each service consists of:
- API Layer: RESTful endpoints for data access
- Service Layer: Business logic and integration with Fitbit API
- Data Layer: Azure Cosmos DB for persistence
- π Activity Tracking: Comprehensive workout and activity data collection
- π΄ Sleep Analysis: Sleep patterns, stages, and quality metrics
- βοΈ Weight Management: Weight tracking and trend visualization
- π Food Logging: Nutrition tracking and food diary management
- π Secure Authentication: OAuth integration with Fitbit
- π Data Insights: Analysis and reporting on health metrics
- βοΈ Cloud-Native: Fully deployed on Azure with auto-scaling
- π CI/CD: Automated testing, deployment, and infrastructure management
- .NET 9.0: Modern C# microservices
- Azure Functions: Serverless compute for background processing
- Azure Cosmos DB: NoSQL database for scalable data storage
- Azure App Configuration: Centralized configuration management
- Azure Key Vault: Secure secrets management
- Bicep: Infrastructure as Code (IaC) for Azure resources
- GitHub Actions: CI/CD pipelines and workflow automation
- Docker: Containerization for consistent environments
- Azure API Management: API gateway with JWT validation for secure managed identity authentication
- xUnit: Unit and integration testing framework
- FluentAssertions: Readable test assertions
- Moq: Mocking framework for unit tests
- Cosmos DB Emulator: Local database testing
- .NET 9.0 SDK
- Docker Desktop
- Azure CLI (for deployment)
- PowerShell (Windows users)
-
Clone the repository
git clone https://github.com/willvelida/biotrackr.git cd biotrackr -
Start Cosmos DB Emulator
Windows (PowerShell):
.\cosmos-emulator.ps1 startmacOS/Linux:
docker-compose -f docker-compose.cosmos.yml up -d
-
Install SSL Certificate (Required for local testing)
Follow the Cosmos DB Emulator Setup Guide for platform-specific instructions.
-
Build a service
cd src/Biotrackr.Activity.Api dotnet build -
Run tests
# Unit tests only dotnet test --filter "FullyQualifiedName~UnitTests" # All tests (requires Cosmos DB Emulator) dotnet test
For more detailed setup instructions, see the Cosmos DB Emulator Setup Guide.
- GitHub Actions Workflow Templates - Reusable CI/CD workflow patterns
- Bicep Modules Structure - Infrastructure as Code organization
- Decision Records - Architectural Decision Records (ADRs)
- Cosmos DB Emulator Setup - Local database configuration
- Contract Test Architecture - Testing strategy
- Service Lifetime Registration - Dependency injection patterns
- Backend API Route Structure
- .NET Configuration Format
- Integration Test Project Structure
- Flaky Test Handling
- APIM Managed Identity Authentication
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Author: willvelida
For questions or feedback, please open an issue on this repository.