-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Dummy hello
Package as a Guideline for Future PRs
#455
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe changes rework the "hello" functionality by replacing legacy components with a new CRUD-based approach. The Changes
Sequence Diagram(s)sequenceDiagram
participant C as Client
participant R as Echo Router
participant H as HelloHandler
participant S as HelloService
participant Repo as MongoDB HelloRepository
participant DB as MongoDB
C->>R: POST /hello (with request body)
R->>H: Invoke createHello(c)
H->>S: Call createHello(request)
S->>Repo: CreateVisitor(visitor)
Repo->>DB: Insert visitor document
DB-->>Repo: Return inserted record or error
Repo-->>S: Return visitor data/error
S-->>H: Return success/error response
H-->>R: Send HTTP response
R-->>C: Return response to client
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🔇 Additional comments (4)
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (6)
backend-go/internal/core/hello/model.go (1)
6-6
: Add documentation for theID
field.Following Go's documentation standards, please add a comment describing the purpose of the
ID
field, similar to howNickname
is documented.type CodePairVisitor struct { + // ID is the unique identifier of the visitor ID int Nickname string }
backend-go/internal/core/hello/server.go (1)
13-14
: Add error handling for route registration.The
echo.Echo
methodsGET
andPOST
can return errors if route registration fails. Consider handling these potential errors.- e.GET("/hello", handler.readHello) - e.POST("/hello", handler.createHello) + if err := e.GET("/hello", handler.readHello); err != nil { + // Consider how to handle registration failures + panic(fmt.Sprintf("failed to register GET /hello route: %v", err)) + } + if err := e.POST("/hello", handler.createHello); err != nil { + panic(fmt.Sprintf("failed to register POST /hello route: %v", err)) + }backend-go/internal/core/hello/service.go (2)
11-11
: Update method documentation to match its functionality.The comment should indicate that the method creates a hello message rather than returning one.
-// createHello returns a hello message for a given CodePairVisitor +// createHello creates a hello message for a given CodePairVisitor
20-28
: Improve method name and documentation to match its functionality.The method name and documentation don't accurately reflect what the method does. It finds a visitor by ID and returns their nickname.
-// readNickname returns a hello message for a given CodePairVisitor -func (s *Service) readNickname(id int) (string, error) { +// findVisitorNickname finds a visitor by ID and returns their nickname +func (s *Service) findVisitorNickname(id int) (string, error) {backend-go/internal/infra/database/mongo/hello.go (1)
9-14
: Add MongoDB field tags for proper serialization.Consider adding
bson
tags to ensure proper MongoDB field mapping:type CodePairVisitor struct { - ID int - Nickname string - CreatedAt time.Time - UpdatedAt time.Time + ID int `bson:"_id"` + Nickname string `bson:"nickname"` + CreatedAt time.Time `bson:"created_at"` + UpdatedAt time.Time `bson:"updated_at"` }backend-go/internal/core/hello/handler.go (1)
35-50
: Add validation for negative IDs.Consider validating that the ID is positive:
id, err := strconv.Atoi(idStr) if err != nil { return http.NewErrorResponse(c, fmt.Errorf("invalid ID format: %s", idStr)) } + if id < 0 { + return http.NewErrorResponse(c, fmt.Errorf("invalid negative ID: %d", id)) + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
backend-go/api/codepair/v1/models/model_hello_request.go
(0 hunks)backend-go/internal/core/handlers.go
(0 hunks)backend-go/internal/core/hello/handler.go
(1 hunks)backend-go/internal/core/hello/model.go
(1 hunks)backend-go/internal/core/hello/repository.go
(1 hunks)backend-go/internal/core/hello/server.go
(1 hunks)backend-go/internal/core/hello/service.go
(1 hunks)backend-go/internal/infra/database/mongo/hello.go
(1 hunks)backend-go/internal/server/routes.go
(0 hunks)backend-go/internal/server/server.go
(2 hunks)
💤 Files with no reviewable changes (3)
- backend-go/api/codepair/v1/models/model_hello_request.go
- backend-go/internal/server/routes.go
- backend-go/internal/core/handlers.go
🧰 Additional context used
🪛 GitHub Actions: CI GO Backend
backend-go/internal/infra/database/mongo/hello.go
[warning] 38-38: unused-parameter: parameter 'codePairVisitor' seems to be unused, consider removing or renaming it as _ (revive)
🔇 Additional comments (5)
backend-go/internal/server/server.go (1)
11-12
: LGTM! Import changes align with the PR objectives.The new imports support the refactoring goals by:
- Moving route registration to the core package via
hello
- Adding MongoDB repository support
backend-go/internal/core/hello/repository.go (1)
4-8
: LGTM! Well-documented interface with clear responsibilities.The interface is well-designed with clear method signatures and proper documentation.
backend-go/internal/infra/database/mongo/hello.go (2)
16-21
: LGTM!Clean implementation of the domain model conversion.
26-28
: LGTM!Good change to return a pointer, following Go best practices for method receivers.
backend-go/internal/core/hello/handler.go (1)
18-32
: LGTM!Well-structured implementation with proper error handling and request validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
backend-go/internal/infra/database/mongo/.gitkeep
(0 hunks)backend-go/internal/infra/database/mongo/hello.go
(1 hunks)
💤 Files with no reviewable changes (1)
- backend-go/internal/infra/database/mongo/.gitkeep
🔇 Additional comments (3)
backend-go/internal/infra/database/mongo/hello.go (3)
9-21
: LGTM! Good separation of concerns.The implementation maintains a clear separation between persistence and domain models, properly encapsulating database-specific fields like timestamps.
30-36
: Implement actual MongoDB query.The current implementation returns hardcoded data instead of querying MongoDB.
This issue was previously identified. Please refer to the earlier review comment for the suggested implementation using
collection.FindOne
.
38-41
: Implement MongoDB document creation.The method has an empty implementation with an unused parameter.
This issue was previously identified. Please refer to the earlier review comment for the suggested implementation using
collection.InsertOne
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution. I've left a few questions.
hello
package route registrationhello
Package as a Guideline for Future PRs
- add CURD operations to `hello`
- for mongoDB use `database` type directly
- add mongo driver
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
♻️ Duplicate comments (1)
backend-go/internal/server/server.go (1)
27-27
:⚠️ Potential issueHandle potential errors from
hello.New
.The
hello.New
function call ignores potential errors that could occur during initialization.Apply this diff to handle potential errors:
- hello.New(e, mongodb.NewHelloRepo(conf.Mongo, db)) + if err := hello.New(e, mongodb.NewHelloRepo(conf.Mongo, db)); err != nil { + return nil, fmt.Errorf("failed to initialize hello handler: %w", err) + }
🧹 Nitpick comments (12)
backend-go/docker/docker-compose.yml (1)
17-22
: Consider adjusting healthcheck parameters.The current healthcheck configuration might be too aggressive:
- 5s interval with 2s timeout means frequent checks.
- Consider increasing the interval to reduce overhead (e.g., 30s).
- 20 retries might be excessive for initial startup.
backend-go/internal/core/hello/server.go (2)
18-21
: Consider grouping related routes.The routes could be organized better using Echo's Group feature:
- e.POST("/hello", handler.createHello) - e.GET("/hello/:id", handler.readHello) - e.PUT("/hello/:id", handler.updateHello) - e.DELETE("/hello/:id", handler.deleteHello) + hello := e.Group("/hello") + hello.POST("", handler.createHello) + hello.GET("/:id", handler.readHello) + hello.PUT("/:id", handler.updateHello) + hello.DELETE("/:id", handler.deleteHello)
9-10
: Consider adding middleware registration.The
New
function could accept optional middleware for the routes.-func New(e *echo.Echo, repo database.Hello) { +func New(e *echo.Echo, repo database.Hello, middleware ...echo.MiddlewareFunc) {backend-go/internal/infra/database/errors.go (1)
7-16
: Consider enhancing error messages.The error messages could be more descriptive to aid in debugging:
- ErrDocumentNotFound = errors.New("document not found") + ErrDocumentNotFound = errors.New("database: document not found") - ErrDuplicatedKey = errors.New("duplicate key error") + ErrDuplicatedKey = errors.New("database: duplicate key violation") - ErrNetwork = errors.New("network error") + ErrNetwork = errors.New("database: network connectivity issue") - ErrDisconnected = errors.New("database disconnected") + ErrDisconnected = errors.New("database: connection lost")backend-go/internal/infra/database/mongodb/client.go (1)
15-41
: Add connection retry mechanism and graceful shutdown.The connection should be retried a few times before giving up, and the function should return a cleanup function for graceful shutdown.
Consider implementing a retry mechanism and returning a cleanup function:
-func Dial(conf *config.Mongo, logger echo.Logger) (*mongo.Client, error) { +func Dial(conf *config.Mongo, logger echo.Logger) (*mongo.Client, func(), error) { + var client *mongo.Client + var err error + + for retries := 3; retries > 0; retries-- { // ... existing connection code ... + if err == nil { + break + } + logger.Warnf("Failed to connect to MongoDB, retrying... (%d attempts left)", retries-1) + time.Sleep(time.Second) + } + if err != nil { + return nil, nil, err + } + + cleanup := func() { + ctx, cancel := context.WithTimeout(context.Background(), conf.ConnectionTimeout) + defer cancel() + if err := client.Disconnect(ctx); err != nil { + logger.Errorf("Failed to disconnect from MongoDB: %v", err) + } + } + - return client, nil + return client, cleanup, nil }backend-go/internal/infra/database/mongodb/indexes.go (2)
23-26
: Enhance index configuration.The index configuration could be improved with additional options for better maintainability and performance.
Add index name and background creation:
indexes: []mongo.IndexModel{{ Keys: bson.D{{Key: "nickname", Value: 1}}, - Options: options.Index().SetUnique(true), + Options: options.Index(). + SetUnique(true). + SetName("idx_nickname_unique"). + SetBackground(true), }},
20-28
: Consider adding TTL index for data cleanup.If visitor records should be automatically cleaned up after a certain period, consider adding a TTL index.
Example implementation:
var collectionInfos = []collectionInfo{ { name: ColVisitor, indexes: []mongo.IndexModel{ { Keys: bson.D{{Key: "nickname", Value: 1}}, Options: options.Index().SetUnique(true), }, + { + Keys: bson.D{{Key: "created_at", Value: 1}}, + Options: options.Index(). + SetName("idx_ttl_cleanup"). + SetExpireAfterSeconds(30 * 24 * 60 * 60), // 30 days + }, }, }, }backend-go/internal/infra/database/hello.go (1)
8-13
: Consider adding validation tags and constraints.The Visitor struct could benefit from validation constraints for the nickname field.
Consider adding validation:
type Visitor struct { ID ID `bson:"_id,omitempty"` // Auto-generated by MongoDB if empty. - Nickname string `bson:"nickname"` // Visitor's nickname. + Nickname string `bson:"nickname" validate:"required,min=3,max=50"` // Visitor's nickname (3-50 chars). CreatedAt time.Time `bson:"created_at"` // Timestamp when the record was created. UpdatedAt time.Time `bson:"updated_at"` // Timestamp when the record was last updated. }backend-go/internal/core/hello/service.go (1)
16-68
: Consider adding logging for better observability.Given the past discussion about centralized logging, consider adding logging statements for important operations and errors.
Apply this diff to add logging:
// createHello creates a new visitor record based on the provided hello request. func (s *Service) createHello(req *models.HelloRequest) (string, error) { + // TODO: Add logging once centralized logging is implemented visitor := database.Visitor{ Nickname: req.Nickname, } visitor, err := s.repo.CreateVisitor(visitor) if err != nil { if errors.Is(err, database.ErrDuplicatedKey) { + // TODO: Log duplicate nickname error return "", fmt.Errorf("nickname '%s' already exists: %w", req.Nickname, err) } + // TODO: Log creation error return "", fmt.Errorf("failed to create hello message for visitor %v: %w", req, err) } return string(visitor.ID), nil }backend-go/internal/core/hello/handler.go (1)
63-73
: Consider using HelloResponse for consistency.Other methods use
models.HelloResponse
, butdeleteHello
uses a map. Consider using the same response type for consistency.- return http.NewOkResponse(c, map[string]string{ - "message": fmt.Sprintf("Visitor with id %s deleted", id), - }) + return http.NewOkResponse(c, models.HelloResponse{ + Message: fmt.Sprintf("Visitor with id %s deleted", id), + })backend-go/internal/infra/database/mongodb/hello.go (2)
30-50
: Consider accepting context parameter.The method creates its own context, but it would be better to accept a context parameter for timeout and cancellation control.
-func (r *HelloRepository) CreateVisitor(visitor database.Visitor) (database.Visitor, error) { +func (r *HelloRepository) CreateVisitor(ctx context.Context, visitor database.Visitor) (database.Visitor, error) { now := time.Now() visitor.CreatedAt = now visitor.UpdatedAt = now - res, err := r.collection.InsertOne(context.Background(), visitor) + res, err := r.collection.InsertOne(ctx, visitor)
52-99
: Consider accepting context parameter in all methods.Similar to CreateVisitor, all methods should accept a context parameter for consistency and better control over timeouts and cancellations.
-func (r *HelloRepository) FindVisitor(id database.ID) (database.Visitor, error) { +func (r *HelloRepository) FindVisitor(ctx context.Context, id database.ID) (database.Visitor, error) { // ... use ctx instead of context.Background() -func (r *HelloRepository) UpdateVisitor(visitor database.Visitor) error { +func (r *HelloRepository) UpdateVisitor(ctx context.Context, visitor database.Visitor) error { // ... use ctx instead of context.Background() -func (r *HelloRepository) DeleteVisitor(id database.ID) error { +func (r *HelloRepository) DeleteVisitor(ctx context.Context, id database.ID) error { // ... use ctx instead of context.Background()
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
backend-go/go.sum
is excluded by!**/*.sum
📒 Files selected for processing (18)
api/backend-openapi-spec.json
(2 hunks)backend-go/cmd/codepair/main.go
(1 hunks)backend-go/docker/docker-compose.yml
(1 hunks)backend-go/go.mod
(3 hunks)backend-go/internal/core/hello/handler.go
(1 hunks)backend-go/internal/core/hello/model.go
(0 hunks)backend-go/internal/core/hello/repository.go
(0 hunks)backend-go/internal/core/hello/server.go
(1 hunks)backend-go/internal/core/hello/service.go
(1 hunks)backend-go/internal/infra/database/errors.go
(1 hunks)backend-go/internal/infra/database/hello.go
(1 hunks)backend-go/internal/infra/database/id.go
(1 hunks)backend-go/internal/infra/database/mongo/hello.go
(0 hunks)backend-go/internal/infra/database/mongodb/client.go
(1 hunks)backend-go/internal/infra/database/mongodb/hello.go
(1 hunks)backend-go/internal/infra/database/mongodb/indexes.go
(1 hunks)backend-go/internal/infra/database/mongodb/registry.go
(1 hunks)backend-go/internal/server/server.go
(2 hunks)
💤 Files with no reviewable changes (3)
- backend-go/internal/core/hello/model.go
- backend-go/internal/core/hello/repository.go
- backend-go/internal/infra/database/mongo/hello.go
✅ Files skipped from review due to trivial changes (1)
- backend-go/internal/infra/database/id.go
🔇 Additional comments (10)
backend-go/cmd/codepair/main.go (1)
27-30
: LGTM! Good error handling.The changes introduce proper error handling for server creation, following Go's idiomatic approach.
backend-go/internal/infra/database/mongodb/registry.go (1)
14-28
: LGTM! Well-implemented BSON codec.The implementation includes proper error handling, type checking, and clear error messages.
Also applies to: 30-42
backend-go/internal/infra/database/hello.go (1)
15-32
: LGTM! Well-documented interface.The Hello interface is well-documented with clear method descriptions and error handling expectations.
api/backend-openapi-spec.json (1)
4-140
: Well-structured API specification for hello endpoints!The API specification for the hello endpoints is comprehensive and follows REST best practices:
- Clear operation IDs and descriptions
- Proper request/response schemas
- Consistent error handling
- Well-documented parameters
backend-go/go.mod (1)
11-11
:✅ Verification successful
Verify MongoDB driver version compatibility.
The MongoDB Go driver version
v2.0.1
is very recent. Let's verify its stability and compatibility.
🌐 Web query:
What is the latest stable version of the MongoDB Go driver (mongo-driver)?
💡 Result:
The latest stable version of the MongoDB Go driver (mongo-driver) is v2.0.1, released on February 22, 2025[2]. This version includes bug fixes and improvements over v2.0.0[1][5], which introduced major enhancements like:
- Simplified Client Side Operations Timeout (CSOT)
- OpenID Connect (OIDC) authentication support
- Consolidated BSON package structure for cleaner imports[5]
- Deprecation of MongoDB server versions below 3.6
Key details about the v2.x series:
- Support for v1.x versions will end on January 15, 2026[1]
- Requires Go 1.18+ (Go 1.22+ recommended for testing)[7]
- Includes a comprehensive migration guide for upgrading from v1.x[5]
For most users, upgrading to v2.0.1 is recommended unless maintaining legacy systems still on v1.x (which receives critical fixes until its end-of-life)[1][4].
Citations:
- 1: https://www.mongodb.com/community/forums/t/mongodb-go-driver-2-0-is-here-ready-for-production/310117
- 2: https://www.mongodb.com/community/forums/t/mongodb-go-driver-2-0-1-released/313359
- 3: https://github.com/mongodb/mongo-go-driver/releases
- 4: https://www.mongodb.com/community/forums/t/mongodb-go-driver-1-17-2-released/309478
- 5: https://www.mongodb.com/community/forums/t/mongodb-go-driver-2-0-0-released/309481
- 6: https://www.mongodb.com/docs/drivers/go/current/whats-new/
- 7: https://github.com/mongodb/mongo-go-driver
- 8: https://www.mongodb.com/zh-cn/docs/drivers/go/current/
- 9: https://www.mongodb.com/community/forums/t/mongodb-go-driver-1-11-0-released/197581
- 10: https://www.mongodb.com/docs/drivers/go/current/fundamentals/stable-api/
MongoDB Driver Version Confirmed
After verifying the MongoDB Go driver version, it is clear that version v2.0.1 is the latest stable release. The module file in
backend-go/go.mod
(line 11) already reflects the current version, so no modifications are needed.backend-go/internal/core/hello/service.go (1)
22-28
: Excellent error handling for duplicate nicknames!The error handling properly distinguishes between duplicate nickname errors and other creation failures, providing clear error messages.
backend-go/internal/core/hello/handler.go (2)
12-15
: LGTM! Clean and well-documented Handler implementation.The Handler struct is well-documented and follows a clean design with proper dependency injection of the service.
17-32
: LGTM! Proper error handling implementation.The implementation follows the agreed-upon Echo error handling style from the previous discussion, with proper request binding, validation, and response generation.
backend-go/internal/infra/database/mongodb/hello.go (2)
38-43
: LGTM! Proper error handling.The error handling is well-implemented across all methods:
- Proper error wrapping with descriptive messages
- Correct mapping of MongoDB errors to domain errors
- Appropriate checks for document existence
Also applies to: 57-62, 79-81, 92-94
9-10
:❓ Verification inconclusive
Verify MongoDB driver version.
The import path suggests MongoDB driver v2, but the latest stable version is v1.x.
🌐 Web query:
What is the latest stable version of the MongoDB Go driver?
💡 Result:
The latest stable version of the MongoDB Go driver is v2.0.0, officially released on January 16, 2025[1][5]. This major update introduces significant improvements and breaking changes compared to previous versions.
Key details about MongoDB Go Driver v2.0:
- Requires Go 1.18 or higher (Go 1.22+ needed for test suite)[9]
- Supports MongoDB server versions 3.6 and newer[9]
- Features simplified Client Side Operations Timeout (CSOT) implementation[1]
- Adds OpenID Connect (OIDC) authentication support[1][3]
- Consolidates BSON-related packages into a single
bson
package[5]- Introduces a builder pattern for configuration options[5]
- Deprecates support for MongoDB server versions below 3.6[3]
Support status for older versions:
- Critical bug fixes will be backported to v1.x until January 15, 2026[1]
- New features are exclusive to v2.x and later[3]
- Last minor release in v1.x series was v1.17.0 (June 2024)[3]
Developers are encouraged to upgrade using the official migration guide to adapt to API changes like updated connection handling (
mongo.Connect()
instead ofClient.Connect()
)[5]. The driver is available via standard Go module installation:go get go.mongodb.org/mongo-driver/v2/mongo
[9].Citations:
- 1: https://www.mongodb.com/community/forums/t/mongodb-go-driver-2-0-is-here-ready-for-production/310117
- 2: https://www.mongodb.com/community/forums/t/mongodb-go-driver-1-14-0-released/266441
- 3: https://github.com/mongodb/mongo-go-driver/releases
- 4: https://www.mongodb.com/community/forums/t/mongodb-go-driver-1-16-0-released/286588
- 5: https://www.mongodb.com/community/forums/t/mongodb-go-driver-2-0-0-released/309481
- 6: https://www.mongodb.com/docs/drivers/go/master/compatibility/
- 7: https://www.mongodb.com/community/forums/t/mongodb-go-driver-1-11-0-released/197581
- 8: https://www.mongodb.com/community/forums/t/mongodb-go-driver-1-17-2-released/309478
- 9: https://github.com/mongodb/mongo-go-driver
- 10: https://www.mongodb.com/ko-kr/docs/drivers/go/current/compatibility/
MongoDB Driver Version Confirmed & Consistency Improvement Suggested
- MongoDB Driver Import: The code is correctly importing the MongoDB Go driver v2.0.0—the latest stable version—so no driver update is needed.
- CRUD Methods: While error handling is solid, please consider introducing a
context.Context
parameter in theCreateVisitor
method (and similarly in the other CRUD methods) to ensure consistent context propagation and support for cancellation/timeouts.
- `New` is some strange because it doesn't return anything
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, it looks great to me. Thanks for your contribution!
I've left some suggestions on github and discord.
func NewHandler(service *Service) *Handler { | ||
return &Handler{ | ||
helloService: service, | ||
// createHello handles the POST /hello endpoint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that this code serves as a guideline, but we will likely refer to these codes when adding comments in future work, so i'm leaving my thoughts regarding the comments here.
How about removing comments for API endpoints?
I'm concerned that specifying which API endpoint a handler method is for in its comments could increase the management points.
For example, if an endpoint is modified, the corresponding comment must also be updated. However, if it's missed, the information in the comments may become outdated and inconsistent with the actual implementation.
What this PR does / why we need it
This PR refactors the
hello
package, making it a structured guideline for future API implementations. Additionally, it includes database configurations, reorganized package structures, and CRUD operation examples.Summary of Changes
hello
package to serve as a blueprint for other API implementations.Database.ID
.docker-compose
file.code
package structure:handlers
.transport/http
behavior.error_handler
.database
package for better separation of concerns.core
package, where handlers and services coexist.Which issue(s) this PR fixes
Addresses #430
Special notes for your reviewer
we could test manually for now
Does this PR introduce a user-facing change?
Additional documentation
Checklist
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Chores