Fix AI Session Generator Backend
Budget: $30 – $250 USD
My Node.js / Express site on Hostinger is throwing a 500 error whenever the frontend calls POST /hcgi/api/sessions/generate-session. The most pressing issue is integrating the OpenAI API so the endpoint can actually build text-based learning content on demand.
Here’s what I need done:
• Analyse the current controller for /generate-session, trace the 500 stack trace, and patch whatever is blocking a successful response.
• Wire in an OpenAI completion (or chat) request so each call returns coherent, text-only learning material.
• Make sure the frontend form already on the page submits correctly, hits the endpoint, and surfaces the AI-generated lesson back to the user.
• Push the working code to my Hostinger VPS, run a live test, and leave the environment in a deploy-ready state.
Acceptance criteria
1. A call to /hcgi/api/sessions/generate-session returns HTTP 200 with well-structured text lessons.
2. Frontend form shows the lesson instantly without manual refresh.
3. No uncaught errors in server logs after 24 hours on Hostinger.
Stack in play: Node.js 18, Express, OpenAI SDK, Git, Hostinger hPanel.
If this sounds straightforward for you, let’s get it fixed and live.
Here’s what I need done:
• Analyse the current controller for /generate-session, trace the 500 stack trace, and patch whatever is blocking a successful response.
• Wire in an OpenAI completion (or chat) request so each call returns coherent, text-only learning material.
• Make sure the frontend form already on the page submits correctly, hits the endpoint, and surfaces the AI-generated lesson back to the user.
• Push the working code to my Hostinger VPS, run a live test, and leave the environment in a deploy-ready state.
Acceptance criteria
1. A call to /hcgi/api/sessions/generate-session returns HTTP 200 with well-structured text lessons.
2. Frontend form shows the lesson instantly without manual refresh.
3. No uncaught errors in server logs after 24 hours on Hostinger.
Stack in play: Node.js 18, Express, OpenAI SDK, Git, Hostinger hPanel.
If this sounds straightforward for you, let’s get it fixed and live.