Skip to content

fix: ai-powered-hackathon-idea-generator-service (closes #5)#86

Merged
ayomideadeniran merged 2 commits intoStellarDevHub:mainfrom
AYo101o:fix/ai-powered-hackathon-idea-generator-service
Mar 25, 2026
Merged

fix: ai-powered-hackathon-idea-generator-service (closes #5)#86
ayomideadeniran merged 2 commits intoStellarDevHub:mainfrom
AYo101o:fix/ai-powered-hackathon-idea-generator-service

Conversation

@AYo101o
Copy link
Copy Markdown
Contributor

@AYo101o AYo101o commented Mar 25, 2026

  1. Dependency Installation
    Installed the openai SDK to interact with OpenAI's Chat Completion API.

  2. Generator Service
    Created generator.service.ts
    .
    Implemented
    GeneratorService
    which uses the gpt-4o-mini model with JSON response format to ensure structured output.
    The service generates a ProjectIdea object containing a title, description, key features, recommended tech, and difficulty.

  3. API Routes
    Created generator.routes.ts
    .
    Exposed a POST /api/generator/generate endpoint.
    Registered the route in the main index.ts
    .

  4. Testing & Verification
    Created generator.test.ts
    .
    Implemented integration tests with mocked OpenAI responses using Jest's ESM-compatible mocking (unstable_mockModule).
    Resolved various ESM/TypeScript configuration issues in the test runner to ensure a stable testing environment.
    Validation Results
    Automated Tests
    The test suite passed successfully:

PASS tests/generator.test.ts Generator API Integration Tests POST /api/generator/generate √ should generate a project idea with valid input (136 ms) √ should return 400 if required fields are missing (13 ms) Test Suites: 1 passed, 1 total Tests: 2 passed, 2 total

How to Test Manually
You can test the endpoint using curl:

bash curl -X POST http://localhost:8080/api/generator/generate \ -H "Content-Type: application/json" \ -d '{ "theme": "Decentralized Finance", "techStack": ["React", "Solidity", "Ethers.js"], "difficulty": "Intermediate" }'

closes #5

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 25, 2026

@AYo101o Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@ayomideadeniran
Copy link
Copy Markdown
Contributor

Pr under review or i will give feedback or simply merge Pr.

@ayomideadeniran ayomideadeniran merged commit f1b44fb into StellarDevHub:main Mar 25, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Backend] AI-Powered Hackathon Idea Generator Service

2 participants