15```
16โโโ backend/
17โ โโโ database/
18โ โ โโโ migrations.ts # Schema definitions
19โ โ โโโ queries.ts # DB query functions
44- **Backend**: Hono.js with WebSockets
45- **Frontend**: React with TypeScript
46- **Database**: SQLite for persistent storage
47- **Speech Recognition**: Web Speech API with customization for Indian English
48- **Styling**: TailwindCSS
2import { cors } from "https://esm.sh/hono@3.11.7/middleware";
3import { serveFile, readFile } from "https://esm.town/v/std/utils/index.ts";
4import { runMigrations } from "./database/migrations.ts";
5import apiRoutes from "./routes/api.ts";
6
17app.use("*", cors());
18
19// Run database migrations
20app.use("*", async (c, next) => {
21 try {
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { OpenAI } from "https://esm.town/v/std/openai";
3import * as db from "../database/queries.ts";
4import type { ConversationRequest, ConversationResponse } from "../../shared/types.ts";
5
247 conversationId: convoId,
248 message: {
249 id: crypto.randomUUID(), // This is just for the response, the actual ID is in the database
250 role: "assistant",
251 content: assistantMessage,
15```
16โโโ backend/
17โ โโโ database/
18โ โ โโโ migrations.ts # Schema definitions
19โ โ โโโ queries.ts # DB query functions
45- Backend: Hono (API framework)
46- Frontend: React with TypeScript
47- Database: SQLite for data storage
48- AI: OpenAI API for conversational learning
49- Styling: TailwindCSS
16
17- Backend: Hono (TypeScript)
18- Database: SQLite
19- Frontend: React with Tailwind CSS
20- Real-time: Server-Sent Events (SSE)
24```
25โโโ backend/
26โ โโโ database/
27โ โ โโโ migrations.ts # Schema definitions
28โ โ โโโ queries.ts # DB query functions
49
50The application uses:
51- SQLite database to store job postings, chat messages, and active users
52- Server-Sent Events (SSE) for real-time updates to the chat and user activity
53- React components for a responsive UI
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 createJob, getJobs, getJobById,
7 createChatMessage, getRecentChatMessages,
8 createOrUpdateUser, getActiveUsers
9} from "./database/queries.ts";
10import { Job, ChatMessage, SSEEvent } from "../shared/types.ts";
11
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { cors } from "https://esm.sh/hono@3.11.7/middleware";
3import { runMigrations } from "./database/migrations.ts";
4import jobRoutes from "./routes/jobs.ts";
5import chatRoutes from "./routes/chat.ts";
18app.use("*", cors());
19
20// Run database migrations on startup
21app.use("*", async (c, next) => {
22 try {
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 { getJobPostings, getChatMessages } from "../database/queries.ts";
4
5const static_routes = new Hono();
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { createChatMessage, getChatMessages } from "../database/queries.ts";
3
4const chat = new Hono();
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { createJobPosting, getJobPostings, getJobPostingById } from "../database/queries.ts";
3
4const jobs = new Hono();