2import { cors } from "https://esm.sh/hono@3.11.7/middleware";
3import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
4import { initializeDatabase } from "./database/schema.ts";
5import pestDiseaseRoutes from "./routes/pestDiseases.ts";
6import analysisRoutes from "./routes/analysis.ts";
7import userRoutes from "./routes/users.ts";
8
9// Initialize the database
10await initializeDatabase();
11
12// Create the Hono app
15```
16βββ backend/
17β βββ database/
18β β βββ migrations.ts # DefiniΓ§Γ΅es de esquema
19β β βββ queries.ts # FunΓ§Γ΅es de consulta ao banco de dados
8- Supports both general attendee registration and speaker applications
9- Collects attendee interests and preferences for event content
10- SQLite database storage for all submissions
11- Email notifications for new submissions
12- Mobile-responsive design
61- Copy the entire list to clipboard with one click
62
63## Database Schema
64
65```sql
32- Includes error catching for better debugging
33- Responsive design works on mobile and desktop
34- No database required - quotes are stored in the code
35
36## Customization
8 getCropRecordsByFarmId,
9 getPestDiseaseRecordsByCropRecordId
10} from "../database/queries.ts";
11import type { ApiResponse, User, Farm, CropRecord } from "../../shared/types.ts";
12
4 createPestDiseaseRecord,
5 getPestDiseaseById
6} from "../database/queries.ts";
7import { blob } from "https://esm.town/v/std/blob";
8import type { ApiResponse, ImageAnalysisResponse } from "../../shared/types.ts";
4 getPestDiseaseById,
5 searchPestDiseases
6} from "../database/queries.ts";
7import type { ApiResponse, PestDisease } from "../../shared/types.ts";
8
1import type { ImageAnalysisResponse } from "../../shared/types.ts";
2import { getPestDiseases, getTreatmentsByPestDiseaseId } from "../database/queries.ts";
3
4interface OpenRouterResponse {
80 const aiResponse = data.choices[0]?.message.content || "";
81
82 // Get all pest/disease data from the database
83 const allPestDiseases = await getPestDiseases();
84
11};
12
13export async function initializeDatabase() {
14 // Create pests and diseases table
15 await sqlite.execute(`
15```
16βββ backend/
17β βββ database/ # Database schema and queries
18β βββ routes/ # API route handlers
19β βββ index.ts # Main API entry point