3.4 KiB
3.4 KiB
Yimaru Backend
Yimaru Backend is the server-side application that powers the Yimaru online learning system. It manages courses, lessons, quizzes, student progress, instructor content, and administrative operations for institutions and users on the platform.
Table of Contents
- Installation
- Environment Configuration
- Running the Application
- Database Management
- Testing and Code Quality
- API Documentation
- Project Structure
- Core Services Overview
- Roles and Access Control
- Code Organization Guidelines
- Further Details
Installation
Before running the application, ensure you have the following installed:
Clone the repository:
git clone https://github.com/your-org/Yimaru-backend.git
cd Yimaru-backend
├── cmd/
│ └── main.go # Application entry point
├── internal/
│ ├── config/ # Configuration and environment loading
│ │ └── config.go
│ ├── domain/ # Domain models, constants, and roles
│ │ ├── course.go # Course and lesson structures
│ │ └── roles.go # Role definitions (e.g., RoleAdmin, RoleInstructor)
│ ├── repository/ # Database interaction layer
│ │ ├── course.go # Course-related queries
│ │ ├── lesson.go # Lesson-related database functions
│ │ ├── user.go # User repository methods
│ │ └── ... # Other repository files
│ ├── services/ # Business logic and core services
│ │ ├── course/
│ │ │ └── service.go # Course management logic
│ │ └── quiz/
│ │ ├── service.go # Quiz management and evaluation logic
│ │ └── eval.go # Evaluation logic for student progress
│ └── web_server/ # HTTP handlers, routes, middleware, and cron jobs
│ ├── cron.go # Scheduled background tasks
│ └── handlers/
│ ├── course_handler.go # Course-related API endpoints
│ ├── user_handler.go # User-related endpoints
│ └── ... # Additional handlers
├── db/
│ └── migrations/ # SQL migration files
├── docs/
│ ├── swagger/ # Swagger/OpenAPI documentation files
│ └── docs.go # Swaggo-generated docs
├── gen/
│ └── db/ # SQLC-generated Go code for database access
├── makefile # Development and operations commands
├── .env # Environment configuration file
└── README.md # Project documentation