Skip to content

feat(init): create template GoFr project with three-layer architecture#77

Open
yashisrani wants to merge 1 commit into
gofr-dev:mainfrom
yashisrani:feat/three-arch
Open

feat(init): create template GoFr project with three-layer architecture#77
yashisrani wants to merge 1 commit into
gofr-dev:mainfrom
yashisrani:feat/three-arch

Conversation

@yashisrani

Copy link
Copy Markdown

Fix: #60

Description

Implements the gofr init command to create a template GoFr project with three-layer architecture (handler, service, store).

Usage

gofr init -name=example.com/myproject

Generated Structure

├── go.mod
├── main.go
├── handler/
│   └── handler.go
├── service/
│   └── service.go
└── store/
    └── store.go

Architecture Flow

main.go → creates handler.New()
handler/handler.go → depends on service.Service
service/service.go → depends on store.Store
store/store.go → data layer implementation

Changes

bootstrap/init.go - Updated Create function to generate handler, service, and store directories with template files

Testing

  • All existing tests pass
  • Generated project compiles successfully with go build

@yashisrani

yashisrani commented Jun 1, 2026

Copy link
Copy Markdown
Author

/cc @coolwednesday @aryanmehrotra

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a template GoFr project with three layer architecture using cli

1 participant