README
ΒΆ
FlowBot Documentation
FlowBot is a workflow-based intelligent chatbot framework.
Directory Structure
-
π
api/- API documentation and interface definitionsswagger.json- OpenAPI 3.0 specification file (JSON format)swagger.yaml- OpenAPI 3.0 specification file (YAML format)docs.go- Auto-generated API documentation codeapi.http- HTTP request examples collection
-
π
config/- Configuration files and examplesconfig.yaml- Main configuration file templateagent.yaml- Agent configuration file templateexamples/- Configuration example files
-
π
deployment/- Deployment-related documentationflowbot-agent.service- Systemd service configuration file
-
π
development/- Development-related documentation and toolsexample.fish- Fish Shell script examplehttp-client.private.env.json- HTTP client environment configuration
-
π
database/- Database-related documentationschema.md- Database table structure documentation
-
π
architecture/- System architecture documentationarchitecture.png- System architecture diagramflowchart.mermaid- Workflow flowchart
-
π
notify.md- Notification configuration guide
Quick Start
- Configuration: Refer to configuration files in the
config/directory - Deployment: Check deployment guides in the
deployment/directory - API: View API documentation in the
api/directory - Development: Refer to development tools in the
development/directory
Development Tools
Task Management
# Install
go install github.com/go-task/task/v3/cmd/task@latest
# View available tasks
task -a
Code Generation
# Generate bot
go run github.com/flowline-io/flowbot/cmd/composer generator bot -name example -rule collect,command,cron,form,input,instruct
# Generate vendor
go run github.com/flowline-io/flowbot/cmd/composer generator vendor -name example
Database Migration
# Import migration
go run github.com/flowline-io/flowbot/cmd/composer migrate import
# Create migration file
go run github.com/flowline-io/flowbot/cmd/composer migrate migration -name file_name
# Import workflow
go run github.com/flowline-io/flowbot/cmd/composer workflow import -token xxx -path ./docs/config/examples/docker_example.yaml
Code Linting
# Install revive
go install github.com/mgechev/revive@latest
# Run code check
revive -formatter friendly ./...
Code Statistics
# Install cloc
sudo apt install cloc # Linux
brew install cloc # macOS
# Count code
cloc --exclude-dir=node_modules --exclude-ext=json .
Security Check
# Install govulncheck
go install golang.org/x/vuln/cmd/govulncheck@latest
# Run security check
govulncheck ./...
API Documentation Generation
Reference: https://github.com/swaggo/swag/blob/master/README.md
# Install swag
go install github.com/swaggo/swag/cmd/swag@latest
# Generate documentation
swag init -g cmd/main.go
# Format documentation
swag fmt -g cmd/main.go
Database Migration Tool
# Install migration tool
go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
# Run migration
migrate -source file://./internal/store/migrate -database mysql://user:password@tcp(127.0.0.1:3306)/db?parseTime=True&collation=utf8mb4_unicode_ci up
Git Leak Detection
# Install gitleaks
go install github.com/zricethezav/gitleaks/v8@v8.21.1
# Check for leaks
gitleaks git -v
Contributing
- Fork this project
- Create a feature branch
- Commit your changes
- Create a Pull Request
License
This project is licensed under the GPL 3.0 License. See the LICENSE file for details.
Click to show internal directories.
Click to hide internal directories.