2import { blob } from "https://esm.town/v/std/blob";
3import { authMiddleware } from "./auth.ts";
4import { createKycSubmission, getKycSubmissionByUserId, updateKycStatus } from "../database/queries.ts";
5import { KycSubmissionRequest } from "../../shared/types.ts";
6import { doNamesMatch } from "../../shared/utils.ts";
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { jwt } from "https://esm.sh/hono@3.11.7/middleware/jwt";
3import { createUser, getUserByEmail, getUserById } from "../database/queries.ts";
4import { User, UserRegistration, UserLogin, AuthResponse } from "../../shared/types.ts";
5import { isValidEmail, isStrongPassword } from "../../shared/utils.ts";
20```
21โโโ backend/
22โ โโโ database/
23โ โ โโโ migrations.ts # Schema definitions
24โ โ โโโ queries.ts # DB query functions
52
53- **Backend**: Hono (TypeScript)
54- **Database**: SQLite
55- **Frontend**: React, TailwindCSS
56- **Authentication**: JWT
6
7- `index.ts` - Main entry point for the HTTP val
8- `database/` - SQLite database setup and queries
9 - `migrations.ts` - Database schema definition
10 - `queries.ts` - Database query functions
11- `routes/` - API route handlers
12 - `api.ts` - API endpoints for image management
21- `DELETE /api/images/:id` - Delete an image
22
23## Database Schema
24
25The application uses SQLite to store image data with the following schema:
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { runMigrations } from "./database/migrations.ts";
3import apiRoutes from "./routes/api.ts";
4import staticRoutes from "./routes/static.ts";
13});
14
15// Run database migrations on startup
16// Comment this out after first run if you want faster cold starts
17app.use("*", async (c, next) => {
138 const mesh = new THREE.Mesh(geometry, material);
139
140 // Set position from database or calculate new position
141 mesh.position.set(
142 image.position_x,
8 deleteImage,
9 NewImage
10} from "../database/queries.ts";
11
12const api = new Hono();
7 getAvailableTopics,
8 searchFacts
9} from "../database/queries.ts";
10import { sendWhatsAppMessage, sendWhatsAppMedia } from "../services/whatsappService.ts";
11
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { addFact, addAudio, addVideo, deleteFact, deleteAudio, deleteVideo } from "../content/contentManager.ts";
3import { getAvailableTopics } from "../database/queries.ts";
4import { ApiResponse } from "../../shared/types.ts";
5
14
15- `/backend/index.ts` - Main HTTP endpoint for WhatsApp webhook
16- `/backend/database/` - SQLite database setup and queries
17- `/backend/handlers/` - Message handling logic
18- `/backend/content/` - Content management for facts, audio, and video