51 `);
52
53 console.log("Database migrations completed successfully");
54}
14```
15โโโ backend/
16โ โโโ database/
17โ โ โโโ migrations.ts # Schema definitions
18โ โ โโโ queries.ts # DB query functions
46- **Frontend**: React, TailwindCSS
47- **Backend**: Deno, Hono (API framework)
48- **Database**: SQLite
49- **Authentication**: JWT-based authentication
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 authRoutes from "./routes/auth.ts";
6import userRoutes from "./routes/users.ts";
8import notificationRoutes from "./routes/notifications.ts";
9
10// Initialize the database
11await initializeDatabase();
12
13const app = new Hono();
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { getNotificationsByUser, getUnreadNotificationCount, markNotificationAsRead, markAllNotificationsAsRead, deleteNotification } from "../database/notifications.ts";
3import { verifyToken } from "../auth.ts";
4import { ApiResponse, Notification } from "../../shared/types.ts";
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { getAllTasks, getTaskById, getTasksByUser, createTask, updateTask, deleteTask } from "../database/tasks.ts";
3import { createNotification } from "../database/notifications.ts";
4import { getUserById } from "../database/users.ts";
5import { verifyToken } from "../auth.ts";
6import { ApiResponse, Task, CreateTaskRequest, UpdateTaskRequest } from "../../shared/types.ts";
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { getAllUsers, getUserById, updateUser, deleteUser, updateUserPassword } from "../database/users.ts";
3import { verifyToken } from "../auth.ts";
4import { ApiResponse, User } from "../../shared/types.ts";
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { authenticateUser, generateToken, hashPassword } from "../auth.ts";
3import { createUser, getUserByUsername } from "../database/users.ts";
4import { ApiResponse, AuthResponse, UserCredentials } from "../../shared/types.ts";
5
1import { User } from "../shared/types.ts";
2import { verifyUserCredentials } from "./database/users.ts";
3
4// Simple JWT implementation for Val Town
6export const NOTIFICATIONS_TABLE = 'task_app_notifications';
7
8export async function initializeDatabase() {
9 // Create users table
10 await sqlite.execute(`
14```
15โโโ backend/
16โ โโโ database/ # SQLite database setup and queries
17โ โโโ routes/ # API routes for tasks, users, etc.
18โ โโโ index.ts # Main entry point for the backend