Skip to content

n4zen-dev-studio/Velo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

89 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Velo β€” Offline-First Project Management Engine

React Native Node.js Fastify Prisma PostgreSQL Offline First Status


πŸ“– Table of Contents


🧠 Executive Summary

Modern project management tools assume constant connectivity, which introduces latency, failure points, and degraded UX in real-world mobile environments.

Velo was engineered to solve this problem.

Core Problem

  • Network dependency β†’ degraded UX
  • High-latency operations (task updates, comments)
  • Poor offline support β†’ user frustration
  • Sync conflicts β†’ inconsistent state

Solution

Velo implements a local-first architecture where:

  • All operations execute instantly on-device
  • Changes are stored as operation logs (op-based sync)
  • Backend acts as a synchronization and reconciliation layer

Business Impact

  • ⚑ Zero-latency interactions (local writes)
  • πŸ“‘ Resilient offline usage
  • πŸ”„ Eventual consistency across devices
  • πŸ“ˆ Scales from personal use β†’ team collaboration

⬆ Back to Top


πŸ§ͺ Demo & Visuals

πŸ“± Dashboard UI

🎬 Demo Video

See Velo in action β€” a lightweight, offline-first project management system built for real-world team workflows.


⚑ Velo App Demo

Velo App Demo

End-to-end walkthrough of Velo’s core experience β€” from project creation to task execution and sync.

Highlights

  • Project + task management flow
  • Offline-first interactions
  • Sync + state reconciliation
  • Clean, responsive mobile UI

⬆️ Back to top


πŸ—οΈ System Architecture

System Architecture Diagram

High-Level Components

Mobile App (React Native)
   ↓
Local Database (Offline-first state)
   ↓
Sync Engine (Op-based queue)
   ↓
Backend API (Fastify)
   ↓
Database (PostgreSQL via Prisma)

Key Architectural Decisions

Decision Rationale
Offline-first Eliminates network dependency
Operation-based sync Enables conflict resolution
Fastify backend High-performance, low overhead
Prisma ORM Type-safe schema management
PostgreSQL Strong consistency + scalability

⬆ Back to Top


Architecture Diagrams

Local-first data flow

flowchart TD
  UI[UI] -->|mutate| Repo[Repositories]
  Repo -->|write| SQLite[(SQLite)]
  Repo -->|enqueue| ChangeLog[change_log]
  ChangeLog --> SyncEngine[SyncEngine]
  SyncEngine -->|push| Server[/Sync API/]
Loading

Sync push/pull cycle

sequenceDiagram
  participant Client
  participant Server
  Client->>Server: POST /sync (ops, cursor)
  Server->>Server: apply ops + dedupe + log server_changes
  Server-->>Client: ackOpIds + changes + newCursor
  Client->>Client: mark ops SENT
  Client->>Client: apply changes or create conflicts
Loading

Conflict resolution flow

flowchart TD
  Change[Incoming server change] --> Check{Local pending or newer?}
  Check -- No --> Apply[Apply to local DB]
  Check -- Yes --> Conflict[Create conflict row]
  Conflict --> Resolve[User resolves]
  Resolve --> Enqueue[Enqueue resolution op]
Loading

⬆ Back to Top


πŸ”„ Data Pipeline & Sync Model

Core Concept: Operation-Based Sync

Instead of syncing raw state, Velo syncs intent-based operations:

type SyncOperation = {
  id: string
  entity: "task" | "project" | "comment"
  type: "UPSERT" | "DELETE"
  payload: object
  timestamp: number
}

Flow

  1. User action β†’ stored locally

  2. Operation added to sync queue

  3. Sync triggered manually or via settings

  4. Backend processes operations:

    • Deduplicates (opId)
    • Applies mutations
    • Generates server changes
  5. Client pulls updates via cursor

Example Sync Request

{
  "ops": [
    {
      "id": "op_123",
      "entity": "task",
      "type": "UPSERT",
      "payload": {
        "id": "task_1",
        "title": "Fix login bug"
      }
    }
  ],
  "cursor": "abc123"
}

Example Server Response

{
  "ack": ["op_123"],
  "changes": [
    {
      "entity": "task",
      "type": "UPSERT",
      "payload": {
        "id": "task_2",
        "title": "New task from another device"
      }
    }
  ],
  "nextCursor": "abc124"
}

⬆ Back to Top


πŸ”¬ Technical Deep Dive

πŸ“± Mobile (React Native)

  • React Native 0.76+

  • State management: MobX (multi-store architecture)

  • Offline storage:

    • MMKV / AsyncStorage
  • Navigation: React Navigation

  • UI: Custom glassmorphism system

βš™οΈ Backend

// Core stack
import Fastify from "fastify"
import { PrismaClient } from "@prisma/client"
  • Framework: Fastify (low overhead, high throughput)
  • ORM: Prisma (type-safe DB access)
  • Database: PostgreSQL 15
  • Deployment: Docker + Caddy reverse proxy

🧩 Data Modeling

Entities:

  • Users
  • Workspaces
  • Projects
  • Tasks
  • Comments
  • Workspace Members

Relational structure managed via Prisma schema.

πŸ” Sync Engine Internals

  • Operation queue (client-side)
  • Deduplication via opId
  • Server change log (serverChange)
  • Cursor-based incremental sync

🧠 Conflict Resolution Strategy

  • Last-write-wins (timestamp-based)
  • Operation idempotency
  • Server reconciliation layer

πŸ“ˆ Improving Data Integrity

  • Strict schema validation
  • Optimistic updates with rollback support
  • Sync retries with exponential backoff

⬆ Back to Top


πŸ“Š Performance & Metrics

Key Metrics

Metric Value
Local write latency ~0ms (instant)
Sync latency <300ms typical
Conflict rate Low (op-based model)
App startup ~1–2s

Testing Strategy

  • Unit tests for sync logic
  • Integration tests for API routes
  • Manual multi-device sync validation

Example Workflow Benchmark

Action Traditional App Velo
Create task Network call Instant
Edit task Network call Instant
Offline usage Limited Full

⬆ Back to Top


πŸ§‘β€πŸ’» Developer Experience & Setup

πŸ“¦ Installation

git clone https://github.com/yourusername/velo
cd velo
pnpm install

πŸ–₯️ Backend Setup

cd backend
cp .env.example .env
pnpm prisma generate
pnpm prisma migrate dev
pnpm dev

πŸ“± Mobile Setup

cd mobile
pnpm start

🐳 Docker (Production)

docker compose -f docker-compose.velo.yml up -d

Environment Configuration

DATABASE_URL=postgresql://user:password@host:5432/db
JWT_SECRET=your_secret

⬆ Back to Top


πŸ“² Latest Release

πŸ“² Download APK from the latest Release


πŸš€ Why Velo is Different

1. True Offline-First (Not β€œOffline Support”)

Most apps degrade offline.

Velo operates fully offline by design.

2. Operation-Based Sync (Not State Sync)

  • More scalable
  • Conflict-tolerant
  • Efficient over low bandwidth

3. Instant UX

  • No loading states for core actions
  • No blocking network calls

4. Production-Grade Architecture

  • Typed backend (Prisma)
  • Structured sync pipeline
  • Containerized deployment

5. Designed for Real-World Constraints

  • Poor connectivity environments
  • Mobile-first workflows
  • Distributed teams

⬆ Back to Top


πŸ”š Conclusion

Velo demonstrates a production-grade approach to offline-first application design, combining:

  • Local-first data modeling
  • Robust sync architecture
  • High-performance backend systems

It showcases the ability to design systems that are resilient, scalable, and user-centric under real-world constraints.

⬆ Back to Top


πŸ“„ License

MIT License β€” feel free to use and adapt.

⬆ Back to Top

About

Full-stack offline-first project management engine with operation-based synchronization, Fastify backend, and PostgreSQL persistence.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors