This repository consists of Course Management System Backend code. It follows clean architecture.
.
├── .gitignore
├── dockercompose.yml
├── Dockerfile
├── go.mod
├── go.sum
├── LICENSE
├── main.go
├── README.md
├── sample.env
├── common
│ ├── db
│ │ ├── db.go
│ │ └── services.go
│ ├── migrations
│ │ └── migrations.go
│ ├── schemas
│ │ ├── schemas.go
│ │ └── validations.go
│ ├── utils
│ │ ├── jwt_utils.go
│ │ ├── list_utils.go
│ │ ├── validator_utils.go
│ │ └── viper_utils.go
│ └── views
│ └── views.go
├── config
│ └── config.go
├── pkg
│ ├── models
│ │ ├── course.go
│ │ └── user.go
│ └── services
│ ├── course
│ │ ├── postgres.go
│ │ └── service.go
│ └── user
│ ├── postgres.go
│ └── service.go
├── README.md
└── src
└── core
├── controllers
│ └── controllers.go
├── middlewares
│ └── middlewares.go
├── routers
│ └── routers.go
└── server
└── server.go
Overview of the layout:
.gitignorecontains all files to be ignored for github.README.mdis a detailed description of the project.srccontains all micro services.pkgcomprises business logic.commonconsists of common code, important to the application
Before running make sure to add .env file. Refer sample.env
go run main.go
Table 1: users
All the users including superadmin, admin, employee.
Table 2: courses
All the courses designed by a user (admin). Hence user_id
in courses will refer to id in users.
Table 3: viewed_courses (join table between users and courses)
This table is a result of many-to-many relationship between
users and courses. If the user U has viewed course C, we insert U & C as a
composite primary key in viewed_courses. If U has completed C, we mark
is_completed to be true. We get to know the course completion status by
completed_duration attribute in the table.
