FitSync is a strength training platform built around synchronization, workout tracking and social interactions. This repository contains the complete production backend used by the mobile client.
Note: The native Android application (Kotlin + Jetpack Compose + Room DB) remains private for commercial monetization purposes.
Users train in gyms with poor or no connectivity, yet still expect instant writes, local persistence and seamless access to their data across devices.
FitSync solves this with an offline-first synchronization engine that reconciles local and remote datasets through timestamp-based delta replication, giving eventual consistency without ever replacing the full dataset.
Android (Room Database)
⇅
Offline Storage Layer
⇅
Synchronization Engine
⇅
ASP.NET Core Backend
⇅
PostgreSQL
sequenceDiagram
participant App as Android client (Room)
participant API as ASP.NET Core API
participant DB as PostgreSQL
Note over App: User trains offline, writes saved locally
App->>API: Push local changes (authenticated, rate limited)
API->>DB: Apply changes per entity
App->>API: Pull with LastSync timestamp
API->>DB: Query entities modified after LastSync
DB-->>API: Delta (changed and soft-deleted entities)
API-->>App: Delta + new sync timestamp
Note over App: Local database updated, LastSync advanced
- Push: the client uploads entities modified while offline.
- Pull: the client sends its
LastSynctimestamp and receives only entities changed since then. - Deletes: records are soft-deleted, so removals propagate to other devices as part of the same delta.
- Auth: the JWT is refreshed during synchronization, so a long offline session does not break the next sync.
- Generic synchronization handlers using delegates (
Func<T, Task<bool>>), so new entities plug into the pipeline without duplicating sync logic - Delta replication driven by
LastSyncinstead of full dataset transfer - JWT refresh during synchronization
- Login lockout mechanism against brute-force attacks
- Rate-limited sync endpoints
- Explicit middleware execution order
- Soft delete persistence model
- Social graph synchronization logic
Currently in progress:
- Push pipeline optimization through batched synchronization processing
- Synchronization performance improvements for large payloads
- User relation retrieval optimization
- Delta propagation refinements for social entities
The pull path already uses delta replication. The push path is being optimized to reduce sequential processing overhead across multiple entities.
Prerequisites: .NET 8 SDK and a running PostgreSQL instance.
git clone https://github.com/budzowskipiotrek/<repository-name>.git
cd <repository-name>
# Configure the connection string and JWT settings in appsettings.json
# (or via environment variables / user secrets)
dotnet restore
dotnet ef database update
dotnet runPiotrek Budzowski, Backend / Android Developer
- Email: piobudzows@gmail.com
- LinkedIn: linkedin.com/in/piobudzows
- GitHub: github.com/budzowskipiotrek
