1.0.5 • Published 2 months ago

@sunny-pirate/backend-dreamlab-datacenter v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
2 months ago

DreamLab Datacenter

License: MIT

A centralized Supabase-based backend infrastructure for DreamLab services, including the SimGarage racing platform.

Overview

DreamLab Datacenter is the core backend infrastructure that powers multiple DreamLab services:

  • SimGarage Platform: A comprehensive sim racing community platform
  • DreamLab Website: Corporate website and CMS with multilingual support
  • Contact Management: Form submission processing with workflow system

This repository contains database schema definitions, migrations, edge functions, and TypeScript type definitions for the entire ecosystem.

Architecture

Database Structure

The project uses a multi-schema approach in PostgreSQL:

  • public: Shared tables and utilities
  • simgarage: Racing platform-specific schemas
  • auth: Supabase authentication tables
  • storage: File storage management

Key features:

  • Row-Level Security (RLS) policies for fine-grained access control
  • Custom roles system for SimGarage users
  • Storage buckets for various asset types
  • Edge functions for serverless operations

SimGarage Platform

The SimGarage platform ("Motorhome - The SimGarage") is a modular, multi-tenant web application for the sim racing community with features for:

  • User and team management
  • Championship organization
  • Racing session tracking
  • Car setup and telemetry storage
  • Custom liveries and driver customization
  • Subscription management with Stripe integration

Storage System

The project leverages Supabase Storage with multiple buckets:

  • acc-car-setups: Car setup files with restricted access
  • acc-motec-telemetry: Telemetry data files
  • acc-custom-cars: Custom car configuration files
  • acc-driver-customization: Driver appearance customizations
  • acc-liveries: Livery textures and assets (public readable)

Getting Started

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/dreamlab/backend-dreamlab-datacenter.git
    cd backend-dreamlab-datacenter
  2. Install dependencies:

    pnpm install
  3. Start the local Supabase instance:

    supabase start
  4. Apply migrations:

    supabase migration up
  5. Load seed data:

    supabase db reset
  6. Generate TypeScript types:

    ./bin/generate-types.sh

Development Commands

# Generate TypeScript types from Supabase schema
pnpm run generate:ts

# Build the TypeScript project
pnpm run build

# Generate types with custom schema selection
./bin/generate-types.sh --schema "public,simgarage,auth,storage"

# Connect to local Supabase instance
supabase start

# Apply migrations
supabase migration up

# Create a new migration
supabase migration new migration_name

Documentation

Comprehensive documentation is maintained using Antora and can be found in the docs/ directory:

  • Documentation is written in AsciiDoc format
  • UML diagrams visualize system components and workflows
  • The docs/modules/simgarage/ directory contains SimGarage-specific documentation

To build the documentation:

npx antora antora-playbook.yml

This will generate static documentation in the public/ directory.

SimGarage Modules

  • User Management: Profiles, authentication, and roles
  • Team Organization: Teams, communities, and memberships
  • Racing Structure: Championships, races, and sessions
  • Racing Resources: Games, cars, and tracks
  • Technical Resources: Setups, strategies, and telemetry
  • Customization: Liveries, mods, and driver customizations
  • Subscription Management: Plans, billing, and access

Working with Edge Functions

Edge Functions provide serverless capabilities:

  1. Navigate to function directory in supabase/functions/
  2. Use Deno for local development
  3. Deploy using Supabase CLI

Contributing

  1. Create a new branch for your feature
  2. Follow the established code style and patterns
  3. Add appropriate database migrations
  4. Document your changes
  5. Create a pull request for review

License

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

Contact

For questions or support, contact the DreamLab development team.

1.0.5

2 months ago

1.0.3-alpha.0

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago