4import JobForm from './JobForm.tsx';
5
6export default function JobBoard() {
7 const [jobs, setJobs] = useState<Job[]>([]);
8 const [loading, setLoading] = useState(true);
6type Tab = 'jobs' | 'chat';
7
8export default function App() {
9 const [activeTab, setActiveTab] = useState<Tab>('jobs');
10
4
5// Job queries
6export async function getAllJobs(): Promise<Job[]> {
7 const result = await sqlite.execute(`
8 SELECT * FROM ${JOBS_TABLE}
24}
25
26export async function createJob(jobData: CreateJobRequest): Promise<Job> {
27 const result = await sqlite.execute(`
28 INSERT INTO ${JOBS_TABLE} (title, company, location, description, salary, type, remote, contact_email)
59}
60
61export async function deleteJob(id: number): Promise<boolean> {
62 const result = await sqlite.execute(`
63 DELETE FROM ${JOBS_TABLE} WHERE id = ?
68
69// Chat queries
70export async function getChatMessages(limit: number = 50): Promise<ChatMessage[]> {
71 const result = await sqlite.execute(`
72 SELECT * FROM ${CHAT_MESSAGES_TABLE}
83}
84
85export async function createChatMessage(messageData: CreateMessageRequest): Promise<ChatMessage> {
86 const result = await sqlite.execute(`
87 INSERT INTO ${CHAT_MESSAGES_TABLE} (username, message)
5export const CHAT_MESSAGES_TABLE = 'chat_messages_v1';
6
7export async function runMigrations() {
8 // Create jobs table
9 await sqlite.execute(`
15โ โโโ database/
16โ โ โโโ migrations.ts # Database schema setup
17โ โ โโโ queries.ts # Database query functions
18โ โโโ routes/
19โ โ โโโ jobs.ts # Job posting API routes
3import type { ChatMessage, CreateChatRequest } from "../../shared/types.ts";
4
5export default function ChatRoom() {
6 const [messages, setMessages] = useState<ChatMessage[]>([]);
7 const [loading, setLoading] = useState(true);
3import type { JobPost, CreateJobRequest } from "../../shared/types.ts";
4
5export default function JobBoard() {
6 const [jobs, setJobs] = useState<JobPost[]>([]);
7 const [showForm, setShowForm] = useState(false);
4import ChatRoom from "./ChatRoom.tsx";
5
6export default function App() {
7 const [activeTab, setActiveTab] = useState<'jobs' | 'chat'>('jobs');
8
4
5// Job queries
6export async function getAllJobs(): Promise<JobPost[]> {
7 const result = await sqlite.execute(`
8 SELECT id, title, description, company, location, poster_name, created_at
13}
14
15export async function createJob(job: CreateJobRequest): Promise<JobPost> {
16 const result = await sqlite.execute(`
17 INSERT INTO ${JOBS_TABLE} (title, description, company, location, poster_name)
31
32// Chat queries
33export async function getChatMessages(limit: number = 50): Promise<ChatMessage[]> {
34 const result = await sqlite.execute(`
35 SELECT id, name, message, created_at
43}
44
45export async function createChatMessage(chat: CreateChatRequest): Promise<ChatMessage> {
46 const result = await sqlite.execute(`
47 INSERT INTO ${CHAT_TABLE} (name, message)
4const CHAT_TABLE = 'chat_messages_v1';
5
6export async function runMigrations() {
7 // Create jobs table
8 await sqlite.execute(`CREATE TABLE IF NOT EXISTS ${JOBS_TABLE} (
A helper function to build a file's email
Simple functional CSS library for Val Town
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.