A production-grade Progressive Web Application (PWA) built with Next.js 16, TypeScript, and Tailwind CSS. This application follows enterprise-level architectural patterns and best practices for scalability, maintainability, and performance.
- 🚀 Next.js 16 - Latest Next.js with App Router, Turbopack, and React Server Components
- 📱 Progressive Web App - Installable app with offline support and service workers
- 🎨 Tailwind CSS 4 - Modern utility-first CSS framework
- 🔒 TypeScript - Type-safe codebase with strict mode enabled
- 🧪 Comprehensive Testing - Jest, React Testing Library, and Playwright
- ⚡ Development Tooling - ESLint, Prettier, Husky, lint-staged
- 🔐 Security Headers - Modern security headers configured
- 📊 CI/CD Ready - GitHub Actions workflow included
- Framework: Next.js 16.1.6
- Language: TypeScript 5
- Styling: Tailwind CSS 4
- PWA: @ducanh2912/next-pwa with Workbox
- Testing:
- Unit & Integration: Jest + React Testing Library
- E2E: Playwright
- Code Quality: ESLint + Prettier + Husky
- Package Manager: pnpm
- Node.js 20.x or higher
- pnpm 9.x or higher
-
Clone the repository:
git clone <repository-url> cd Ride-Link-Driver
-
Install dependencies:
pnpm install
-
Copy environment variables:
cp .env.local.example .env.local
-
Start the development server:
pnpm dev
-
Open http://localhost:3000 in your browser.
pnpm dev- Start development server with Turbopackpnpm build- Build production bundlepnpm start- Start production serverpnpm lint- Run ESLintpnpm lint:fix- Fix ESLint errors automaticallypnpm format- Format code with Prettierpnpm format:check- Check code formattingpnpm type-check- Run TypeScript type checkingpnpm test- Run all testspnpm test:unit- Run unit testspnpm test:watch- Run tests in watch modepnpm test:coverage- Generate coverage reportpnpm test:e2e- Run E2E tests with Playwright
Ride-Link-Driver/
├── .github/
│ └── workflows/ # GitHub Actions CI/CD
├── .husky/ # Git hooks
├── __tests__/ # Test files
│ ├── unit/
│ ├── integration/
│ └── e2e/
├── docs/ # Documentation
├── public/ # Static assets
│ ├── icons/ # PWA icons
│ └── manifest.json # PWA manifest
├── src/
│ ├── app/ # Next.js app directory
│ │ ├── layout.tsx # Root layout
│ │ ├── page.tsx # Home page
│ │ ├── offline/ # Offline fallback
│ │ └── globals.css # Global styles
│ ├── components/ # React components
│ │ ├── ui/ # Reusable UI components
│ │ ├── features/ # Feature components
│ │ ├── layout/ # Layout components
│ │ └── providers/ # Context providers
│ └── lib/ # Utilities and libraries
│ ├── hooks/ # Custom React hooks
│ ├── utils/ # Helper functions
│ ├── constants/ # App constants
│ ├── types/ # TypeScript types
│ └── services/ # API services
├── .env.local.example # Environment variables template
├── .eslintrc.json # ESLint configuration
├── .prettierrc # Prettier configuration
├── jest.config.ts # Jest configuration
├── next.config.ts # Next.js configuration
├── playwright.config.ts # Playwright configuration
├── package.json
└── tsconfig.json
Create a .env.local file in the root directory:
NEXT_PUBLIC_APP_NAME="Ride Link Driver"
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_API_URL=http://localhost:3000/apiThe PWA is configured in next.config.ts with:
- Service worker registration
- Offline fallback pages
- Comprehensive caching strategies
- Security headers
pnpm test:unitpnpm test:e2epnpm test:coverageCoverage thresholds are set at 70% for branches, functions, lines, and statements.
pnpm build
pnpm startThe application is optimized for deployment on Vercel with zero configuration.
This project enforces code quality through:
- ESLint - Static code analysis with Next.js recommended rules
- Prettier - Consistent code formatting
- TypeScript - Type safety and better IDE support
- Husky - Pre-commit hooks to ensure code quality
- lint-staged - Run linters only on staged files
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License.