- Node.js, Express
- TypeScript, run directly via
tsx - PostgreSQL (Neon), Drizzle ORM
- Groq API for prompt generation
- Pollinations API for image generation
- Static HTML and vanilla JavaScript frontend, served via
express.static
POST /generate- body:{ productName, productDesc }. Returns{ id, status }.GET /jobs/:id- returns the job record, including status and result URL when completed.GET /jobs- returns all jobs.GET /health- basic health check.
cd backend
pnpm installSet the following environment variables (a .env file works locally):
DATABASE_URL=your_neon_postgres_url
GROQ_API_KEY=your_groq_api_key
PORT=3000
Run the database migration:
pnpm drizzle-kit migrateStart the server:
pnpm startThe app will be available at http://localhost:3000.