Account management server.
- Login
- Register
- Change Password
- Logout
handle session with jwt
make init
make run
air
go run main.go
The application in primarily divided into 3 layers:
- Handler
- Service
- Storage
and a core package that contains the common code.
Contains the model and interfaces that are shared between the layers.
Handler Handles the request and response here are the responsibilities of the handler:
- Parse the request data
- Validate the data
- Transform the data to core model
- Call the service layer
- Log internal errors
- Handle Authorization
- Send the response
Service is the business logic of the application. Here are the responsibilities of the service:
- Process the data
- Call the storage
Storage is the layer that interacts with the database. Here are the responsibilities of the storage:
- Query the database
- Return the data