Clone this repository and run:
docker-compose up
Following endpoints:
Method | Route | Body |
---|---|---|
POST | /register | {"username": "dian", "email": "1234@email.com", "password": "0821ss" } |
dating-app/
|-- cmd/
| -- main.go
|-- internal/
| |-- domain/
| | |-- user.go
| |-- repository/
| | |-- user_repository.go
| |-- service/
| | |-- user_service.go
| |-- delivery/
| | |-- http/
| | |-- handler/
| | | -- user_handler.go
| | |-- router/
| | |-- user_router.go
| |-- infrastructure/
| |-- database/
| |-- database.go
|-- config/
|-- config.go
- cmd/:
- main.go:
- The entry point of your application. This is where you initialize and wire up your dependencies, configure your application, and start the execution.
- main.go:
- internal/:
- domain/: Contains the core business logic or domain model of your application.
- user.go:
- Defines the User struct, which represents the core entity in your application.
- user.go:
- repository/: Contains interfaces or implementations responsible for data access.
- user_repository.go:
- Defines the interface for a user repository, specifying methods like CreateUser, GetUserByID, etc.
- user_repository.go:
- service/: Houses the application's business logic or use cases.
- user_service.go:
- Implements methods related to user use cases, such as creating a user, updating a user, etc.
- user_service.go:
- delivery/: Handles the delivery mechanism of your application, such as HTTP, CLI, or messaging.
- http/: Specifically handles HTTP-related concerns.
- handler/: Contains HTTP request handlers, responsible for handling HTTP requests and interacting with the application layer.
- user_handler.go:
- Implements HTTP handlers for user-related operations.
- user_handler.go:
- router/: Contains the router setup for your HTTP server.
- user_router.go:
- Configures the routes for user-related endpoints.
- user_router.go:
- handler/: Contains HTTP request handlers, responsible for handling HTTP requests and interacting with the application layer.
- http/: Specifically handles HTTP-related concerns.
- infrastructure/: Houses infrastructure-related concerns, such as databases or external services.
- database/: Contains code related to database setup and configuration.
- database.go:
- Initializes and configures the database connection.
- database.go:
- database/: Contains code related to database setup and configuration.
- domain/: Contains the core business logic or domain model of your application.
- config/:
- config.go:
- Contains code related to application configuration, likely using a configuration library like Viper to manage environment variables and configuration files.
- config.go: