4import { INFERENCE_CALLS_TABLE, USAGE_TABLE } from "./schema.tsx";
5
6// Eventually we'll have a user database,
7// but in the meantime, we can cache user info in memory
8const userIdCache: { [key: string]: any } = {};
198```
199โโโ backend/
200โ โโโ database/
201โ โ โโโ migrations.ts # Schema definitions
202โ โ โโโ queries.ts # DB query functions
257 ```
258
259### Database Patterns
260- Run migrations on startup or comment out for performance
261- Change table names when modifying schemas rather than altering
248 'Data structures and algorithms',
249 'Object-oriented programming',
250 'Database basics',
251 'Software development principles'
252 ],
254 'Python game development',
255 'Data analysis project',
256 'Web application with database',
257 'Algorithm visualization tool'
258 ]
24 console.log("Contact form submission:", body);
25
26 // Here you could add email sending or database storage
27 return c.json({ success: true, message: "Thank you for your interest!" });
28});
772 name: 'Advanced',
773 duration: '3 months',
774 topics: ['Advanced JavaScript', 'Backend basics', 'Database integration', 'Deployment'],
775 projects: ['Full-stack application', 'Dynamic website', 'Professional project']
776 }
844 name: 'Advanced',
845 duration: '3 months',
846 topics: ['Advanced algorithms', 'Software engineering', 'Database design', 'API development'],
847 projects: ['Full application', 'Database project', 'API integration']
848 }
849 ]
772 name: 'Advanced',
773 duration: '3 months',
774 topics: ['Advanced JavaScript', 'Backend basics', 'Database integration', 'Deployment'],
775 projects: ['Full-stack application', 'Dynamic website', 'Professional project']
776 }
844 name: 'Advanced',
845 duration: '3 months',
846 topics: ['Advanced algorithms', 'Software engineering', 'Database design', 'API development'],
847 projects: ['Full application', 'Database project', 'API integration']
848 }
849 ]
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { runMigrations } from "./database/migrations.ts";
3import { auth } from "./routes/auth.ts";
4import { content } from "./routes/content.ts";
13});
14
15// Run database migrations on startup
16await runMigrations();
17
6 getUserByBearerToken,
7 updateBearerTokenLastUsed
8} from "../database/queries.ts";
9import { requireAuth } from "./auth.ts";
10import type { ContentRequest } from "../../shared/types.ts";
138});
139
140// Debug endpoint to test database
141content.get('/debug', async (c) => {
142 try {
17 getBearerTokensByUserId,
18 deleteBearerToken
19} from "../database/queries.ts";
20import type {
21 RegisterStartRequest,
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 { getUserById } from "../database/queries.ts";
4import { getCookie } from "https://esm.sh/hono@3.11.7/cookie";
5