FlyHigher is a modern, full-stack flight booking application built with Next.js 14, PostgreSQL, and Tailwind CSS. It offers a seamless experience for users to search, book, and manage flights, while providing administrators with a powerful dashboard to manage the entire platform.
- Flight Search: Advanced search by city, date, class, and passengers.
- Seat Selection: Interactive visual seat map with class differentiation (Economy, Business, First).
- Booking Flow: Secure checkout process with Midtrans payment integration.
- Ticket Management: View, download, and manage booked tickets.
- Authentication: Secure sign-up/sign-in with Passport data encryption.
- Analytics: Real-time overview of revenue, active flights, and bookings.
- Flight Management: CRUD operations for flights, scheduling, and pricing.
- Airplane Management: Manage fleet inventory and configurations.
- User & Ticket Management: Oversee user roles and booking statuses.
- Data Visualization: Charts and tables for business insights.
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Database: PostgreSQL
- ORM: Prisma
- Auth: Lucia Auth v3 / NextAuth
- Styling: Tailwind CSS, Shadcn/ui
- Payment: Midtrans Gateway
- State Management: TanStack Query
- Testing: Vitest (Unit), Playwright (E2E)
Follow these steps to set up the project locally.
- Node.js 18+
- PostgreSQL Database (Local or Cloud like Supabase/Neon)
-
Clone the repository
git clone https://github.com/yourusername/booking-ticket.git cd booking-ticket -
Install dependencies
npm install
-
Configure Environment Variables Create a
.envfile in the root directory and add the following:# Database DATABASE_URL="postgresql://user:password@host:port/db?schema=public" DIRECT_URL="postgresql://user:password@host:port/db?schema=public" # Auth (Example) AUTH_SECRET="your-secret-key" # Midtrans (Payment) MIDTRANS_SERVER_KEY="your-server-key" MIDTRANS_CLIENT_KEY="your-client-key" NEXT_PUBLIC_MIDTRANS_CLIENT_KEY="your-client-key" # Public URL NEXT_PUBLIC_BASE_URL="http://localhost:3000"
-
Setup Database
# Run migrations npx prisma migrate dev # Seed the database (Important!) npx prisma db seed
Note: Seeding creates default admin users and dummy flight data.
-
Run the development server
npm run dev
Open http://localhost:3000 in your browser.
The project includes both unit and end-to-end tests.
# Run Unit Tests
npm test
# Run E2E Tests
npm run e2e├── src/
│ ├── app/ # Next.js App Router pages
│ ├── components/ # Reusable UI components
│ ├── lib/ # Utilities and server actions
│ └── hooks/ # Custom React hooks
├── prisma/ # Database schema and seed script
├── public/ # Static assets
└── tests/ # Unit and E2E tests
This project is licensed under the MIT License.