Skip to content

Commit 7519f86

Browse files
Updated backend documentation.
1 parent fe2d5f6 commit 7519f86

File tree

1 file changed

+83
-7
lines changed

1 file changed

+83
-7
lines changed

README.md

Lines changed: 83 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This repository contains the backend code for the Personalized-SmartEd project,
44

55
## Introduction
66

7-
The Go-Backend project is designed to provide a robust and scalable backend for the Personalized-SmartEd platform. It leverages the Go programming language to deliver high performance and concurrency.
7+
The Go-Backend project is designed to provide a robust and scalable backend for the Personalized-SmartEd platform. It leverages the Go programming language to deliver high performance and concurrent processing for educational services.
88

99
## Features
1010

@@ -13,6 +13,16 @@ The Go-Backend project is designed to provide a robust and scalable backend for
1313
- RESTful API endpoints
1414
- Integration with various data sources
1515

16+
## Table of Contents
17+
18+
- [Introduction](#introduction)
19+
- [Features](#features)
20+
- [Installation](#installation)
21+
- [Usage](#usage)
22+
- [Project Substructure](#project-substructure)
23+
- [Interaction with ML-Service](#interaction-with-ml-service)
24+
- [Contributing](#contributing)
25+
1626
## Installation
1727

1828
To get started with the Go-Backend, follow these steps:
@@ -37,6 +47,78 @@ Run the application with the following command:
3747
go run main.go
3848
```
3949

50+
## Project Substructure
51+
52+
Below is the folder structure of the **Go-Backend** repository:
53+
54+
```
55+
Go-Backend/
56+
├── cmd/
57+
│ └── main.go # Main application entry point
58+
├── internal/
59+
│ ├── config/
60+
│ │ └── db.go # Database configuration and initialization
61+
│ ├── routes/
62+
│ │ ├── assessment_routes.go # Routes related to assessments
63+
│ │ ├── classroom_routes.go # Routes related to classrooms
64+
│ │ ├── doubt_routes.go # Routes related to doubt solving
65+
│ │ ├── quiz_routes.go # Routes related to quizzes
66+
│ │ ├── recommendation_routes.go # Routes related to recommendations
67+
│ │ ├── student_routes.go # Routes related to students
68+
│ │ └── teacher_routes.go # Routes related to teachers
69+
│ └── services/
70+
│ └── ml_service.go # Service interacting with ML-Service repository
71+
├── go.mod # Go module file
72+
└── README.md # Project documentation
73+
```
74+
75+
## Interaction with ML-Service
76+
77+
The Go-Backend interacts with the ML-Service repository to leverage machine learning models for educational services. Here is how the interaction works:
78+
79+
1. **Assessment Routes**: The backend sends student responses to the ML-Service to get assessments and predictions.
80+
2. **Quiz Routes**: The backend requests personalized quizzes from the ML-Service based on student profiles and learning styles.
81+
3. **Tutor Routes**: The backend utilizes the ML-Service to provide context-aware tutoring sessions.
82+
4. **Doubt Routes**: The backend sends student doubts (text and images) to the ML-Service for resolution using multimodal AI agents.
83+
5. **Recommendation Routes**: The backend requests study routines and learning resources from the ML-Service based on aggregated student data.
84+
85+
Example of a service file interacting with ML-Service (internal/services/ml_service.go):
86+
87+
```go
88+
package services
89+
90+
import (
91+
"bytes"
92+
"encoding/json"
93+
"net/http"
94+
)
95+
96+
type AssessmentRequest struct {
97+
Responses []int `json:"responses"`
98+
}
99+
100+
type AssessmentResponse struct {
101+
StudyType string `json:"study_type"`
102+
Description string `json:"description"`
103+
}
104+
105+
func GetAssessment(responses []int) (*AssessmentResponse, error) {
106+
reqBody, _ := json.Marshal(AssessmentRequest{Responses: responses})
107+
resp, err := http.Post("https://ml-service/api/assessments/static", "application/json", bytes.NewBuffer(reqBody))
108+
if err != nil {
109+
return nil, err
110+
}
111+
defer resp.Body.Close()
112+
113+
var assessmentResp AssessmentResponse
114+
if err := json.NewDecoder(resp.Body).Decode(&assessmentResp); err != nil {
115+
return nil, err
116+
}
117+
118+
return &assessmentResp, nil
119+
}
120+
```
121+
40122
## Contributing
41123

42124
We welcome contributions from the community. To contribute, please follow these steps:
@@ -46,10 +128,4 @@ We welcome contributions from the community. To contribute, please follow these
46128
3. Commit your changes to the branch.
47129
4. Create a pull request with a detailed description of the changes.
48130

49-
## License
50-
51-
This project does not have a license specified.
52-
53131
---
54-
55-
Please review and adjust this README as necessary to better fit your project.

0 commit comments

Comments
 (0)