|
|
|
@@ -1,36 +1,89 @@
|
|
|
|
|
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
|
|
|
|
|
# Travel AntarKota
|
|
|
|
|
|
|
|
|
|
## Getting Started
|
|
|
|
|
Travel AntarKota is a premium, high-performance, and feature-rich containerized Intercity Travel Booking Web Application built using Next.js 14, Prisma, and MySQL.
|
|
|
|
|
|
|
|
|
|
First, run the development server:
|
|
|
|
|
Designed with a modern, responsive **Glassmorphism Dark Theme**, it provides customers with a seamless ticket booking workflow and gives administrators full control over routes, schedules, transactions, and branding options.
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
npm run dev
|
|
|
|
|
# or
|
|
|
|
|
yarn dev
|
|
|
|
|
# or
|
|
|
|
|
pnpm dev
|
|
|
|
|
# or
|
|
|
|
|
bun dev
|
|
|
|
|
```
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
|
|
|
|
## Key Features
|
|
|
|
|
|
|
|
|
|
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
|
|
|
|
### 👤 Customer Features
|
|
|
|
|
- **Route Search**: Find active intercity schedules by departure and arrival cities, date, and ticket pricing.
|
|
|
|
|
- **Seat Selection**: Interactive, vehicle-specific visual layout selection (Toyota HiAce 10-seater or Executive Bus 30-seater) preventing duplicate seat bookings in real time.
|
|
|
|
|
- **Digital Ticketing**: Generate and view digital tickets with QR/barcode references once payment is verified.
|
|
|
|
|
- **Order Tracking**: Check booking status (Pending, Lunas, Batal) at any time.
|
|
|
|
|
- **User Profile**: Dedicated customer dashboard to manage active tickets, view travel history, update personal details, and change security passwords.
|
|
|
|
|
|
|
|
|
|
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
|
|
|
|
|
### ⚙️ Administrator Features
|
|
|
|
|
- **Dashboard Overview**: Visual overview statistics for bookings, routes, active vehicles, revenue, and pending schedules.
|
|
|
|
|
- **Route Management**: Add, update, or remove intercity routes, durations, and pricing.
|
|
|
|
|
- **Schedule Management**: Create departure schedules linked to active routes, select vehicle formats, and define pricing overrides.
|
|
|
|
|
- **Booking Management**: Audit transaction logs, view passenger details, confirm payments, and cancel bookings.
|
|
|
|
|
- **Dynamic Branding & Styling**: Custom configuration via database settings:
|
|
|
|
|
- Custom Brand Name and Logo Icons/Images.
|
|
|
|
|
- Dynamically adjustable **Primary Theme Color** (calculates light/dark relative luminance dynamically on page load to adjust contrast and prevent styling issues).
|
|
|
|
|
- **Admin Profile**: Manage administrator information and securely update passwords.
|
|
|
|
|
|
|
|
|
|
## Learn More
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
To learn more about Next.js, take a look at the following resources:
|
|
|
|
|
## Tech Stack & Architecture
|
|
|
|
|
|
|
|
|
|
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
|
|
|
|
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
|
|
|
|
- **Frontend & Backend**: Next.js 14.2.x (React Server Components, App Router).
|
|
|
|
|
- **Database ORM**: Prisma Client v7.8.0.
|
|
|
|
|
- **Database**: MySQL 8.0.
|
|
|
|
|
- **Database Driver Adapter**: `@prisma/adapter-mariadb` (MariaDB node-driver compatibility layer).
|
|
|
|
|
- **Security & Session**: HTTP-Only Cookie-based JWT tokens (`jose`) with password verification hashed via `bcryptjs`.
|
|
|
|
|
- **Containerization**: Multi-stage `Dockerfile` and `docker-compose.yml` for isolated production-ready orchestration.
|
|
|
|
|
|
|
|
|
|
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Deploy on Vercel
|
|
|
|
|
## Production Deployment & Orchestration
|
|
|
|
|
|
|
|
|
|
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
|
|
|
|
The application is fully containerized. A robust, non-blocking Next.js build configuration ensures that all dynamic pages are statically ignored at build-time using a dummy mock Prisma adapter, bypassing database query timeouts entirely.
|
|
|
|
|
|
|
|
|
|
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
|
|
|
|
|
### Requirements
|
|
|
|
|
- Docker and Docker Compose installed.
|
|
|
|
|
|
|
|
|
|
### Setup and Running the Application
|
|
|
|
|
|
|
|
|
|
1. **Clone and Navigate**:
|
|
|
|
|
```bash
|
|
|
|
|
git clone <repository_url>
|
|
|
|
|
cd travel-antarkota
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
2. **Launch Container Services**:
|
|
|
|
|
Start the MySQL database and Next.js application in background mode:
|
|
|
|
|
```bash
|
|
|
|
|
docker compose up -d --build
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
3. **Database Auto-Orchestration**:
|
|
|
|
|
- The Next.js container automatically executes `docker-entrypoint.sh` on startup.
|
|
|
|
|
- It performs a TCP healthcheck to wait until MySQL is fully initialized.
|
|
|
|
|
- It executes `prisma db push` to synchronize tables.
|
|
|
|
|
- It checks and seeds initial system settings and creates the default administrator:
|
|
|
|
|
- **Admin Email**: `admin@travel.com`
|
|
|
|
|
- **Admin Password**: `admin123`
|
|
|
|
|
|
|
|
|
|
4. **Accessing the App**:
|
|
|
|
|
- **User Frontend**: [http://localhost:3000](http://localhost:3000)
|
|
|
|
|
- **Admin Dashboard**: [http://localhost:3000/admin](http://localhost:3000/admin) (Log in using the default admin credentials).
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
|
|
|
|
|
Secrets and settings are managed strictly through environment variables inside `docker-compose.yml`:
|
|
|
|
|
- `JWT_SECRET`: Secret key used for signing session JSON Web Tokens.
|
|
|
|
|
- `ADMIN_EMAIL`: Initial admin account email created during database seeding.
|
|
|
|
|
- `ADMIN_PASSWORD`: Initial admin account password.
|
|
|
|
|
|
|
|
|
|
All database transactions, session management, and image uploads (stored as persistent base64 long-text entries in MySQL) are self-contained and run out of the box with zero external configuration requirements.
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
|
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
|
|
|