This is the back-end service for Study-Savvy.
The back-end server can get client's request and reply it.
Furthermore, it can cooperate with Celery in Python which gain tasks-queue from Redis set by the server.
The corresponding celery repository can see in Study-Savvy-AsyncWork-CeleryIn the project will set My-SQL and Redis and Go-server, and it should combine with other project to have whole service.
Furthermore, the logs will send into InfluxDB and display on the Grafana.
Logs stored in InfluxDB and display by Grafana
Supply main two service
- Audio content summarize and assistant especially in education zone.
- Article (from graph or text) content improver by giving some advice especially in high-school student writing.
Two application
- App made by Flutter
- Website made by Next.js
URL : https://study-savvy.com
(Image just part of document)
Details in document can see the docs/openapi.yaml
or visit the API-Document
- This project is the "Back-end Subsystem" in Study-Savvy
git clone https://github.com/weiawesome/study_savvy_api_go.git
docker-compose up -d
# Move to test directory
cd ./test
# Set all environment
docker-compose up -d
Project Architecture
├── api
│ ├── handler
│ ├── middleware
│ ├── request
│ ├── response
│ ├── routes
│
├── internal
│ ├── repository
│ ├── service
│
├── docs
│
├── go.mod
├── go.sum
│
├── main.go
The api directory encompasses the presentation layer, responsible for handling user interactions and requests.
- This directory contains the configuration of API routes. All API endpoints are defined here.
- The handler directory connects with the service layer and generates responses for incoming requests.
- The middleware directory contains pre-processing logic before the request reaches the handler. It includes tasks such as Jwt validation, content-type filtering, and request content validation.
- The request directory defines the structure and types of incoming requests. It helps ensure proper handling and validation of user inputs.
- The response directory defines the structure and types of outgoing responses. It ensures consistency in the data sent back to clients.
The internal/service directory serves as the Business Logic layer of the application.
Each subdirectory and service file within this directory corresponds to a specific handler in the presentation layer.
These components are responsible for carrying out intricate internal logical operations and orchestrating data manipulation.
Once the necessary business logic has been executed,
the service returns a well-formed response to the respective handler in the presentation layer.
This seamless interaction ensures that the core business rules are effectively implemented and maintained.
The internal/repository directory corresponds to the Data Access Layer, responsible for interacting with various data sources.
- The model subdirectory contains the definitions of all data models used in the SQL Database. These models define the structure and relationships of the data.
- The sql subdirectory houses all SQL Database manipulation operations. This includes CRUD operations for all database tables. The services within the application utilize the repository to retrieve and manipulate information stored in the SQL Database.
- The redis subdirectory handles all interactions with the Redis Database. Here, tasks like setting blacklists, validating mail verifications, and adding Celery tasks are managed. Redis plays a vital role in caching and handling specific tasks efficiently.