5 getSubscriptionByUserId,
6 updateSubscriptionStatus
7} from '../database/queries.ts';
8import { ApiResponse, Subscription, SubscriptionPlan } from '../../shared/types.ts';
9
9 deleteClip,
10 getVideoById
11} from '../database/queries.ts';
12import { generateClip, exportClip, publishToSocialMedia } from '../services/clip-service.ts';
13import { ApiResponse, Clip } from '../../shared/types.ts';
8 updateVideoStatus,
9 deleteVideo
10} from '../database/queries.ts';
11import { analyzeVideo } from '../services/ai-service.ts';
12import { ApiResponse, Video, VideoAnalysisRequest } from '../../shared/types.ts';
7 getUserById,
8 updateUserLastLogin
9} from '../database/queries.ts';
10import {
11 LoginRequest,
8
9/**
10 * Run all migrations to set up the database schema
11 */
12export async function runMigrations() {
16```
17โโโ backend/
18โ โโโ database/ # Database schema and queries
19โ โโโ routes/ # API endpoints
20โ โโโ services/ # Business logic and external API integrations
35- **Frontend**: React, TailwindCSS
36- **Backend**: Hono (API framework)
37- **Database**: SQLite
38- **AI Services**: OpenAI for content analysis, external video processing APIs
39- **Authentication**: JWT-based auth system
1/**
2 * Database seed for the eCommerce platform
3 */
4import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
9
10/**
11 * Seed the database with initial data
12 */
13export async function seedDatabase() {
14 // Check if we already have categories
15 const existingCategories = await sqlite.execute(`SELECT COUNT(*) as count FROM ${TABLES.CATEGORIES}`);
16 if (existingCategories.rows[0].count > 0) {
17 console.log('Database already seeded, skipping...');
18 return;
19 }
20
21 console.log('Seeding database...');
22
23 // Seed admin user
243 }
244
245 console.log('Database seeded successfully');
246}
5import { cors } from "https://esm.sh/hono@3.11.7/middleware";
6import { readFile, serveFile } from "https://esm.town/v/std/utils/index.ts";
7import { initializeDatabase } from "./database/schema.ts";
8import authRoutes from "./routes/auth.ts";
9import productRoutes from "./routes/products.ts";
13import addressRoutes from "./routes/addresses.ts";
14
15// Initialize database
16await initializeDatabase();
17
18// Create Hono app
7 getAddressById,
8 createAddress
9} from "../database/queries.ts";
10import { getUserFromRequest } from "../services/auth.ts";
11import { ApiResponse, Address } from "../../shared/types.ts";
9 createCategory,
10 getProducts
11} from "../database/queries.ts";
12import { getUserFromRequest } from "../services/auth.ts";
13import { ApiResponse, Category, Product } from "../../shared/types.ts";