This project has been transferred to the
go-sphere/sphere
repository for maintenance.
Sphere is a project template for building monolithic applications with a focus on simplicity, maintainability, and scalability. It uses ent
for schema management and proto
for API definitions, providing a solid foundation that can be adapted for microservices as your project evolves.
Sphere comes with powerful code generation tools to create proto
files, Swagger
documents, TypeScript
clients, and
more, speeding up your development workflow.
For a detailed walkthrough of setting up a new project, please see the Quick Start Guide.
For detailed guidelines on defining API interfaces, including HTTP transcoding rules, path mapping, and field binding, please refer to the API Definition Rules documentation.
For guidelines on error handling and how to define errors in your API, please refer to the Error Handling Documentation.
- Simple & Maintainable: A clean and straightforward codebase that is straightforward to understand and extend.
- Rapid Development: Use the code generator to quickly scaffold project components.
- Modular Design: All modules are designed to be replaceable to fit your specific needs.
- Single-File Deployment: The entire project can be deployed as a single file for easy management.
- Web Framework: gin
- Dependency Injection: wire
- ORM: ent
- Docs Generation: swag
- Protobuf management: buf
- Build Tool: make
sphere-cli
: A command-line tool forsphere
project management.protoc-gen-route
: A plugin for generating routing code from.proto
files.protoc-gen-sphere
: A plugin for generating HTTP server code from.proto
files.protoc-gen-sphere-binding
: A plugin for replacing go struct binding tags withproto
field options.protoc-gen-sphere-errors
: A plugin for generating error handling code from.proto
files.
- Standard Layout : Default sphere project template layout.
- Quick Start Guide : A step-by-step guide to setting up a new Sphere project.
- API Definitions : Guidelines for writing API definitions
.proto
files in Sphere. - Error Handling : Guidelines for error handling in Sphere applications.
- Logging : How to set up and use logging in Sphere applications.
Sphere is released under the MIT license. See LICENSE for details.