A REST API built with Hono that provides job listing management and a public chat room functionality.
āāā backend/
ā āāā index.ts # Main API server (HTTP endpoint)
ā āāā database/
ā āāā migrations.ts # Database schema definitions
ā āāā queries.ts # Database query functions
āāā frontend/
ā āāā index.html # Web interface
ā āāā app.js # Frontend JavaScript
āāā README.md
POST /api/jobs - Create a new job listing
{ "title": "Software Engineer", "company": "Tech Corp", "description": "We're looking for...", "location": "Remote", // optional "salary": "$80k-120k", // optional "contactEmail": "hr@techcorp.com" }
GET /api/jobs - Get all job listings
GET /api/jobs/:id - Get a specific job by ID
POST /api/chat - Post a message to the chat
{ "username": "john_doe", "message": "Hello everyone!" }
GET /api/chat - Get recent chat messages
?limit=N (default: 50)curl -X POST /api/jobs \ -H "Content-Type: application/json" \ -d '{ "title": "Frontend Developer", "company": "StartupXYZ", "description": "Looking for a React developer...", "location": "San Francisco", "salary": "$90k-130k", "contactEmail": "jobs@startupxyz.com" }'
curl /api/jobs
curl -X POST /api/chat \ -H "Content-Type: application/json" \ -d '{ "username": "developer123", "message": "Anyone hiring React developers?" }'
curl /api/chat?limit=20
id - Auto-incrementing primary keytitle - Job title (required)company - Company name (required)description - Job description (required)location - Job location (optional)salary - Salary information (optional)contact_email - Contact email (required)created_at - Timestampupdated_at - Timestampid - Auto-incrementing primary keyusername - Username (required, max 50 chars)message - Message content (required, max 500 chars)created_at - TimestampThe API is built using:
The API returns appropriate HTTP status codes:
200 - Success201 - Created400 - Bad Request (validation errors)404 - Not Found500 - Internal Server Error