Getting started
Structure
Overview of the default feature-based project structure in TurboGo
Project Structure
TurboGo uses a feature-based architecture to keep projects modular, scalable, and easy to maintain.
This is the default folder structure generated when running turbogo new.
handler.go
service.go
repository.go
router.go
main.go
.env
README.md
Structure Highlights
features/: Contains all application features. Each feature is fully self-contained.features/[feature-name]/handler.go: HTTP handlers responsible for handling requests and responses.features/[feature-name]/service.go: Business logic and domain rules.features/[feature-name]/repository.go: Data access layer (database, cache, external APIs).features/[feature-name]/router.go: Route definitions and feature-level middleware.main.go: Application entry point that initializes the app and registers all feature routers..env: Environment variables such asPORT,DB_URL, and secret keys.README.md: Project documentation and usage instructions.
Why Feature-Based?
- ✅ Modular: Each feature is independent and easy to reason about
- ✅ Scalable: Add new features without touching unrelated code
- ✅ Maintainable: Changes are localized to the feature they belong to
- ✅ Testable: Each layer within a feature can be tested independently
Generated with CLI
This structure is generated automatically when you run:
npx create-turbogo@latest my-app