1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { readFile, serveFile } from "https://esm.town/v/std/utils/index.ts";
3import { runMigrations } from "./database/migrations.ts";
4import users from "./routes/users.ts";
5import quotes from "./routes/quotes.ts";
13});
14
15// Initialize database on startup
16await runMigrations();
17
5
6export async function runMigrations() {
7 console.log('Running database migrations...');
8
9 // Create goals table
34 `);
35
36 console.log('Database migrations completed successfully');
37}
38
7 getGuestCount,
8 getTotalAttendees
9} from "../database/queries.ts";
10
11const guests = new Hono();
15```
16โโโ backend/
17โ โโโ database/
18โ โ โโโ migrations.ts # Database schema setup
19โ โ โโโ queries.ts # Database query functions
20โ โโโ routes/
21โ โ โโโ goals.ts # Goal CRUD operations
44- `GET /api/stats/:goalId` - Get goal statistics
45
46## Database Schema
47
48### Goals Table
65## Getting Started
66
671. The app will automatically set up the database on first run
682. Navigate to the root URL to start using the application
693. Create your first goal and start tracking daily progress!
9- Admin dashboard to view all registered guests
10- Responsive design for mobile and desktop
11- SQLite database for data persistence
12
13## Project Structure
15```
16โโโ backend/
17โ โโโ database/
18โ โ โโโ migrations.ts # Database schema
19โ โ โโโ queries.ts # Database operations
20โ โโโ routes/
21โ โ โโโ guests.ts # Guest API endpoints
402. The app captures their name, email, phone, and number of attendees
413. Admin can view all registered guests in real-time
424. Data is stored securely in SQLite database
43
44## Tech Stack
46- **Backend**: Hono (TypeScript API framework)
47- **Frontend**: React with TypeScript
48- **Database**: SQLite
49- **Styling**: TailwindCSS
50- **Platform**: Val Town
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { createChatMessage, getRecentChatMessages, getUserById } from "../database/queries.ts";
3import type { CreateMessageRequest, SSEMessage } from "../../shared/types.ts";
4
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { createQuote, getAllQuotes, getUserById } from "../database/queries.ts";
3import type { CreateQuoteRequest } from "../../shared/types.ts";
4
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { createUser, getUserByUsername } from "../database/queries.ts";
3import type { CreateUserRequest } from "../../shared/types.ts";
4
36 `);
37
38 console.log("Database migrations completed");
39}
15```
16โโโ backend/
17โ โโโ database/
18โ โ โโโ migrations.ts # Database schema setup
19โ โ โโโ queries.ts # Database query functions
20โ โโโ routes/
21โ โ โโโ quotes.ts # Quote-related API endpoints
38
39- **Backend**: Hono (TypeScript API framework)
40- **Database**: SQLite for data persistence
41- **Frontend**: React with TypeScript
42- **Styling**: TailwindCSS
45## Getting Started
46
471. The app will automatically set up the database on first run
482. Visit the app URL to start using the platform
493. Create a username to begin posting quotes and chatting