1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { createContactMessage, getContactMessagesByArtistId } from "../database/queries.ts";
3import type { CreateContactRequest } from "../../shared/types.ts";
4
4 createPortfolioItem,
5 getFeaturedPortfolioItems
6} from "../database/queries.ts";
7import type { CreatePortfolioItemRequest } from "../../shared/types.ts";
8
5 createArtist,
6 getArtistsByType
7} from "../database/queries.ts";
8import type { CreateArtistRequest } from "../../shared/types.ts";
9
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 { runMigrations } from "./database/migrations.ts";
4import students from "./routes/students.ts";
5import payments from "./routes/payments.ts";
12});
13
14// Initialize database on startup
15await runMigrations();
16
51 `);
52
53 console.log("Database migrations completed");
54}
16```
17โโโ backend/
18โ โโโ database/
19โ โ โโโ migrations.ts # Database schema
20โ โ โโโ queries.ts # Database operations
21โ โโโ routes/
22โ โ โโโ artists.ts # Artist CRUD operations
39
40- **Backend**: Hono (TypeScript API framework)
41- **Database**: SQLite
42- **Frontend**: React with TypeScript
43- **Styling**: TailwindCSS
56- `POST /api/contact` - Send contact message
57
58## Database Schema
59
60- **artists**: Artist profiles and information
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { createPayment, getStudentPayments } from "../database/queries.ts";
3import type { CreatePaymentRequest } from "../../shared/types.ts";
4
6 updateStudent,
7 deleteStudent
8} from "../database/queries.ts";
9import type { CreateStudentRequest, UpdateStudentRequest } from "../../shared/types.ts";
10
5
6export async function runMigrations() {
7 console.log('Running database migrations...');
8
9 // Create students table
32 `);
33
34 console.log('Database migrations completed successfully');
35}
36
15```
16โโโ backend/
17โ โโโ database/
18โ โ โโโ migrations.ts # Database schema setup
19โ โ โโโ queries.ts # Database query functions
20โ โโโ routes/
21โ โ โโโ students.ts # Student CRUD operations
34```
35
36## Database Schema
37
38### Students Table
63## Getting Started
64
651. The app will automatically set up the database on first run
662. Access the web interface at the root URL
673. Use the forms to add students and record payments
71
72- **Backend**: Hono (TypeScript API framework)
73- **Database**: SQLite
74- **Frontend**: React with TypeScript
75- **Styling**: TailwindCSS