77- **Frontend:** React 18 + TailwindCSS
78- **Authentication:** Session-based with cookies
79- **Database:** SQLite with migrations
80- **Styling:** TailwindCSS + Custom CSS
81- **Deployment:** Val Town Platform
85```
86โโโ backend/
87โ โโโ database/
88โ โ โโโ migrations.ts # Database schema & default data
89โ โ โโโ queries.ts # Database query functions
90โ โโโ routes/ # API route modules
91โ โโโ auth.ts # Authentication endpoints
179This project is designed for Val Town platform:
1801. All code is ready to deploy
1812. Database migrations run automatically
1823. HTTP trigger is configured
1834. No additional setup required
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, seedSampleData } from "./database/migrations.ts";
4import auth from "./routes/auth.ts";
5import users from "./routes/users.ts";
13});
14
15// Initialize database on startup
16await runMigrations();
17await seedSampleData();
10 updateUserBalance,
11 getUserByUsername
12} from "../database/queries.ts";
13
14const users = new Hono();
8 updateUserBalance,
9 getUserById
10} from "../database/queries.ts";
11
12const betting = new Hono();
8 getSessionUser,
9 deleteSession
10} from "../database/queries.ts";
11
12const auth = new Hono();
1import { serveFile } from "https://esm.town/v/std/utils/index.ts";
2import { generateCode } from "./backend/generate-code.ts";
3import { createTables } from "./database/migrations.ts";
4import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries.ts";
5
6await createTables();
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { runMigrations, seedData } from "./database/migrations.ts";
3import healthRoutes from "./routes/health.ts";
4import appointmentRoutes from "./routes/appointments.ts";
14});
15
16// Initialize database on startup
17try {
18 await runMigrations();
19 await seedData();
20 console.log("โ
Database initialized successfully");
21} catch (error) {
22 console.error("โ Database initialization failed:", error);
23}
24
43```
44โโโ backend/
45โ โโโ database/
46โ โ โโโ migrations.ts # Database schema
47โ โ โโโ queries.ts # Database operations
48โ โโโ routes/
49โ โ โโโ health.ts # Health tracking endpoints
75- **Backend**: Hono.js API framework
76- **Frontend**: React 18.2.0 with TypeScript
77- **Database**: SQLite for data persistence
78- **Styling**: TailwindCSS
79- **Storage**: Val Town Blob storage for files
831. The backend server runs on `/backend/index.ts`
842. Frontend is served from `/frontend/index.html`
853. Database is automatically initialized on first run
864. All health data is stored securely in SQLite
87
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import type { ApiResponse } from "../../shared/types.ts";
3import { getAllHealthArticles, getHealthArticleById, getAllExercises, getEmergencyContacts } from "../database/queries.ts";
4
5const articles = new Hono();
286 const letter = c.req.query("letter");
287
288 // In a real application, this would come from a database
289 const dictionaryEntries = [
290 {
1import { serveFile } from "https://esm.town/v/std/utils/index.ts";
2import { generateCode } from "./backend/generate-code.ts";
3import { createTables } from "./database/migrations.ts";
4import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries.ts";
5
6await createTables();