2import { cors } from "https://esm.sh/hono@3.11.7/middleware";
3import { readFile, serveFile } from "https://esm.town/v/std/utils/index.ts";
4import { runMigrations } from "./database/migrations.ts";
5import {
6 getAllJobs,
10 updateUserActivity,
11 getActiveUsers
12} from "./database/queries.ts";
13import { Job, ChatMessage, ApiResponse, SessionData } from "../shared/types.ts";
14
38 `);
39
40 console.log("Database migrations completed successfully");
41}
15## Technical Stack
16
17- **Backend**: Hono.js API framework with SQLite database
18- **Frontend**: React with Tailwind CSS
19- **Data Storage**: SQLite for job postings and chat messages
23```
24โโโ backend/
25โ โโโ database/
26โ โ โโโ migrations.ts # Schema definitions
27โ โ โโโ queries.ts # DB query functions
1import { serveFile } from "https://esm.town/v/std/utils/index.ts";
2import { generateCode } from "./backend/generate-code.ts";
3import { createTables } from "./database/migrations.ts";
4import { createProject, getCode, getNextVersionNumber, insertVersion } from "./database/queries.ts";
5
6await createTables();
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { cors } from "https://esm.sh/hono@3.11.7/middleware";
3import { initializeDatabase } from "./database/migrations.ts";
4import jobRoutes from "./routes/jobs.ts";
5import chatRoutes from "./routes/chat.ts";
7import { parseProject } from "https://esm.town/v/std/utils@85-main/index.ts";
8
9// Initialize the database
10await initializeDatabase();
11
12// Create the Hono app
3 getChatMessages,
4 createChatMessage
5} from "../database/queries.ts";
6import type { ChatMessage } from "../../shared/types.ts";
7
4 getJobById,
5 createJob
6} from "../database/queries.ts";
7import type { JobPosting } from "../../shared/types.ts";
8
6
7/**
8 * Initialize database tables
9 */
10export async function initializeDatabase() {
11 // Create job postings table
12 await sqlite.execute(`
33 `);
34
35 console.log("Database initialized successfully");
36}
17- **Frontend**: HTML, JavaScript, Tailwind CSS
18- **Backend**: Hono (TypeScript)
19- **Database**: SQLite
20- **Styling**: Tailwind CSS
21
24```
25โโโ backend/
26โ โโโ database/
27โ โ โโโ migrations.ts # Schema definitions
28โ โ โโโ queries.ts # DB query functions
1// Script to set up the telegram_chats table in SQLite
2// Run this script manually to create the database table
3
4export default async function setupTelegramChatDb() {
25 `);
26
27 return "Telegram chat database table created successfully.";
28 } catch (error) {
29 console.error("Error setting up telegram_chats table:", error);