1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { runMigrations } from "./database/migrations.ts";
3import eventsRouter from "./routes/events.ts";
4import chatRouter from "./routes/chat.ts";
12});
13
14// Initialize database on startup
15await runMigrations();
16
7
8export async function runMigrations() {
9 console.log('Running order sorting database migrations...');
10
11 // Create customers table
95 await sqlite.execute(`CREATE INDEX IF NOT EXISTS idx_customers_type ON ${CUSTOMERS_TABLE}(type)`);
96
97 console.log('Order sorting database migrations completed successfully');
98}
99
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
3import { runMigrations } from "./database/migrations.ts";
4import webhook from "./routes/webhook.ts";
5import orders from "./routes/orders.ts";
12});
13
14// Initialize database on startup
15await runMigrations();
16
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
3import { getEvents } from "../database/queries.ts";
4
5const staticRoutes = new Hono();
7 getRecentMessages,
8 getEventById
9} from "../database/queries.ts";
10
11const chat = new Hono();
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { runMigrations } from "./database/migrations.ts";
3import flightsRoutes from "./routes/flights.ts";
4import staticRoutes from "./routes/static.ts";
11});
12
13// Initialize database on startup
14await runMigrations();
15
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { searchFlights, createBooking, getBookingById, getFlightById } from "../database/queries.ts";
3import type { FlightSearchParams, BookingRequest } from "../../shared/types.ts";
4
8 deleteEvent,
9 cleanupExpiredEvents
10} from "../database/queries.ts";
11
12const events = new Hono();
2
3export async function runMigrations() {
4 console.log("Running database migrations...");
5
6 // Events table
52 `);
53
54 console.log("Database migrations completed successfully");
55}
15```
16โโโ backend/
17โ โโโ database/
18โ โ โโโ migrations.ts # Database schema setup
19โ โ โโโ queries.ts # Database query functions
20โ โโโ routes/
21โ โ โโโ flights.ts # Flight search and booking routes
42- `GET /api/bookings/:id` - Get booking details
43
44## Database Schema
45
46- `flights` - Available flights with routes, times, and pricing