S
Solo Kit
DocumentationComponentsPricingChangelogRoadmapFAQContact
LoginGet Started
DocumentationComponentsPricing
LoginGet Started
Welcome to Solo Kit DocumentationIntroductionTech StackRoadmapFAQGetting Started
Getting Started

Project Structure

Project Structure

Solo Kit uses a modern monorepo architecture with clear separation of concerns, shared packages, and platform-specific applications. This guide explains how everything is organized and why.

πŸ—οΈ High-Level Overview

solo-kit/
β”œβ”€β”€ πŸ“± apps/              # Platform-specific applications
β”‚   β”œβ”€β”€ web/             # Next.js web application
β”‚   └── mobile/          # Expo mobile application
β”œβ”€β”€ πŸ“¦ packages/         # Shared packages and libraries
β”‚   β”œβ”€β”€ ui/              # Shared UI components
β”‚   β”œβ”€β”€ utils/           # Platform-agnostic utilities
β”‚   β”œβ”€β”€ database/        # Database schema and operations
β”‚   └── eslint-config/   # Shared ESLint configuration
β”œβ”€β”€ πŸ› οΈ config/           # Project-wide configuration
β”œβ”€β”€ πŸ“š docs/             # Documentation files
β”œβ”€β”€ πŸ”§ scripts/          # Utility scripts
└── πŸ“‹ Configuration files

πŸ“± Applications (/apps)

Web Application (/apps/web)

The Next.js web application following modern App Router patterns.

apps/web/
β”œβ”€β”€ 🎨 app/                    # Next.js App Router
β”‚   β”œβ”€β”€ (auth)/               # Route groups for auth pages
β”‚   β”‚   β”œβ”€β”€ login/            # Login page
β”‚   β”‚   └── signup/           # Sign-up page
β”‚   β”œβ”€β”€ (dashboard)/          # Protected dashboard routes
β”‚   β”‚   β”œβ”€β”€ dashboard/        # User dashboard
β”‚   β”‚   β”œβ”€β”€ settings/         # User settings
β”‚   β”‚   └── admin/            # Admin pages (role-protected)
β”‚   β”œβ”€β”€ api/                  # API routes
β”‚   β”‚   β”œβ”€β”€ auth/             # Authentication endpoints
β”‚   β”‚   β”œβ”€β”€ users/            # User management API
β”‚   β”‚   └── webhooks/         # Payment and external webhooks
β”‚   β”œβ”€β”€ documentation/        # Documentation pages (Fumadocs)
β”‚   β”œβ”€β”€ globals.css           # Global styles
β”‚   β”œβ”€β”€ layout.tsx            # Root layout
β”‚   β”œβ”€β”€ loading.tsx           # Global loading UI
β”‚   β”œβ”€β”€ not-found.tsx         # 404 page
β”‚   └── page.tsx              # Home page
β”œβ”€β”€ 🧩 components/            # React components
β”‚   β”œβ”€β”€ ui/                   # shadcn/ui components (auto-generated)
β”‚   β”œβ”€β”€ auth/                 # Authentication components
β”‚   β”œβ”€β”€ layout/               # Layout components (header, footer, etc.)
β”‚   β”œβ”€β”€ forms/                # Form components
β”‚   β”œβ”€β”€ features/             # Feature-specific components
β”‚   β”‚   β”œβ”€β”€ dashboard/        # Dashboard-specific components
β”‚   β”‚   β”œβ”€β”€ landing/          # Landing page components
β”‚   β”‚   └── admin/            # Admin panel components
β”‚   └── common/               # Reusable common components
β”œβ”€β”€ πŸ“– content/               # Content files
β”‚   └── docs/                 # Documentation content (MDX)
β”œβ”€β”€ 🎣 hooks/                 # Custom React hooks
β”‚   β”œβ”€β”€ use-auth.ts           # Authentication hooks
β”‚   β”œβ”€β”€ use-theme.ts          # Theme management
β”‚   └── use-local-storage.ts  # Local storage utilities
β”œβ”€β”€ πŸ“š lib/                   # Utilities and configurations
β”‚   β”œβ”€β”€ auth.ts               # Authentication configuration
β”‚   β”œβ”€β”€ db.ts                 # Database client
β”‚   β”œβ”€β”€ email.ts              # Email service
β”‚   β”œβ”€β”€ payments.ts           # Payment processing
β”‚   β”œβ”€β”€ utils.ts              # General utilities
β”‚   β”œβ”€β”€ validations.ts        # Zod schemas for validation
β”‚   └── constants.ts          # Application constants
β”œβ”€β”€ 🎨 styles/                # CSS and styling files
β”‚   └── globals.css           # Global styles with Tailwind
β”œβ”€β”€ 🌍 messages/              # Internationalization messages
β”‚   β”œβ”€β”€ en.json               # English translations
β”‚   └── es.json               # Spanish translations
β”œβ”€β”€ πŸ”§ Configuration files
β”‚   β”œβ”€β”€ next.config.js        # Next.js configuration
β”‚   β”œβ”€β”€ tailwind.config.ts    # Tailwind CSS configuration
β”‚   β”œβ”€β”€ tsconfig.json         # TypeScript configuration
β”‚   └── package.json          # Dependencies and scripts
└── πŸ“‹ Other files
    β”œβ”€β”€ .env                  # Environment defaults
    β”œβ”€β”€ .env.example          # Environment documentation
    β”œβ”€β”€ middleware.ts         # Next.js middleware
    └── instrumentation.ts    # Telemetry and monitoring

Mobile Application (/apps/mobile)

The Expo React Native application with shared code architecture.

apps/mobile/
β”œβ”€β”€ πŸ“± app/                   # Expo Router structure
β”‚   β”œβ”€β”€ (auth)/              # Authentication screens
β”‚   β”‚   β”œβ”€β”€ login.tsx        # Login screen
β”‚   β”‚   └── signup.tsx       # Sign-up screen
β”‚   β”œβ”€β”€ (tabs)/              # Tab navigation
β”‚   β”‚   β”œβ”€β”€ dashboard.tsx    # Dashboard screen
β”‚   β”‚   β”œβ”€β”€ profile.tsx      # Profile screen
β”‚   β”‚   └── settings.tsx     # Settings screen
β”‚   β”œβ”€β”€ _layout.tsx          # Root layout
β”‚   β”œβ”€β”€ +not-found.tsx       # 404 screen
β”‚   └── index.tsx            # Landing screen
β”œβ”€β”€ 🧩 components/           # Mobile-specific components
β”‚   β”œβ”€β”€ ui/                  # Mobile UI components
β”‚   β”œβ”€β”€ navigation/          # Navigation components
β”‚   β”œβ”€β”€ forms/               # Form components
β”‚   └── common/              # Shared components
β”œβ”€β”€ 🎣 hooks/                # Mobile-specific hooks
β”‚   β”œβ”€β”€ useAuth.ts           # Authentication hooks
β”‚   └── useTheme.ts          # Theme management
β”œβ”€β”€ πŸ“š lib/                  # Mobile utilities
β”‚   β”œβ”€β”€ auth.ts              # Authentication client
β”‚   β”œβ”€β”€ storage.ts           # Secure storage
β”‚   └── constants.ts         # Mobile constants
β”œβ”€β”€ 🎨 styles/               # Styling
β”‚   └── global.ts            # Global styles
β”œβ”€β”€ πŸ”§ Configuration files
β”‚   β”œβ”€β”€ app.config.js        # Expo configuration
β”‚   β”œβ”€β”€ metro.config.js      # Metro bundler config
β”‚   β”œβ”€β”€ tsconfig.json        # TypeScript configuration
β”‚   └── package.json         # Dependencies and scripts
└── πŸ“‹ Assets
    β”œβ”€β”€ images/              # Image assets
    └── fonts/               # Custom fonts

πŸ“¦ Shared Packages (/packages)

UI Components (/packages/ui)

Shared UI components that work across web and mobile platforms.

packages/ui/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/          # React components
β”‚   β”‚   β”œβ”€β”€ button.tsx       # Button component
β”‚   β”‚   β”œβ”€β”€ card.tsx         # Card component
β”‚   β”‚   β”œβ”€β”€ input.tsx        # Input component
β”‚   β”‚   β”œβ”€β”€ modal.tsx        # Modal component
β”‚   β”‚   └── ...              # More shadcn/ui components
β”‚   β”œβ”€β”€ hooks/               # Shared hooks
β”‚   β”‚   β”œβ”€β”€ use-toast.tsx    # Toast notifications
β”‚   β”‚   └── use-media.tsx    # Media queries
β”‚   β”œβ”€β”€ utils/               # UI utilities
β”‚   β”‚   └── cn.ts            # Class name utility
β”‚   β”œβ”€β”€ index.ts             # Main exports
β”‚   └── server.ts            # Server-only exports
β”œβ”€β”€ πŸ”§ Configuration
β”‚   β”œβ”€β”€ package.json         # Package configuration
β”‚   β”œβ”€β”€ tsconfig.json        # TypeScript config
β”‚   β”œβ”€β”€ tailwind.config.ts   # Tailwind config
β”‚   └── tsup.config.ts       # Build configuration
└── πŸ“‹ Other files
    └── components.json      # shadcn/ui configuration

Utilities (/packages/utils)

Platform-agnostic utility functions and helpers.

packages/utils/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ date.ts          # Date formatting utilities
β”‚   β”‚   β”œβ”€β”€ string.ts        # String manipulation
β”‚   β”‚   β”œβ”€β”€ number.ts        # Number formatting
β”‚   β”‚   β”œβ”€β”€ validation.ts    # Common validations
β”‚   β”‚   β”œβ”€β”€ crypto.ts        # Cryptographic utilities
β”‚   β”‚   └── format.ts        # General formatting
β”‚   β”œβ”€β”€ constants/
β”‚   β”‚   β”œβ”€β”€ app.ts           # Application constants
β”‚   β”‚   β”œβ”€β”€ api.ts           # API constants
β”‚   β”‚   └── validation.ts    # Validation constants
β”‚   β”œβ”€β”€ types/
β”‚   β”‚   β”œβ”€β”€ auth.ts          # Authentication types
β”‚   β”‚   β”œβ”€β”€ user.ts          # User types
β”‚   β”‚   └── common.ts        # Common types
β”‚   └── index.ts             # Main exports
β”œβ”€β”€ πŸ”§ Configuration
β”‚   β”œβ”€β”€ package.json         # Package dependencies
β”‚   β”œβ”€β”€ tsconfig.json        # TypeScript configuration
β”‚   └── tsup.config.ts       # Build configuration
└── πŸ“‹ Tests
    └── __tests__/           # Unit tests
        β”œβ”€β”€ date.test.ts     # Date utility tests
        └── string.test.ts   # String utility tests

Database (/packages/database)

Database schema, migrations, and query utilities using Drizzle ORM.

packages/database/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ schema/              # Database schema definitions
β”‚   β”‚   β”œβ”€β”€ users.ts         # User-related tables
β”‚   β”‚   β”œβ”€β”€ auth.ts          # Authentication tables
β”‚   β”‚   β”œβ”€β”€ subscriptions.ts # Payment/subscription tables
β”‚   β”‚   β”œβ”€β”€ audit.ts         # Audit logging tables
β”‚   β”‚   └── index.ts         # Schema exports
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ db.ts            # Database client
β”‚   β”‚   β”œβ”€β”€ migrate.ts       # Migration utilities
β”‚   β”‚   └── seed.ts          # Seed data functions
β”‚   β”œβ”€β”€ queries/             # Common database queries
β”‚   β”‚   β”œβ”€β”€ users.ts         # User queries
β”‚   β”‚   β”œβ”€β”€ auth.ts          # Auth queries
β”‚   β”‚   └── subscriptions.ts # Subscription queries
β”‚   └── index.ts             # Main exports
β”œβ”€β”€ πŸ“ migrations/           # Database migrations
β”‚   β”œβ”€β”€ 0001_initial.sql     # Initial schema
β”‚   β”œβ”€β”€ 0002_add_subscriptions.sql
β”‚   └── meta/                # Migration metadata
β”œβ”€β”€ 🌱 seed/                 # Seed data
β”‚   β”œβ”€β”€ users.ts             # User seed data
β”‚   └── subscriptions.ts     # Subscription seed data
β”œβ”€β”€ πŸ”§ Configuration
β”‚   β”œβ”€β”€ package.json         # Dependencies
β”‚   β”œβ”€β”€ drizzle.config.ts    # Drizzle configuration
β”‚   β”œβ”€β”€ tsconfig.json        # TypeScript config
β”‚   └── tsup.config.ts       # Build config
└── πŸ“‹ Scripts
    └── migrate.ts           # Migration script

ESLint Configuration (/packages/eslint-config)

Shared ESLint configuration for consistent code quality.

packages/eslint-config/
β”œβ”€β”€ base.js                  # Base ESLint rules
β”œβ”€β”€ react.js                 # React-specific rules
β”œβ”€β”€ next.js                  # Next.js-specific rules
β”œβ”€β”€ react-native.js          # React Native rules
β”œβ”€β”€ package.json             # Package configuration
└── README.md               # Configuration documentation

πŸ› οΈ Configuration Files

Root Configuration

solo-kit/
β”œβ”€β”€ πŸ“‹ Package Management
β”‚   β”œβ”€β”€ package.json         # Root package configuration
β”‚   β”œβ”€β”€ pnpm-workspace.yaml  # Workspace configuration
β”‚   └── pnpm-lock.yaml       # Lock file
β”œβ”€β”€ πŸ”§ Build System
β”‚   β”œβ”€β”€ turbo.json           # Turborepo configuration
β”‚   └── .npmrc               # NPM configuration
β”œβ”€β”€ 🌍 Environment
β”‚   β”œβ”€β”€ .env                 # Safe defaults (committed)
β”‚   β”œβ”€β”€ .env.example         # Documentation
β”‚   └── .env.local           # Sensitive values (ignored)
β”œβ”€β”€ 🎯 TypeScript
β”‚   └── tsconfig.json        # Root TypeScript config
β”œβ”€β”€ 🎨 Code Quality
β”‚   β”œβ”€β”€ .eslintrc.js         # ESLint configuration
β”‚   β”œβ”€β”€ .prettierrc          # Prettier configuration
β”‚   └── .editorconfig        # Editor configuration
β”œβ”€β”€ πŸ™ Version Control
β”‚   β”œβ”€β”€ .gitignore           # Git ignore rules
β”‚   └── .gitattributes       # Git attributes
└── πŸš€ CI/CD
    └── .github/
        └── workflows/       # GitHub Actions

πŸ—‚οΈ File Organization Principles

1. Colocation

Related files are kept close together:

components/
β”œβ”€β”€ auth/
β”‚   β”œβ”€β”€ login-form.tsx       # Component
β”‚   β”œβ”€β”€ login-form.test.tsx  # Test
β”‚   └── login-form.stories.tsx # Storybook story

2. Feature-based Structure

Group by features, not by file types:

features/
β”œβ”€β”€ dashboard/
β”‚   β”œβ”€β”€ components/          # Dashboard components
β”‚   β”œβ”€β”€ hooks/               # Dashboard hooks
β”‚   β”œβ”€β”€ lib/                 # Dashboard utilities
β”‚   └── types/               # Dashboard types

3. Clear Naming Conventions

  • Routes: kebab-case (user-profile, api/auth-callback)
  • Components: PascalCase (UserProfile.tsx, AuthButton.tsx)
  • Utilities: camelCase (formatDate.ts, validateEmail.ts)
  • Constants: SCREAMING_SNAKE_CASE (API_ENDPOINTS, DEFAULT_TIMEOUT)
  • Types: PascalCase with descriptive names (User, AuthSession)

4. Import/Export Patterns

Barrel Exports: Use index files for clean imports:

// packages/ui/src/index.ts
export { Button } from './components/button';
export { Card } from './components/card';
export { Input } from './components/input';

// Usage
import { Button, Card, Input } from '@packages/ui';

Absolute Imports: Use path mapping for clean imports:

// Instead of: import { db } from '../../../lib/db'
import { db } from '@/lib/db';

πŸ”„ Data Flow Architecture

Frontend to Backend

πŸ–₯️  Component
    ↓ (uses)
🎣  Hook (React Query/SWR)
    ↓ (calls)
🌐  API Route/Server Action
    ↓ (uses)
πŸ—„οΈ  Database Query (Drizzle ORM)
    ↓ (accesses)
🐘  PostgreSQL Database

Shared Code Flow

πŸ“¦  packages/utils          πŸ“¦  packages/ui
    ↓ (imported by)            ↓ (imported by)
πŸ“±  apps/mobile         πŸ“±  apps/web
    ↓ (shares)              ↓ (shares)
πŸ”„  Common Business Logic & UI Components

🎯 Best Practices

1. Dependency Direction

  • Apps can import from packages
  • Packages cannot import from apps
  • Packages can import from other packages (with care)

2. Component Organization

// βœ… Good: Clear feature grouping
components/
β”œβ”€β”€ features/
β”‚   β”œβ”€β”€ auth/
β”‚   └── dashboard/
└── common/
    β”œβ”€β”€ ui/
    └── layout/

// ❌ Avoid: Generic grouping
components/
β”œβ”€β”€ buttons/
β”œβ”€β”€ forms/
└── modals/

3. File Naming

βœ… Good names:
- user-profile.tsx (kebab-case routes)
- UserProfile.tsx (PascalCase components)
- formatDate.ts (camelCase utilities)
- AUTH_ENDPOINTS.ts (SCREAMING_SNAKE_CASE constants)

❌ Avoid:
- userprofile.tsx
- user_profile.tsx
- UserProfile.js (use .tsx for React)

4. Import Organization

// βœ… Good: Organized imports
// External libraries
import React from 'react';
import { NextRequest, NextResponse } from 'next/server';

// Internal packages
import { Button } from '@packages/ui';
import { formatDate } from '@packages/utils';

// Local imports
import { db } from '@/lib/db';
import { validateUser } from '@/lib/validation';

πŸ“– Navigation Tips

Finding Files Quickly

VS Code shortcuts:

  • Cmd/Ctrl + P - Quick file search
  • Cmd/Ctrl + Shift + F - Search in files
  • Cmd/Ctrl + T - Go to symbol

Common file patterns:

  • Routes: app/*/page.tsx or app/*/route.ts
  • Components: components/**/*.tsx
  • Utilities: lib/**/*.ts
  • Types: **/*.types.ts or types/**/*.ts

Understanding the Flow

  1. Start with routes in app/ directory
  2. Follow imports to understand data flow
  3. Check components for UI structure
  4. Review lib files for business logic
  5. Examine schema for data structure

πŸ”„ Development Workflow

Adding New Features

  1. Plan the feature - Identify affected areas
  2. Database changes - Update schema if needed
  3. API layer - Create routes or server actions
  4. UI components - Build necessary components
  5. Pages/screens - Create or update routes
  6. Testing - Add tests for new functionality

Making Changes

  1. Identify the layer - Database, API, UI, or routing
  2. Find the relevant files - Use the structure guide above
  3. Make changes - Follow established patterns
  4. Test changes - Run relevant tests
  5. Update documentation - If adding public APIs

This structure provides a solid foundation for scaling your application while maintaining code quality and developer experience.

🎯 Next Steps

Now that you understand the project structure:

  1. Editor Setup - Configure your editor for optimal development
  2. Development Guide - Learn the development workflow
  3. Database Guide - Understand the database layer
  4. API Development - Build robust APIs

On this page

Project StructureπŸ—οΈ High-Level OverviewπŸ“± Applications (/apps)Web Application (/apps/web)Mobile Application (/apps/mobile)πŸ“¦ Shared Packages (/packages)UI Components (/packages/ui)Utilities (/packages/utils)Database (/packages/database)ESLint Configuration (/packages/eslint-config)πŸ› οΈ Configuration FilesRoot ConfigurationπŸ—‚οΈ File Organization Principles1. Colocation2. Feature-based Structure3. Clear Naming Conventions4. Import/Export PatternsπŸ”„ Data Flow ArchitectureFrontend to BackendShared Code Flow🎯 Best Practices1. Dependency Direction2. Component Organization3. File Naming4. Import OrganizationπŸ“– Navigation TipsFinding Files QuicklyUnderstanding the FlowπŸ”„ Development WorkflowAdding New FeaturesMaking Changes🎯 Next Steps