oneShotCodeGen
1.0.0
一种命令行接口工具,用于生成具有React Admin Frontend和Supabase后端的全堆栈应用程序。
2025-01-27(DocuSign + Web版本):
2024-01-24(Docker&Nginx集成):
2024-01-16(编辑流):
2024-01-10(优化的AI生成管道):
2024-12-20(将令牌用法降低了70%,精度降低了80%):
# For Ubuntu
sudo apt-get update
sudo apt-get install docker.io
sudo systemctl start docker
sudo systemctl enable docker
# For macOS/Windows
Download and install Docker Desktop from https://www.docker.com/products/docker-desktop # Navigate to the project root directory
cd oneShotCodeGen
# Build the base image
docker build -t base-image -f base.Dockerfile .
# Verify the image was created
docker images | grep base-image # For Ubuntu
sudo apt-get install nginx
sudo systemctl start nginx
sudo systemctl enable nginx
# For macOS
brew install nginx
# For Windows
Download and install Nginx from http://nginx.org/en/download.html # Add your user to nginx group
sudo usermod -aG nginx $USER
# Ensure nginx config directory is writable
sudo chown -R $USER : $USER /etc/nginx/conf.d注意:除非您更改Dockerfile,否则只需构建一个基本图像。此基础图像包含所有必要的依赖关系和配置,这些依赖项和配置将用作所有生成的应用程序的基础。
pip install -r requirements.txt .env中设置您的环境变量: OPENAI_API_KEY=your_openai_api_key
SUPABASE_PROJECT_URL=your_supabase_url
SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_DB_PASSWORD=your_db_password确保设置以下权限以使Frontend运行聚合查询:
ALTER ROLE authenticator SET pgrst . db_aggregates_enabled = ' true ' ;
NOTIFY pgrst, ' reload config ' ;a. Latest version
# Just code generation
python -m src.cli create " Create an expense tracker app "
# With Docker only
python -m src.cli create " Create an expense tracker app " --docker
# With Docker and Nginx
python -m src.cli create " Create an expense tracker app " --docker --nginxb。使用旧模式(2个呼叫方法):
python -m src.cli create " Create an expense tracker app " --use-legacyc。添加自定义输出目录:
python -m src.cli create " Create an expense tracker app " --output-dir " path/to/
outputfolder " # Just code generation
python -m src.cli edit < project_dir > --description " Add a dashboard for expense
analytics "
# With Docker only
python -m src.cli edit < project_dir > --description " Add a dashboard " --docker
# With Docker and Nginx
python -m src.cli edit < project_dir > --description " Add a dashboard " --docker --nginx一个。本地开发(默认):
cd output/{output_folder_name}/frontend
npm install
npm run devb。 Docker部署:
http://localhost:<port>上提供。c。 docker with nginx:
http://localhost/{app_name}上提供。地方发展
Docker部署
带有nginx的Docker
app-generator-cli/
├── src/ # Source code for the CLI
├── output/ # Generated applications
│ └── [timestamp]/ # Timestamp-based output directory
│ ├── frontend/ # React frontend application
│ ├── use_cases.json # Use case definitions
│ ├── entities.json # Entity model
│ ├── mock_users.json # Mock user data
│ ├── mock_data.json # Generated test data
│ ├── domain_model.json # Combined application model
│ ├── interface_model.json # UI/UX specifications
│ ├── sql/ # Generated SQL migrations
│ ├── src/ # Generated application source
│ └── generation.log # Generation process log
└── .env # Environment variables 编辑流系统使您可以在保持一致性和安全性的同时修改现有应用程序。这是使用它的方法:
python -m src.cli update " Add a dashboard for expense analytics "完全再生
部分更新
backups/backup_YYYYMMDD_HHMMSS/该工具通过以下结构生成一个React应用程序:
frontend/
├── src/
│ ├── components/ # Reusable UI components
│ │ ├── Button.jsx
│ │ ├── Card.jsx
│ │ ├── Chart.jsx
│ │ ├── Form.jsx
│ │ ├── Modal.jsx
│ │ └── Table.jsx
│ ├── pages/ # Application pages
│ ├── providers/ # Data and auth providers
│ └── App.js # Main application component
└── package.json # Project dependencies 欢迎捐款!请随时提交拉动请求。
该项目是根据MIT许可证获得许可的 - 有关详细信息,请参见许可证文件。