This repository is a full-stack project for managing flight reservations, built with Next.js. It's a comprehensive example to help beginners understand how to use a modern stack, featuring:
The frontend is built using Next.js, a React framework with built-in SSR (Server-Side Rendering) and routing capabilities.
tRPC is used to create type-safe APIs that communicate between the client and the server. This helps ensure end-to-end type safety.
Tailwind CSS and shadcn UI are used for designing beautiful and responsive components.
Drizzle ORM is utilized for database interaction, making queries easy and type-safe. You can manage your database schema with a declarative approach.
Lucia is integrated for authentication to keep the app secure, managing sessions and sign-ins.
Follow these steps to get the project up and running on your local machine.
- Node.js ≥ 20
pnpmas your package manager- MySQL database (or compatible)
.envfile with the correct environment variables (see below)
-
Clone the repository
git clone https://github.com/yourusername/flight-management-system.git cd flight-management-system -
Install dependencies
pnpm install
-
Set up environment variables
Create a
.envfile in the root directory:DATABASE_URL="mysql://your-username:your-password@localhost:3306/fmp"
Make sure you have already created the
fmpdatabase in your local MySQL instance. -
Push schema to the database
npx drizzle-kit push
-
Seed the database
pnpm seed
pnpm devVisit http://localhost:3000 to view the app.