Overview
App Directory Structure
Thesrc/app/ directory uses Next.js App Router with route groups for organization:
Components Directory
Components are organized by feature and type:UI Components
Shipr uses shadcn/ui components with Base UI primitives. All UI components are located insrc/components/ui/ and can be customized via Tailwind CSS.
Key UI components:
- Forms:
form.tsx,input.tsx,textarea.tsx,select.tsx - Overlays:
dialog.tsx,sheet.tsx,popover.tsx,tooltip.tsx - Feedback:
sonner.tsx(toasts),skeleton.tsx,progress.tsx - Navigation:
tabs.tsx,dropdown-menu.tsx,breadcrumb.tsx - Layout:
card.tsx,separator.tsx,scroll-area.tsx
Hooks Directory
Custom React hooks for common patterns:Hook Usage Examples
useSyncUser — Syncs Clerk user to Convex database:Lib Directory
Utilities, configurations, and shared logic:Key Library Files
constants.ts — Central configuration:Convex Directory
Convex backend functions and schema:Convex File Patterns
Each feature typically has:- Schema definition in
schema.ts - Queries — Read data (e.g.,
getUserByClerkId) - Mutations — Write data (e.g.,
createOrUpdateUser)
Public Directory
Static assets served from root:/logo.svg, /opengraph-image.png
Configuration Files
next.config.ts
Next.js configuration with Sentry integration:tailwind.config.ts
Tailwind CSS configuration with custom theme:tsconfig.json
TypeScript configuration with path aliases:Environment Variables
Environment variables are defined in.env.example:
File Naming Conventions
- Components:
kebab-case.tsx(e.g.,dashboard-shell.tsx) - Hooks:
use-{name}.ts(e.g.,use-sync-user.ts) - Utils:
kebab-case.ts(e.g.,rate-limit.ts) - Routes:
page.tsx,layout.tsx,route.ts,not-found.tsx - Convex:
kebab-case.tsor feature name (e.g.,users.ts,chat.ts)
Import Order Convention
Next Steps
Architecture
Learn about the tech stack and architectural decisions
Routing
Understand route groups and navigation patterns
Components
Explore available UI components
Database
Deep dive into Convex queries and mutations