docs: add MIT License, update README.md, and ensure all dynamic views use force-dynamic to prevent cached styling issues in production
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2026 Travel AntarKota by Belisov
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -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.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Key Features
|
||||||
|
|
||||||
|
### 👤 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.
|
||||||
|
|
||||||
|
### ⚙️ 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.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Tech Stack & Architecture
|
||||||
|
|
||||||
|
- **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.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Production Deployment & Orchestration
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
### Requirements
|
||||||
|
- Docker and Docker Compose installed.
|
||||||
|
|
||||||
|
### Setup and Running the Application
|
||||||
|
|
||||||
|
1. **Clone and Navigate**:
|
||||||
```bash
|
```bash
|
||||||
npm run dev
|
git clone <repository_url>
|
||||||
# or
|
cd travel-antarkota
|
||||||
yarn dev
|
|
||||||
# or
|
|
||||||
pnpm dev
|
|
||||||
# or
|
|
||||||
bun dev
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
2. **Launch Container Services**:
|
||||||
|
Start the MySQL database and Next.js application in background mode:
|
||||||
|
```bash
|
||||||
|
docker compose up -d --build
|
||||||
|
```
|
||||||
|
|
||||||
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
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`
|
||||||
|
|
||||||
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.
|
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).
|
||||||
|
|
||||||
## Learn More
|
---
|
||||||
|
|
||||||
To learn more about Next.js, take a look at the following resources:
|
## Configuration
|
||||||
|
|
||||||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
Secrets and settings are managed strictly through environment variables inside `docker-compose.yml`:
|
||||||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
- `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.
|
||||||
|
|
||||||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
|
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.
|
||||||
|
|
||||||
## Deploy on Vercel
|
---
|
||||||
|
|
||||||
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.
|
## License
|
||||||
|
|
||||||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { notFound } from 'next/navigation';
|
|||||||
import CheckoutClient from '@/components/CheckoutClient';
|
import CheckoutClient from '@/components/CheckoutClient';
|
||||||
import { getSettings } from '@/lib/settings';
|
import { getSettings } from '@/lib/settings';
|
||||||
|
|
||||||
export const revalidate = 0;
|
export const dynamic = 'force-dynamic';
|
||||||
|
|
||||||
export default async function CheckoutPage({
|
export default async function CheckoutPage({
|
||||||
params,
|
params,
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ import { FaBuilding, FaMountain, FaTree, FaChair, FaBolt, FaShieldAlt } from 're
|
|||||||
import styles from './page.module.css';
|
import styles from './page.module.css';
|
||||||
import { getSettings } from '@/lib/settings';
|
import { getSettings } from '@/lib/settings';
|
||||||
|
|
||||||
export const revalidate = 0;
|
export const dynamic = 'force-dynamic';
|
||||||
|
|
||||||
export default async function HomePage() {
|
export default async function HomePage() {
|
||||||
const settings = await getSettings();
|
const settings = await getSettings();
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { notFound } from 'next/navigation';
|
|||||||
import TicketView from '@/components/TicketView';
|
import TicketView from '@/components/TicketView';
|
||||||
import { getSettings } from '@/lib/settings';
|
import { getSettings } from '@/lib/settings';
|
||||||
|
|
||||||
export const revalidate = 0;
|
export const dynamic = 'force-dynamic';
|
||||||
|
|
||||||
export default async function TicketPage({
|
export default async function TicketPage({
|
||||||
params,
|
params,
|
||||||
|
|||||||
Reference in New Issue
Block a user