21## Further resources
22
23- [React Hono Example](https://www.val.town/x/stevekrouse/reactHonoExample) is a bigger example project, with a SQLite database table, queries, client-side CSS, a favicon, and shared code that runs on both client and server.
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 expenses from "./routes/expenses.ts";
5import goals from "./routes/goals.ts";
15});
16
17// Initialize database on startup
18await runMigrations();
19
69 <p class="text-sm text-blue-800">
70 <strong>API Status:</strong> โ
Backend is running<br>
71 <strong>Database:</strong> โ
Initialized<br>
72 <strong>Frontend:</strong> โ Not found
73 </p>
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { getUser, updateUser, setBudget, getBudgets } from "../database/queries.ts";
3import { getMonthYear } from "../../shared/utils.ts";
4
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { getMonthlyReport, getCategorySpending, getUser, getGoals, getBudgets } from "../database/queries.ts";
3import { generateSavingsInsights, generateMotivationalMessage, getMonthYear } from "../../shared/utils.ts";
4
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { addGoal, getGoals, updateGoalProgress, deleteGoal, getTravelDestinations } from "../database/queries.ts";
3
4const goals = new Hono();
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { addExpense, getExpenses, getExpensesByMonth, deleteExpense } from "../database/queries.ts";
3import { getMonthYear } from "../../shared/utils.ts";
4
1import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
2
3// Database schema for the expense tracker
4export async function runMigrations() {
5 console.log("Running database migrations...");
6
7 // Users table
158 }
159
160 console.log("Database migrations completed!");
161}
33```
34โโโ backend/
35โ โโโ database/
36โ โ โโโ migrations.ts # Database schema
37โ โ โโโ queries.ts # Database operations
38โ โโโ routes/
39โ โ โโโ expenses.ts # Expense CRUD operations
8- ๐ User registration
9- ๐ช Session management with cookies
10- ๐พ SQLite database for user storage
11- ๐จ Beautiful UI with TailwindCSS
12- ๐ฑ Responsive design
41- `GET /api/auth` - Check authentication status
42
43## Database Schema
44
45The app uses SQLite with a simple users table:
11});
12
13// Database setup
14const TABLE_NAME = 'login_users_1';
15
16// Initialize database
17async function initDatabase() {
18 await sqlite.execute(`CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
19 id INTEGER PRIMARY KEY AUTOINCREMENT,
34}
35
36// Initialize database on startup
37await initDatabase();
38
39// Serve static files