This is a template for creating a modular monolithic Rust backend application.
The template follows a modular monolithic architecture with the following crates:
api
: Handles the web API layer (routes, handlers, middleware).db
: Manages all database interactions (repositories, services).core
: Contains the core business logic and data models.auth
: Encapsulates authentication and authorization logic.
- Clone this repository.
- Run the setup script with your project name:
For example:
./setup.sh <your-project-name>
./setup.sh my-todo-app
- The script will replace all placeholders with your project name.
- (Optional) Rename the directories inside the
crates
directory to match your project name. For example, rename__PROJECT_NAME__-api
tomy-todo-app-api
. - Start coding!
- URL:
http://localhost:8080/api/v1/docs/
- Features: Interactive API testing, request/response examples, schema validation
- Best for: Testing endpoints, understanding request formats
- URL:
http://localhost:8080/api/v1/docs/redoc
- Features: Clean, readable documentation with search functionality
- Best for: Reading API documentation, integration planning
- JSON Format:
http://localhost:8080/api/v1/docs/openapi.json
- YAML Format:
http://localhost:8080/api/v1/docs/openapi.yaml
- Use for: Code generation, importing into API tools