AI-Assisted Content Studio: Project Story
Tagline
Create smarter. Publish faster.
π₯ What Inspired Me
I wanted to create a one-click flow from idea β publishable social asset.
The vision was a workspace where a creator types a single prompt and instantly gets:
- A headline
- Post copy
- Hashtags
- A visual concept or generated image
I was also motivated by curiosity:
- To experiment with the latest generative models (text + image).
- To learn practical integration patterns: safe API usage, error handling, and structured output parsing.
- To explore the βhiveβ metaphor: many small, iterative outputs from one prompt, reusable across social channels.
βοΈ How I Built It
Tech Stack
- Frontend: Next.js 14 (App Router), TypeScript, React
- Styling: Tailwind CSS (via
globals.css) - Backend: Server API routes with secure fetch calls
- Generative APIs: Googleβs Gemini (text + image)
Architecture
Client (
ContentGenerator.tsx)- Prompt input
- Choose content type (text, image, video concept)
- Calls
POST /api/gemini - Renders results inline (text or images as data URLs/provider URLs)
- Prompt input
Server API Routes
route.tsβ main generation endpoint (branches into text or image, parses structured output).route.tsβ models-list proxy (avoids hardcoding model names).route.tsβ quick diagnostics/test route.
Configuration
- Environment-driven with
.env.local:
GEMINI_API_KEY=... GEMINI_MODEL=... GEMINI_IMAGE_MODEL=...
- Environment-driven with
π οΈ Development Process
- Start with a demo generator and simple local UI.
- Wire server API route β read
GEMINI_API_KEYfrom env β forward structured requests. - Add image branch:
- Call
https://generativelanguage.googleapis.com/v1/images:generate - Normalize responses (handle base64 variants or URLs).
- Call
- Add model discovery route to dynamically list available models.
- Iterate on prompt templates with a
createSystemPromptfunction to ensure JSON-like structured outputs. - Build in logging and graceful fallbacks (e.g., fallback to text concepts if images fail).
- Keep secrets in
.env.local, not source. - Fix OAuth issues by removing NextAuth and adding a simple demo login.
π§ Challenges I Faced
Inconsistent API responses:
- Images returned in multiple formats (
b64_json,imageBase64,data[0].url). - Needed normalization logic to avoid breakage.
- Images returned in multiple formats (
Model access variability:
- The same API key gave access to different subsets of models.
- Solved via
list-modelsproxy instead of hardcoding.
- The same API key gave access to different subsets of models.
Fallback design:
- If image generation failed β fallback to text-based concept.
- Ensured the app never βbroke silently.β
- If image generation failed β fallback to text-based concept.
OAuth complexity:
- Redirect URI issues during dev (port changes).
- Solution: stick to demo login flow for simplicity.
- Redirect URI issues during dev (port changes).
π What I Learned
- Model discovery is essential: never assume model names.
- Normalize everything: handle multiple data formats consistently.
- Defensive coding pays off: validate requests, provide defaults, log clearly.
- API experimentation requires discipline:
- Rotate/restrict keys frequently.
- Always separate demo keys from production.
- Rotate/restrict keys frequently.
β¨ Key Takeaway
This project taught me that practical AI integration is less about model power and more about resilience: handling odd responses, fallbacks, and building a UI that gives creators a frictionless experience.
In short: Generative AI may provide the spark, but solid engineering keeps the fire burning. π₯
Built With
- api
- bundled
- client
- code
- css
- css3
- html
- javascript
- languages
- markup
- react18
- routes.
- runtime
- scripts).
- tailwind
- typescript
- ui

Log in or sign up for Devpost to join the conversation.