Backend service for SiPintar, a smart-learning gamification platform built to enhance student motivation and engagement through interactive learning and progress tracking.
This repository contains the API service and data models that power the SiPintar application.
- Language: Go (Golang)
- Framework: Gin
- ORM: GORM
- Database: PostgreSQL
- Authentication: JWT
- User Authentication – Register, login, and JWT-based authorization.
- Material Learning – API for listing and accessing study materials.
- Quiz / Practice Mode – Interactive question and answer system.
- Heart System – "Life" system (max 5) with automatic regeneration timer.
- Progress Tracking – Records quiz performance and learning history.
- Streak System – Tracks daily learning streaks.
| Model | Description |
|---|---|
User, UserProfile |
User data and learning statistics |
Material, MaterialContent |
Learning materials and multimedia content |
Question, AnswerOption |
Question bank with correct answer indicators |
HeartReward |
Heart/life system with regeneration timer |
LearningProgress |
Tracks user quiz performance and progress |
ScoreSession |
Stores quiz results and duration per session |
Streak |
Tracks user learning streak |
| Method | Endpoint | Description |
|---|---|---|
POST |
/auth/register |
Register new user |
POST |
/auth/login |
Login and generate token |
GET |
/materials |
Get list of materials |
GET |
/materials/:id |
Get detailed material content |
POST |
/quiz/start/:material_id |
Start quiz session |
POST |
/quiz/submit |
Submit quiz answers |
GET |
/progress/:user_id |
Get user progress |
GET |
/streak/:user_id |
Check learning streak |
PUT |
/hearts/regenerate |
Regenerate user hearts |
POST /auth/register
{
"username": "hisya",
"email": "hisya@example.com",
"password": "securepassword123"
}GET /materials/:id
{
"id": "uuid",
"title": "Introduction to Fractions",
"description": "Basic concept of fractions",
"contents": [
{ "type": "video", "link": "https://youtube.com/..." },
{ "type": "text", "text": "Fractions represent a part of a whole." }
]
}POST /quiz/submit
{
"user_id": "uuid",
"material_id": "uuid",
"answers": [
{ "question_id": "uuid", "selected_option": "uuid" },
{ "question_id": "uuid", "selected_option": "uuid" }
]
}🧭 Research Context
This backend was developed as part of a research project on gamified learning systems. It aims to explore:
How reward and progress systems impact learning motivation.
Secure backend design for educational platforms.
Efficient use of ORM and JWT in scalable systems.
📁 Project Structure
- /models → Database models (User, Material, Question, etc.)
- /routes → API route definitions
- /controllers → Feature logic
- /config → Database and environment setup
- /main.go → Application entry point