environment:
frontend:
node: 22.21.1
npm: 11.6.3
backend:
python 3.12
preparation:
frontend:
run "npm install" for download all dependencies
run "npm run dev" for start frontend server
backend:
run "pip install -r requirements.txt" for download all dependencies
A brief description of what this project does and its main features.
AutoMaker is an intelligent code generation platform that:
- Accepts UI sketch images and text descriptions
- Uses GPT to generate complete Node.js + Express + EJS full-stack applications
- Provides live preview of generated code directly in the browser
- Supports multi-page preview (index, login, register, etc.)
- Offers responsive preview modes (Desktop, Tablet, Mobile)
Frontend:
- Node.js 22.21.1
- npm 11.6.3
- [Add other frontend technologies]
Backend:
- [Add backend technologies]
Middleware:
- [Add middleware technologies]
Before running this project, ensure you have the following installed:
- Node.js 22.21.1 or higher
- npm 11.6.3 or higher
- [Add other prerequisites]
Follow these steps to get the project running locally:
-
Install Dependencies
npm install
-
Start Development Server
npm run dev
The application will be available at
http://localhost:3000(or the port specified in your configuration)
<<<<<<< HEAD
- Install Dependencies =======
- Navigate to backend directory
c834981c356627ff4cac024803ac6eb54b27d179
cd backend- Create virtual environment (recommended)
python -m venv venv
- Activate virtual environment
# Windows .\venv\Scripts\activate # macOS/Linux source venv/bin/activate
- Install Dependencies
pip install -r requirements.txt
- Configure Environment Variables
Create a
.envfile in thebackenddirectory:OPENAI_API_KEY=your_openai_api_key_here
- Start Backend Server
python server.py
<<<<<<< HEAD
The backend API will be available at http://localhost:8080
c834981c356627ff4cac024803ac6eb54b27d179
AutoMaker/
โโโ frontend/ # Next.js frontend application
โ โโโ app/ # Next.js app router
โ โโโ components/ # React components
โ โ โโโ code-generator.tsx # Main code generation UI
โ โ โโโ live-preview.tsx # Live preview component
โ โ โโโ code-preview.tsx # Code preview with EJS support
โ โ โโโ ui/ # shadcn/ui components
โ โโโ lib/
โ โ โโโ ejs-renderer.ts # Browser-side EJS renderer
โ โโโ package.json
โโโ backend/ # FastAPI backend application
โ โโโ app/
โ โ โโโ agent/
โ โ โโโ chains/
โ โ โโโ frontend_generation.py # AI code generation logic
โ โโโ server.py # FastAPI server entry point
โ โโโ requirements.txt
โ โโโ .env # Environment variables (create this)
โโโ README.md
npm run dev- Start development servernpm run build- Build for productionnpm run test- Run test suitenpm run lint- Run linting
(Add backend scripts here)
- Feature 1
- Feature 2
- Feature 3
Create a .env file in the root directory with the following variables:
# Frontend Environment Variables
VITE_API_URL=http://localhost:3001
VITE_APP_TITLE=Your App Name
# Backend Environment Variables
PORT=3001
DATABASE_URL=your_database_urlStripe CLI๏ผfor local webhook test๏ผ
- Visit https://stripe.com
- Click "Sign Up" to register a new account
- Enter your email and password
- Complete the email verification
- Choose "Standard" (recommended) or "Express" account type
- Log in to the Stripe Dashboard
- In the left menu, find Developers โ API keys
- You will see two keys:
- Publishable Key (pk_test_xxxxx) - visible on the front end, used for Stripe.js - Secret Key (sk_test_xxxxx) - confidential, only used on the back end
- Copy the Secret Key (starting with
sk_test_), this is yourSTRIPE_SECRET_KEY
example๏ผsk_test_yours
This step is important because you need a Price ID to enable the subscription feature.
-
In the Stripe Dashboard, find Products (or Catalog โ Products)
-
Click + Add Product
-
Fill in the following information:
-
Name:
Pro Plan(or a name you prefer) -
Description:
Monthly Pro subscription with unlimited features -
Image: Optional, upload a logo or product image
- Click Save product
-
Go to the product details page you just created.
-
Scroll down to the Pricing section.
-
Click Add another price
-
Fill in the price information:
-
Billing period: Select Monthly (or Yearly, etc.)
-
Price: Enter the price, for example,
9.99USD -
Recurring: Make sure "Recurring" is checked.
-
Click Save price
-
You will see a Price ID** (starting with
price_), copy this ID
Example: price_yours
AutoMaker will automatically generate an application for you that includes payment functionality. The generated files are located in the backend/output/ directory.
cd backend/outputnpm install
- Copy the example file:
# Windows
copy .env.example .env
# macOS/Linux
cp .env.example .env
- Edit the [.env] file and enter your Stripe key:
# ไป Stripe Dashboard ่ทๅ็ Secret Key
STRIPE_SECRET_KEY=sk_test_your
# ไป Products ้กต้ข่ทๅ็ Price ID
STRIPE_PRICE_ID=price_your
# Webhook Secret๏ผๆๆถ็็ฉบ๏ผๅ้ข้
็ฝฎ๏ผ
STRIPE_WEBHOOK_SECRET=whsec_your
# ๆฏไปๆๅ/ๅๆถ็่ทณ่ฝฌ URL
STRIPE_SUCCESS_URL=http://localhost:3001/success?session_id={CHECKOUT_SESSION_ID}
STRIPE_CANCEL_URL=http://localhost:3001/subscribe
# Session ๅ ๅฏๅฏ้ฅ๏ผไฟฎๆนๆ้ๆบๅญ็ฌฆไธฒ๏ผ
SESSION_SECRET=my_super_secret_key_change_in_production_12345
Important:
-
{CHECKOUT_SESSION_ID}is a placeholder; Stripe will automatically replace it, keep it as is -
Change
localhost:3000to your actual port (if it's not 3000) -
[SESSION_SECRET](vscode-file://vscode-app/d:/Program Files/Microsoft VS Code/resources/app/out/vs/code/electron-browser/workbench/workbench.html) can be any length string used for encryption. session
- Save file
To avoid port conflicts, set a different port:
# Windows
set PORT=3001 && node server.js
# macOS/Linux
PORT=3001 node server.js