Small MERN + LLM demo that generates a project spec, scaffolds file manifests, and bundles a zip for download.
- Clone or create project files.
- In
backendfolder:npm installthennpm run dev(ornpm start). - In
frontendfolder:npm installthennpm start. - Open frontend at
http://localhost:3000— pick skills and click Generate. - Generate a couple files, click Download, unzip and run the backend
npm install && npm startthen checkhttp://localhost:4000/health.
- Open UI, click Generate → shows spec and manifest.
- Generate at least one file and preview it.
- Download zip and run backend health endpoint.
- Fill in
backend/src/llm/adapters.jswith your provider calls (Cursor, Lovable, ChatGPT proxy). - Keep model responses to valid JSON when generating project spec. For file content generation, instruct model to return only file content.
- Make sure MongoDB is running locally or set
MONGO_URIenvironment variable.
Create a backend/.env file with the following variables:
# MongoDB Connection
# Option 1: MongoDB Atlas (Cloud) - Recommended
MONGO_URI=mongodb+srv://username:password@cluster0.xxxxx.mongodb.net/adaptive-generator?retryWrites=true&w=majority
# Option 2: Local MongoDB
# MONGO_URI=mongodb://127.0.0.1:27017/adaptive-generator
# Server Port
PORT=4000
# Gemini API Key (required)
GEMINI_API_KEY=your_gemini_api_key_here
# Optional: Gemini model selection
# Available models: gemini-1.5-flash (default, faster), gemini-1.5-pro (higher quality)
# GEMINI_MODEL=gemini-1.5-flash-
Create a MongoDB Atlas Account
- Go to mongodb.com/cloud/atlas
- Create a free cluster (M0)
-
Get Your Connection String
- In Atlas Dashboard, click "Connect" on your cluster
- Choose "Connect your application"
- Copy the connection string (starts with
mongodb+srv://) - Replace
<password>with your database user password - Replace
<dbname>withadaptive-generator(or your preferred database name)
-
Configure Network Access
- Go to Atlas Dashboard → Network Access
- Click "Add IP Address"
- Add your current IP or
0.0.0.0/0for development (less secure)
-
Create Database User
- Go to Atlas Dashboard → Database Access
- Create a new user with username and password
- Grant "Atlas Admin" or "Read and write to any database" role
-
Add Connection String to .env
- Paste your connection string into
backend/.envasMONGO_URI
- Paste your connection string into
If using local MongoDB instead:
- Install MongoDB locally
- Start MongoDB service
- Use:
MONGO_URI=mongodb://127.0.0.1:27017/adaptive-generator
The LLM adapter is now implemented and uses Google Gemini API. Make sure to set your GEMINI_API_KEY in the .env file.