8 saveTourProgress,
9 getTourProgress
10} from "../database/queries.ts";
11import type { Itinerary, ItineraryRequest, TourProgress, ApiResponse } from "../../shared/types.ts";
12
16```
17βββ backend/
18β βββ database/
19β β βββ migrations.ts # Database schema
20β β βββ queries.ts # Database operations
21β βββ routes/
22β β βββ expenses.ts # Expense API routes
37## Tech Stack
38
39- **Backend**: Hono.js with SQLite database
40- **Frontend**: React with TypeScript
41- **Styling**: TailwindCSS with custom gradients
90- β
Delete expenses with confirmation
91- β
Responsive design for mobile and desktop
92- β
SQLite database with proper indexing
93- β
RESTful API endpoints
94
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 { createTables } from "./database/migrations.ts";
4import expensesRouter from "./routes/expenses.ts";
5
11});
12
13// Initialize database
14await createTables();
15
6 deleteExpense,
7 getDashboardData
8} from "../database/queries.ts";
9import type { Expense } from "../../shared/types.ts";
10
26 `);
27
28 console.log('Database tables created successfully');
29}
30
46 "slug": "codegen",
47 "link": "/blog/codegen",
48 "description": "Like Claude Artifacts, but with a backend and database",
49 "pubDate": "Thu, 22 Aug 2024 00:00:00 GMT",
50 "author": "JP Posma",
1---
2title: "Post-mortem: A Backward Incompatible Database Migration"
3description: Val runs failed due to a database migration that was not backward compatible
4pubDate: 2025-04-02T00:00:00.000Z
5author: Sophie Houser
6---
7
8Today at 10:11am we experienced a 12-minute outage, which caused HTTP vals to return 503 errors and other types of vals to fail. In the end, the root cause was a deployment timing issue where database migrations were deployed successfully, but our application code deployment hung for several minutes. The new database migrations were incompatible with the old application code and crashed the process.
9
10We aim to make all database migrations maintain backward compatibility, but in this case, we only discovered through the delayed deployment feedback that the new migrations were not compatible with previous versions.
11
12## Timeline
27## Next Steps
28
29Reliability is important to us and weβve taken steps to make sure this doesnβt happen again. Weβve added a test to ensure database migrations are backward compatible, which weβll run before we deploy any new code that includes database migrations.
12 console.log(data);
13 try {
14 // create a database page in the interactions database
15 const page = await setAction(data);
16 // console.log(page);
10 const page = await notion.pages.create({
11 parent: {
12 database_id: Deno.env.get("GLANCE_INTERACTIONS_DB_ID"),
13 },
14 properties: {
8
9 // get each of the actions from this demo from Notion
10 // data is stored in the "Glancer interactions" database and attached to the demo via relation
11 // we can't really use the relation property b/c that only holds an array of page IDs in Notion
12 // so, in Notion, we use a formula to transform the relation array into a string