AgenteCalendarioConteudoREADME.md4 matches
67- `index.ts` - Main entry point for the API
8- `database/` - Database schema and queries
9- `schema.ts` - Database table definitions
10- `queries.ts` - Database operations
11- `routes/` - API route handlers
12- `auth.ts` - Authentication endpoints
33- `GEMINI_API_KEY` - Google Gemini API key for content generation
3435## Database
3637The application uses SQLite for data storage with the following tables:
AgenteCalendarioConteudoanalysis.ts2 matches
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { requireAuth } from "./auth.ts";
3import { createAnalysis, getAnalysisById, getAnalysesByLeadId } from "../database/queries.ts";
4import { success, error } from "../../shared/utils.ts";
5import { AnalysisInput, ContentCalendar } from "../../shared/types.ts";
83}
84
85// Store the analysis in the database
86const analysisRecord = await createAnalysis(
87leadId,
AgenteCalendarioConteudoindex.ts3 matches
2import { cors } from "https://esm.sh/hono@3.11.7/cors";
3import { logger } from "https://esm.sh/hono@3.11.7/logger";
4import { initializeDatabase } from "./database/schema.ts";
5import auth from "./routes/auth.ts";
6import analysis from "./routes/analysis.ts";
7import { openApiSpec, getSwaggerUI } from "./swagger.ts";
89// Initialize the database
10await initializeDatabase();
1112// Create the main app
AgenteCalendarioConteudoschema.ts2 matches
78/**
9* Initialize the database schema
10*/
11export async function initializeDatabase() {
12// Create leads table
13await sqlite.execute(`
2627- Hono.js for API routing
28- SQLite for database storage
29- Google Gemini AI for content analysis
30- Swagger UI for API documentation
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { runMigrations } from "./database/migrations.ts";
3import authRoutes, { authMiddleware } from "./routes/auth.ts";
4import projectRoutes from "./routes/projects.ts";
9toggleTaskCompletion,
10deleteTask
11} from "../database/queries.ts";
12import { formatApiResponse } from "../../shared/utils.ts";
13import { CreateTaskInput, UpdateTaskInput } from "../../shared/types.ts";
41
42// Criar tarefa
43// Note: You'll need to update your database queries to work with email instead of userId
44const task = await createTask({
45...body,
63
64// Buscar tarefas do usuário
65// Note: You'll need to update your database queries to work with email instead of userId
66const tasks = await getTasksByUserId(1); // Temporary fix
67
90
91// Buscar tarefas do projeto
92// Note: You'll need to update your database queries to work with email instead of userId
93const tasks = await getTasksByProjectId(projectId, 1); // Temporary fix
94
117
118// Buscar tarefa
119// Note: You'll need to update your database queries to work with email instead of userId
120const task = await getTaskById(id, 1); // Temporary fix
121
152
153// Verificar se a tarefa existe
154// Note: You'll need to update your database queries to work with email instead of userId
155const existingTask = await getTaskById(id, 1); // Temporary fix
156
163
164// Atualizar tarefa
165// Note: You'll need to update your database queries to work with email instead of userId
166const updatedTask = await updateTask(id, 1, body); // Temporary fix
167
190
191// Verificar se a tarefa existe
192// Note: You'll need to update your database queries to work with email instead of userId
193const existingTask = await getTaskById(id, 1); // Temporary fix
194
201
202// Alternar status de conclusão
203// Note: You'll need to update your database queries to work with email instead of userId
204const updatedTask = await toggleTaskCompletion(id, 1); // Temporary fix
205
228
229// Verificar se a tarefa existe
230// Note: You'll need to update your database queries to work with email instead of userId
231const existingTask = await getTaskById(id, 1); // Temporary fix
232
239
240// Excluir tarefa
241// Note: You'll need to update your database queries to work with email instead of userId
242const deleted = await deleteTask(id, 1); // Temporary fix
243
TastkItprojects.ts9 matches
7updateProject,
8deleteProject
9} from "../database/queries.ts";
10import { formatApiResponse } from "../../shared/utils.ts";
11import { CreateProjectInput, UpdateProjectInput } from "../../shared/types.ts";
32
33// Criar projeto
34// Note: You'll need to update your database queries to work with email instead of userId
35const project = await createProject({
36...body,
37userId: 1, // Temporary fix - you'll need to update your database schema
38});
39
54
55// Buscar projetos do usuário
56// Note: You'll need to update your database queries to work with email instead of userId
57const projects = await getProjectsByUserId(1); // Temporary fix
58
81
82// Buscar projeto
83// Note: You'll need to update your database queries to work with email instead of userId
84const project = await getProjectById(id, 1); // Temporary fix
85
116
117// Verificar se o projeto existe
118// Note: You'll need to update your database queries to work with email instead of userId
119const existingProject = await getProjectById(id, 1); // Temporary fix
120
127
128// Atualizar projeto
129// Note: You'll need to update your database queries to work with email instead of userId
130const updatedProject = await updateProject(
131id,
159
160// Verificar se o projeto existe
161// Note: You'll need to update your database queries to work with email instead of userId
162const existingProject = await getProjectById(id, 1); // Temporary fix
163
170
171// Excluir projeto
172// Note: You'll need to update your database queries to work with email instead of userId
173const deleted = await deleteProject(id, 1); // Temporary fix
174
3import { jwt } from "https://esm.sh/hono@3.11.7/jwt";
4import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
5import { runMigrations } from "./database/migrations.ts";
6import authRoutes from "./routes/auth.ts";
7import userRoutes from "./routes/users.ts";
9import applicationRoutes from "./routes/applications.ts";
1011// Initialize database
12await runMigrations();
13
project1applications.ts1 match
7updateApplicationStatus,
8hasApplied
9} from "../database/queries.ts";
10import { ApiResponse, Application } from "../../shared/types.ts";
11