Application Architecture
Open Tarteel is built as a Progressive Web App (PWA) using Next.js 15 with React 19, designed to provide offline-first Quran streaming capabilities.Technology Stack
Frontend Framework
- Next.js 15.4.2 with App Router
- React 19.1.0 with Server Components
- TypeScript 5 for type safety
State Management
- Jotai 2.11.1 for atomic state
- localStorage persistence
- Jotai DevTools for debugging
Styling
- Tailwind CSS 3.4.1
- Tailwind Animated
- Custom CSS variables
PWA Features
- Serwist 9.0.12 service worker
- Offline audio caching
- Install prompts
Architecture Diagram
Project Structure
Core Features
Server-Side Rendering (SSR)
Server-Side Rendering (SSR)
Next.js App Router provides:
- Initial page load optimization
- SEO-friendly reciter pages
- Automatic code splitting
- Image optimization
src/app/reciter/[id]/page.tsx
Client-Side Hydration
Client-Side Hydration
React components hydrate on the client with:
- Jotai state restoration from localStorage
- Audio player initialization
- Service worker registration
src/app/layout.tsx
Progressive Enhancement
Progressive Enhancement
The app works without JavaScript but enhances with:
- Audio playback controls
- Offline caching
- Real-time visualizers
- Keyboard shortcuts
Configuration Files
- Next.js Config
- TypeScript Config
- Package.json Scripts
next.config.ts
Performance Optimizations
Bundle Size
- Code splitting per route
- Dynamic imports for heavy components
- Tree shaking unused code
- Bundle analyzer integration
Caching Strategy
- Static assets cached indefinitely
- API responses cached 1 hour
- Audio files cached 7 days
- Service worker precaching
Network Optimization
- Lazy loading images
- Preconnect to MP3Quran servers
- HTTP/2 server push
- Compression (Brotli/gzip)
Runtime Performance
- React 19 concurrent features
- Jotai atomic updates
- Web Workers for audio processing
- RequestIdleCallback for non-critical tasks
Production Mode: In production, the app removes console logs (except errors), enables strict mode optimizations, and activates the service worker for offline support.
Development Workflow
Browser Support
- Supported
- Required Features
- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
- Mobile browsers (iOS Safari, Chrome Android)
The architecture is designed for scalability, offline-first capabilities, and optimal performance across all devices.