8- Purchase simulation with transaction logging
9- Simple, clean design with CSS styling
10- SQLite database for storing products and transactions
11
12## Structure
13
14- `backend/index.ts` - Main Hono server with API routes
15- `backend/database/` - Database setup and queries
16- `frontend/` - HTML, CSS, and JavaScript for the website
17- `shared/` - Shared types and utilities
22```
23โโโ backend/
24โ โโโ database/
25โ โ โโโ migrations.ts # Database schema
26โ โ โโโ queries.ts # Database operations
27โ โโโ routes/
28โ โ โโโ auth.ts # Authentication routes
52- **Backend**: Hono (TypeScript)
53- **Frontend**: React with TypeScript
54- **Database**: SQLite
55- **Styling**: TailwindCSS
56- **PDF Generation**: jsPDF
59## Getting Started
60
611. The application will automatically set up the database on first run
622. **Admin Login Credentials**:
63 - **Email**: `admin@fabrication.com`
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { runMigrations } from "./database/migrations.ts";
3import auth from "./routes/auth.ts";
4import bills from "./routes/bills.ts";
13});
14
15// Initialize database on startup
16await runMigrations();
17
76 }
77
78 console.log("Database migrations completed successfully");
79}
17app.use('*', errorHandler);
18
19// Initialize database (similar to connecting to MongoDB)
20await UserModel.init();
21
8
9- **Express โ Hono**: Web framework for routing and middleware
10- **MongoDB/Mongoose โ SQLite**: Database with ORM-like patterns
11- **Node.js โ Deno**: Runtime environment
12
133## Development Notes
134
135- Database is automatically initialized on startup
136- SQLite table is created if it doesn't exist
137- All responses follow a consistent JSON structure
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
10 overLimit,
11 startTrackingUsage,
12} from "../database/queries.tsx";
13import { makeChangeValTypeTool, makeFetchTool, makeTextEditorTool } from "../tools/index.ts";
14import fileWithLinesNumbers from "../utils/fileWithLinesNumbers.ts";