Go-Soft-Crusher is a tool for automatically generating APIs from Go functions, including documentation, tests, and deployment configurations.
Soft-Crusher is a tool designed to automatically transform software functions into API services. It analyzes existing software, identifies functions, and generates an API layer to expose these functions as web services.
-
Function Analyzer
- Parses source code to identify functions
- Uses tools like
ctags,Doxygen, or language-specific analyzers - Groups functions by category or purpose
-
API Designer
- Generates API structure based on identified functions
- Creates RESTful or GraphQL endpoints for each function
- Handles input/output mapping
-
Code Generator
- Produces boilerplate code for the API layer
- Supports multiple frameworks (e.g., Flask, FastAPI, Express.js)
- Generates necessary routing and controller logic
-
Documentation Generator
- Creates API documentation (e.g., OpenAPI/Swagger)
- Generates usage examples and parameter descriptions
-
Testing Suite
- Generates basic test cases for each API endpoint
- Provides tools for manual API testing (e.g., Postman collections)
-
Deployment Helper
- Creates Dockerfiles for containerization
- Generates deployment scripts for common platforms (e.g., AWS, Heroku)
-
Function Analysis Module
- Implement parsers for common programming languages
- Create a standard format for representing function metadata
-
API Design Engine
- Develop algorithms to map functions to API endpoints
- Implement RESTful and GraphQL schema generators
-
Code Generation System
- Create templates for popular API frameworks
- Implement logic to fill templates with function-specific code
-
Documentation Engine
- Implement OpenAPI/Swagger spec generator
- Create a system for generating human-readable API guides
-
Test Generation Module
- Develop algorithms to create basic unit and integration tests
- Implement Postman collection generator
-
Deployment Module
- Create Dockerfile templates
- Implement deployment script generators for various platforms
-
User Interface
- Develop a CLI for easy use of Soft-Crusher
- (Optional) Create a web interface for visual configuration
-
Integration and Packaging
- Combine all modules into a cohesive application
- Package the tool for easy distribution and installation
- Handling diverse programming languages and paradigms
- Ensuring security in auto-generated API code
- Dealing with complex function signatures and dependencies
- Balancing automation with the need for customization
- Keeping up with evolving API best practices and frameworks
- Support for more programming languages and frameworks
- Integration with CI/CD pipelines
- Advanced security features (authentication, rate limiting)
- Performance optimization suggestions
- Support for microservices architecture
- Analyze Go files:
./soft-crusher analyze - Generate API:
./soft-crusher generate - Create deployment configs:
./soft-crusher deploy
For more information, run ./soft-crusher --help
cmd/go-soft-crusher/: Main application entry pointinternal/: Internal packagesanalyzer/: Function analysisdesigner/: API designgenerator/: Code generationdocumentation/: Documentation generationtesting/: Test generationdeployment/: Deployment configuration generationcli/: Command line interface
pkg/: Public packagesscripts/: Build and deployment scriptstest/: Test files
Soft-Crusher is a powerful tool designed to automatically transform software functions into API services. It analyzes existing software, identifies functions, and generates an API layer to expose these functions as web services.
- Multi-language support (Go, Python, JavaScript, Java)
- RESTful API generation
- GraphQL API generation
- Microservice architecture generation
- Test case generation
- Postman collection generation
- Performance analysis and suggestions
- Security middleware generation
- Kubernetes deployment file generation
- Support for multiple cloud providers (AWS, GCP)
- Plugin system for extensibility
- Web-based dashboard for monitoring and management
- Clone the repository:
git clone https://github.com/chenxingqiang/soft-crusher.git
-
Install dependencies:
cd soft-crusher go mod download cd frontend && npm install -
Build the project:
go build -o soft-crusher cmd/soft-crusher/main.go
cd frontend && npm run build
-
Configure the application by editing
config.yaml -
Run the application:
./soft-crusher -
Access the web interface at
http://localhost:8080
Soft-Crusher can be deployed to Kubernetes using the provided Dockerfile and Kubernetes configuration:
- Build the Docker image:
docker build -t chenxingqiang/soft-crusher:latest .
-
Push the image to your Docker registry:
docker push chenxingqiang/soft-crusher:latest -
Apply the Kubernetes configuration:
kubectl apply -f k8s/
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.