Skip to content

Latest commit

 

History

History
194 lines (136 loc) · 5.75 KB

README.md

File metadata and controls

194 lines (136 loc) · 5.75 KB

FamilyTogether

Local-first SaaS platform for family task management with points, rewards, and offline-first sync

Deploy to Railway .NET 6.0 License: MIT

🚀 Live Demo

📋 Overview

FamilyTogether is a local-first SaaS platform designed for families to manage tasks, track points, and redeem rewards. The platform works offline-first and syncs when online, ensuring your family data is always available.

Key Features

  • ✅ Offline-First: All functionality works without internet connection
  • 🔐 Secure Authentication: JWT-based auth via Supabase
  • 👨‍👩‍👧‍👦 Family Management: Create families, add members with roles
  • 📱 Cross-Platform: Web (SPA), Desktop (WPF), Mobile-ready API
  • 🔄 Automatic Sync: Background sync with conflict resolution
  • 🎯 Task Management: Assign tasks, earn points, redeem rewards

🏗️ Architecture

Components

  1. API (.NET 6.0) - ASP.NET Core Web API deployed on Railway
  2. SPA (Vanilla JavaScript) - Single-page app with IndexedDB for offline storage
  3. WPF (.NET 6.0) - Windows desktop application with SQLite

Tech Stack

  • Backend: ASP.NET Core 6.0, Entity Framework Core
  • Database: PostgreSQL (Supabase)
  • Authentication: Supabase Auth (JWT via JWKS)
  • Deployment: Railway.app (API), Netlify (SPA)
  • Storage: PostgreSQL (cloud), IndexedDB (web), SQLite (desktop)

🚦 Getting Started

Prerequisites

1. Clone Repository

git clone https://github.com/zanzikahn/FamilyTogether.git
cd FamilyTogether

2. Setup Supabase Database

  1. Create a Supabase project
  2. Run migrations from migrations/ folder:
    • 001_initial_schema.sql - Creates tables, indexes, triggers
    • 002_rls_policies.sql - Sets up Row Level Security

See SUPABASE_SETUP_GUIDE.md for detailed instructions.

3. Configure API

cd FamilyTogether.API

# Copy and configure settings
cp appsettings.json appsettings.Development.json

Edit appsettings.Development.json with your Supabase credentials:

{
  "ConnectionStrings": {
    "Supabase": "Host=db.YOUR_PROJECT_ID.supabase.co;Port=5432;Database=postgres;Username=postgres;Password=YOUR_PASSWORD;SSL Mode=Require;Trust Server Certificate=true"
  },
  "Supabase": {
    "Url": "https://YOUR_PROJECT_ID.supabase.co",
    "PublishableKey": "YOUR_PUBLISHABLE_KEY",
    "SecretKey": "YOUR_SECRET_KEY",
    "JwtKeyId": "YOUR_JWT_KEY_ID",
    "JwtDiscoveryUrl": "https://YOUR_PROJECT_ID.supabase.co/auth/v1/.well-known/jwks.json"
  }
}

4. Run API Locally

dotnet restore
dotnet build
dotnet run

# API available at:
# - https://localhost:7290
# - Swagger UI: https://localhost:7290/swagger

📡 API Endpoints

Authentication

  • POST /api/auth/register - Register new user and create family
  • POST /api/auth/login - Authenticate user
  • POST /api/auth/logout - Sign out user
  • GET /api/auth/profile - Get user profile

Family Management

  • GET /api/families - List all families for authenticated user
  • GET /api/families/{id} - Get single family details
  • POST /api/families - Create new family
  • POST /api/families/{familyId}/members - Add family member

See API_ENDPOINTS.md for detailed documentation.

🚀 Deployment

Deploy to Railway

This repository includes automatic deployment via GitHub Actions.

  1. Get Railway Token:

    railway login
    railway whoami --token
  2. Add GitHub Secret:

    • Go to repository Settings → Secrets → Actions
    • Add secret: RAILWAY_TOKEN = your token
  3. Deploy:

    • Push to main branch triggers automatic deployment
    • Or manually trigger via Actions tab

Manual Railway Deployment

cd FamilyTogether.API
railway login
railway link
railway up

📚 Documentation

🧪 Testing

# Run API tests
cd FamilyTogether.API.Tests
dotnet test

# Run with coverage
dotnet test --collect:"XPlat Code Coverage"

🔐 Security

  • All secrets stored in Railway environment variables
  • JWT authentication with automatic token refresh
  • Row Level Security (RLS) on all database tables
  • CORS configured for specific origins
  • Input validation on all endpoints

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🤝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

📧 Support

For support, email zanzikahn@hotmail.com or open an issue on GitHub.


Built with ❤️ using Claude Code