A modern full-stack web application with an integrated code generation system. Generate complete Go Fiber API projects with CRUD operations based on your database models.
- Full-Stack Architecture: Astro frontend + Python Flask backend + Go API generation
- Code Generation: Generate complete Go Fiber projects with REST APIs
- Database Management: SQLite-based model and field management
- Modern UI: Clean Astro-based interface with Tailwind CSS
- API-First: RESTful APIs with comprehensive CRUD operations
- Development Ready: Hot reload, testing, and production deployment support
scp-g/
โโโ apps/ # Frontend (Astro + Tailwind CSS)
โ โโโ src/
โ โ โโโ components/ # Reusable UI components
โ โ โโโ layouts/ # Page layouts
โ โ โโโ pages/ # Route pages
โ โ โโโ styles/ # Global styles
โ โโโ public/ # Static assets
โโโ api/ # Backend API (Python Flask)
โ โโโ app.py # Main Flask application
โ โโโ routes.py # API endpoints
โ โโโ generate_go.py # Go code generation
โ โโโ requirements.txt # Python dependencies
โ โโโ test_api.py # API tests
โโโ go/ # Generated Go projects (example)
โโโ main.go # Fiber application
โโโ models/ # Data models
โโโ handlers/ # CRUD handlers
- Framework: Astro v5.14.6
- Styling: Tailwind CSS v4.1.14
- Build Tool: Vite (integrated with Astro)
- API Framework: Flask 3.0.3
- Database: SQLite3
- Code Generation: Python-based Go project generator
- Framework: Fiber v2.52.5
- Language: Go 1.21+
- Features: REST API, CRUD operations, in-memory storage
- Node.js 18+ (for Astro frontend)
- Python 3.8+ (for Flask backend)
- Go 1.21+ (for generated projects)
git clone https://github.com/gusdeyw/scp-g.git
cd scp-gcd api
python -m venv venv
venv\Scripts\activate # Windows
# or
source venv/bin/activate # macOS/Linux
pip install -r requirements.txt
python app.pyBackend runs on: http://localhost:5000
cd apps
npm install
npm run devFrontend runs on: http://localhost:4321
GET /api/config # Get all configs
GET /api/config/{key} # Get config by key
PUT /api/config/{key} # Update config valueGET /api/model # Get all models
POST /api/model # Create new model
GET /api/model/{code} # Get model by code
PUT /api/model/{code} # Update model
DELETE /api/model/{code} # Delete modelGET /api/model_detail # Get all model details
POST /api/model_detail # Create model detail
GET /api/model_detail/{code} # Get detail by code
PUT /api/model_detail/{code} # Update detail
DELETE /api/model_detail/{code} # Delete detailGET /api/generate_go # Generate and download Go project ZIPSet the language for code generation:
curl -X PUT http://localhost:5000/api/config/LANG \
-H "Content-Type: application/json" \
-d '{"value_conf": "Go"}'curl -X POST http://localhost:5000/api/model \
-H "Content-Type: application/json" \
-d '{
"table_code": "users",
"table_name": "Users"
}'curl -X POST http://localhost:5000/api/model_detail \
-H "Content-Type: application/json" \
-d '{
"model_code": "users",
"model_detail_code": "id",
"model_detail_name": "ID",
"model_detail_type": "id"
}'
curl -X POST http://localhost:5000/api/model_detail \
-H "Content-Type: application/json" \
-d '{
"model_code": "users",
"model_detail_code": "name",
"model_detail_name": "Name",
"model_detail_type": "varchar"
}'curl -O -J http://localhost:5000/api/generate_gocd api
python app.py # Start Flask server
pytest # Run tests
black . # Format code
flake8 . # Lint codecd apps
npm run dev # Start dev server
npm run build # Build for production
npm run preview # Preview production buildcd generated_project
go mod tidy # Install dependencies
go run main.go # Start the generated APIcd api
pytest test_api.pyImport api/postman_collection.json into Postman for comprehensive API testing.
cd api
gunicorn --bind 0.0.0.0:8000 app:appcd apps
npm run build
# Deploy the dist/ folder to your web serversrc/components/- Reusable Astro componentssrc/layouts/- Page layout templatessrc/pages/- File-based routingsrc/styles/- Global CSS and Tailwind config
app.py- Flask application factoryroutes.py- API route definitionsgenerate_go.py- Go code generation logicproduction.db- SQLite database
main.go- Fiber application with routesmodels/- Go structs for data modelshandlers/- CRUD operation handlersgo.mod- Go module dependencies
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Astro - The web framework for content-driven websites
- Flask - The Python micro framework
- Fiber - Express-inspired web framework for Go
- Tailwind CSS - A utility-first CSS framework
Made with โค๏ธ for developers who want to generate code faster