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 reviewsRouter from "./routes/reviews.ts";
5
11});
12
13// Initialize database on startup
14await createTables();
15
15```
16โโโ backend/
17โ โโโ database/
18โ โ โโโ blob-storage.ts # Blob storage functions
19โ โ โโโ migrations.ts # SQLite schema (backup)
56- Counter: `workgroup_message_counter`
57
58## Database Schema
59
60### User Object
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { createUser, getUserByUsername } from "../database/blob-storage.ts";
3import type { AuthRequest, AuthResponse } from "../../shared/types.ts";
4
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 { initializeStorage } from "./database/blob-storage.ts";
4import auth from "./routes/auth.ts";
5import messages from "./routes/messages.ts";
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { createMessage, getAllMessages, getUserByUsername } from "../database/blob-storage.ts";
3import type { MessageRequest, MessageResponse, MessagesResponse } from "../../shared/types.ts";
4
6 getCompanySummaries,
7 getReviewsByCompany
8} from "../database/queries.ts";
9import type { NewReview, ReviewFilters } from "../../shared/types.ts";
10
15```
16โโโ backend/
17โ โโโ database/
18โ โ โโโ migrations.ts # Database schema setup
19โ โ โโโ queries.ts # Database query functions
20โ โโโ routes/
21โ โโโ reviews.ts # Review API endpoints
38
39- **Backend**: Hono (TypeScript API framework)
40- **Database**: SQLite
41- **Frontend**: React with TypeScript
42- **Styling**: TailwindCSS
9- [ ] make it one click to branch off like old jp townie demos
10- [ ] opentownie as a pr bot
11- [ ] give it the ability to see its own client-side and server-side logs by building a middleware that shoves them into a SQL light database date and then give it a tool to access them
12- [ ] do a browser use or screenshot thing to give it access to its own visual output
13- [ ] Have it default to creating a new branch off main
7export const thinkTool = tool({
8 description:
9 "Use the tool to think about something. It will not obtain new information or change the database, but just append the thought to the log. Use it when complex reasoning or some cache memory is needed.",
10 parameters: z.object({
11 thought: z.string().describe("A thought to think about."),
174```
175โโโ backend/
176โ โโโ database/
177โ โ โโโ migrations.ts # Schema definitions
178โ โ โโโ queries.ts # DB query functions
234 ```
235
236### Database Patterns
237- Run migrations on startup or comment out for performance
238- Change table names when modifying schemas rather than altering