Skip to main content

Monorepo Overview

The JOIP Web Application follows a monorepo architecture with three main directories:
This is a single-package monorepo - all code shares the same node_modules and package.json. There are no separate packages or workspaces.

Client Directory Structure

The client/ directory contains the React frontend application built with Vite:

Key Client Files

App.tsx - Application Routes

Defines all application routes using Wouter:

lib/AuthContext.tsx - Authentication State

Manages user authentication state across the application:

Feature Module Pattern

Some features like Gaslighter and Scroller are organized as self-contained modules:
Feature modules contain all components and logic specific to that feature, but still use shared UI components from components/ui/ and utilities from lib/.

Server Directory Structure

The server/ directory contains the Express.js backend API:

Key Server Files

index.ts - Server Entry Point

Initializes Express, middleware, and routes:

routes.ts - API Route Definitions

Defines all REST API endpoints:

storage.ts - Database Abstraction Layer

Implements the IStorage interface for all database operations:

Shared Directory Structure

The shared/ directory contains code used by both client and server:

schema.ts - Central Schema Definition

Defines database schema using Drizzle ORM and Zod validation schemas:
Single Source of Truth: The shared/schema.ts file is the single source of truth for database schema, validation rules, and TypeScript types. Both client and server import from this file.

Import Aliases

The project uses TypeScript path aliases for cleaner imports:
tsconfig.json

Usage Examples

Data Flow Architecture

Request Flow

Type Safety Flow

Build Configuration

Vite Configuration (vite.config.ts)

Build Scripts (package.json)

Styling Architecture

Tailwind + Radix UI

The application uses Tailwind CSS for utility-first styling and Radix UI for accessible component primitives:

Next Steps

Now that you understand the project structure: