Start Here

Repository Map

What lives where across the Logga workspace.

This workspace is split into multiple top-level projects rather than one monorepo with a shared root package.

Top-Level Structure

Path Purpose
logga-backend Express + Prisma API service. Owns ingestion, auth, sessions, rules, reports, notifications, and database schema.
logga-frontend Next.js dashboard and public-facing web surface.
logga-app Native SwiftUI application.
logga-bruno Bruno requests for API testing and manual flows.
docs Shared documentation source, intended to describe the whole product.

Backend Responsibilities

The backend is responsible for:

  • user registration and login
  • workspace and environment resolution
  • API key authentication for event and session flows
  • event ingestion and querying
  • rule evaluation
  • notification persistence and delivery orchestration
  • scheduled report configuration and execution
  • database migrations and seeding

Primary locations:

  • route registration: logga-backend/src/index.ts
  • HTTP routes: logga-backend/src/routes
  • core services: logga-backend/src/services
  • background workers: logga-backend/src/workers
  • Prisma schema and migrations: logga-backend/prisma

Frontend Responsibilities

The frontend is responsible for:

  • auth and dashboard entry
  • workspace and project navigation
  • reporting, rules, and session views
  • design system and UI components
  • rendering this documentation as a browsable site

Primary locations:

  • app routes: logga-frontend/app
  • dashboard UI: logga-frontend/components/dashboard
  • reusable UI primitives: logga-frontend/components/ui
  • API client types and helpers: logga-frontend/lib/api.ts

Native App Responsibilities

The iOS app is responsible for:

  • native auth flow
  • workspace-aware shell
  • project, activity, settings, and reports screens
  • local alert handling and deep linking
  • device token registration for push delivery

Primary locations:

  • app bootstrap: logga-app/logga/logga/loggaApp.swift
  • auth and bootstrap flow: logga-app/logga/logga/ContentView.swift
  • core shell and tabs: logga-app/logga/logga/AppShellView.swift
  • report management UI: logga-app/logga/logga/ReportsView.swift

How To Reason About Changes

If a change affects data shape

Start in the backend first. The Prisma schema and route serializers define the contract the dashboard and app consume.

If a change affects only presentation

Stay in the relevant client surface:

  • dashboard changes in logga-frontend
  • native interaction changes in logga-app

If a change affects alerts, reports, or session lifecycle

Expect to touch multiple surfaces:

  • backend route or service logic
  • frontend and or iOS presentation
  • documentation in docs

Where To Put New Docs

Use docs for product- or system-level documentation that crosses boundaries.

Suggested subfolders:

  • docs/getting-started for setup and orientation
  • docs/architecture for system design
  • docs/backend for HTTP and persistence details
  • docs/clients for frontend and app behavior
  • docs/product for workflows and feature behavior
  • docs/examples for copy-paste examples
  • docs/contributing for maintenance rules