14 const fetchMessages = async () => {
15 try {
16 const response = await fetch('/api/chat');
17 if (!response.ok) {
18 throw new Error('Failed to fetch messages');
47 setSending(true);
48 try {
49 const response = await fetch('/api/chat', {
50 method: 'POST',
51 headers: {
118 <button
119 onClick={async () => {
120 const response = await fetch('/api/clients/process-workflows', {
121 method: 'POST'
122 });
13 try {
14 setLoading(true);
15 const response = await fetch('/api/jobs');
16 if (!response.ok) {
17 throw new Error('Failed to fetch jobs');
57
58 const loadWorkflows = async () => {
59 const response = await fetch('/api/workflows');
60 const result = await response.json();
61 if (result.success) {
67
68 const loadClients = async () => {
69 const response = await fetch('/api/clients');
70 const result = await response.json();
71 if (result.success) {
77
78 const loadStats = async () => {
79 const response = await fetch('/api/clients/dashboard/stats');
80 const result = await response.json();
81 if (result.success) {
231 <button
232 onClick={async () => {
233 const response = await fetch(`/api/workflows/${workflow.id}/duplicate`, {
234 method: 'POST'
235 });
17โ โ โโโ queries.ts # Database query functions
18โ โโโ routes/
19โ โ โโโ jobs.ts # Job posting API routes
20โ โ โโโ chat.ts # Chat API routes
21โ โโโ index.ts # Main Hono server
22โโโ frontend/
32```
33
34## API Endpoints
35
36- `GET /api/jobs` - Get all job postings
37- `POST /api/jobs` - Create a new job posting
38- `GET /api/chat/messages` - Get chat messages
39- `POST /api/chat/messages` - Send a chat message
40
41## Getting Started
15await runMigrations();
16
17// API routes
18app.route("/api/jobs", jobsRouter);
19app.route("/api/chat", chatRouter);
20
21// Serve static files
27
28 try {
29 const response = await fetch('/api/jobs', {
30 method: 'POST',
31 headers: {
19 const fetchMessages = async () => {
20 try {
21 const response = await fetch('/api/chat/messages');
22 if (!response.ok) {
23 throw new Error('Failed to fetch messages');
70 };
71
72 const response = await fetch('/api/chat/messages', {
73 method: 'POST',
74 headers: {
19 try {
20 setLoading(true);
21 const response = await fetch('/api/chat/messages');
22 if (!response.ok) throw new Error('Failed to fetch messages');
23 const messagesData = await response.json();
58 };
59
60 const response = await fetch('/api/chat/messages', {
61 method: 'POST',
62 headers: {
32 };
33
34 const response = await fetch('/api/jobs', {
35 method: 'POST',
36 headers: {