17## Project Structure
18
19- `/backend` - API routes, database, and story generation
20- `/frontend` - UI components, emoji selectors, and gallery
21- `/shared` - Shared types and utilities
22
23## Database
24
25The application uses SQLite for data storage with the following table:
25}
26
27// Initialize the database
28export async function initializeDatabase() {
29 await createStoriesTable();
30}
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { saveStory, getAllStories, getStoryById, deleteStory } from "../database/queries.ts";
3import { generateStory, generateImagePrompt } from "../services/storyGenerator.ts";
4import { StoryOptions, Story } from "../../shared/types.ts";
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { serveFile, readFile } from "https://esm.town/v/std/utils@85-main/index.ts";
3import { initializeDatabase } from "./database/migrations.ts";
4import storiesRoutes from "./routes/stories.ts";
5import { parseProject } from "https://esm.town/v/std/utils@85-main/index.ts";
13});
14
15// Initialize the database
16app.use("*", async (c, next) => {
17 await initializeDatabase();
18 await next();
19});
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { serveFile, readFile } from "https://esm.town/v/std/utils@85-main/index.ts";
3import { initializeDatabase } from "./database/migrations.ts";
4import storiesRoutes from "./routes/stories.ts";
5import { parseProject } from "https://esm.town/v/std/utils@85-main/index.ts";
13});
14
15// Initialize the database
16app.use("*", async (c, next) => {
17 await initializeDatabase();
18 await next();
19});
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { saveStory, getAllStories, getStoryById, deleteStory } from "../database/queries.ts";
3import { generateStory, generateImagePrompt } from "../services/storyGenerator.ts";
4import { StoryOptions, Story } from "../../shared/types.ts";
25}
26
27// Initialize the database
28export async function initializeDatabase() {
29 await createStoriesTable();
30}
17## Project Structure
18
19- `/backend` - API routes, database, and story generation
20- `/frontend` - UI components, emoji selectors, and gallery
21- `/shared` - Shared types and utilities
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { cors } from "https://esm.sh/@hono/cors@0.0.6";
3import { getAllChatMessages, createChatMessage } from "../database/queries.ts";
4import type { ChatMessageFormData } from "../../shared/types.ts";
5
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { cors } from "https://esm.sh/@hono/cors@0.0.6";
3import { getAllJobPostings, getJobPostingById, createJobPosting } from "../database/queries.ts";
4import type { JobPostingFormData } from "../../shared/types.ts";
5