Project Overview
Open Tarteel is built with Next.js 15 using the App Router, TypeScript, Tailwind CSS, and Jotai for state management. The project follows modern React patterns and best practices.Directory Structure
Core Directories
/src/app - Next.js App Router
Contains the application routes and pages using Next.js 13+ App Router:
The App Router uses file-system based routing. Each folder represents a route segment.
/src/components - React Components
Reusable UI components organized by functionality:
Component Architecture
- Functional components with React hooks
- TypeScript for type safety
- Tailwind CSS for styling
- Jotai for global state management
/src/hooks - Custom React Hooks
Reusable React hooks for common functionality:
Custom hooks follow the
use prefix convention and encapsulate reusable logic./src/jotai - State Management
Global state atoms using Jotai:
Jotai provides a minimal and flexible state management solution with atomic updates.
/src/utils - Utility Functions
Helper functions and utilities:
/src/types - TypeScript Types
Type definitions for the entire application:
/src/constants - Configuration
Application constants and configuration:
/src/locales - Internationalization
Translation files for multiple languages:
/src/gun - GunDB Integration
Decentralized database integration using GunDB for peer-to-peer data sync.
/src/svgs - SVG Components
SVG icons as React components for better performance and customization:
Configuration Files
tsconfig.json - TypeScript Configuration
Key TypeScript settings:
Path aliases are configured for cleaner imports throughout the project.
tailwind.config.ts - Tailwind Configuration
Custom Tailwind CSS configuration for the project’s design system.
next.config.ts - Next.js Configuration
Next.js settings including:
- PWA configuration via Serwist
- Bundle analyzer integration
- Image optimization settings
- Webpack customizations (SVGR)
eslint.config.mjs - Linting Configuration
ESLint rules including:
- Next.js recommended rules
- TypeScript rules
- React rules
- Import sorting
- Prettier integration
Key Technologies
Frontend Framework
- Next.js 15 - React framework with App Router
- React 19 - UI library
- TypeScript 5 - Type safety
Styling
- Tailwind CSS 3 - Utility-first CSS
- Tailwind CSS Forms - Form styling
- Tailwind CSS Typography - Typography plugin
- tailwindcss-animated - Animation utilities
State Management
- Jotai - Atomic state management
- Jotai DevTools - State debugging
Audio & Media
- WaveSurfer.js - Audio waveform visualization
- react-audio-spectrum - Audio spectrum analyzer
Internationalization
- react-intl - i18n support
Database
- GunDB - Decentralized database
PWA & Service Worker
- @serwist/next - Service worker and PWA support
Development Tools
- ESLint - Code linting
- Prettier - Code formatting
- Husky - Git hooks
- lint-staged - Staged files linting
- Commitlint - Commit message validation
- Commitizen - Interactive commit helper
Architecture Patterns
Component Patterns
State Management Pattern
Styling Pattern
Build & Deployment
The project builds to:.next/- Next.js build outputpublic/sw.js- Service worker- Static and server-rendered pages
Best Practices
- Use TypeScript - All new code should be typed
- Use path aliases - Import with
@/instead of relative paths - Component composition - Build small, reusable components
- State management - Use Jotai for shared state
- Styling - Use Tailwind utility classes
- Accessibility - Follow WCAG guidelines
- Performance - Optimize images and lazy load components
- Testing - Test in both dev and production modes