Version: v1.0.0
This project aims to develop a teaching tool integrated with GitLab to manage digital classrooms, distribute assignments, and automate the grading of students' work. Traditional learning management systems often lack integration with version control systems like Git, making it difficult to manage and evaluate programming tasks. This project addresses that gap by creating a standalone application that interacts with GitLab's API. The solution enables instructors to create and manage classrooms, assign programming tasks, and implement both manual and automated grading systems. Through features like OAuth-based authentication, team management, and GitLab repository integration, the tool facilitates efficient course management, offering both autonomy and data sovereignty to educational institutions.
The project has two parts:
- Golang with fiber as backend=>
/
- React with Typescript and vite as Frontend =>
/frontend/
The frontend proxies the requests for the path /api/*
to the backend server.
Docker Compose is used to deploy the application.
- Cloning the repository
Alternatively, you can directly use the docker-compose.yaml and .env.example files. - Configure environment variables
cp .env.example .env
- Creating an application in GitLab
- Create a new application in GitLab with the following Redirect URI:
<PUBLIC_URL>/api/v1/auth/gitlab/callback
- Set the application to confidential (Confidential: true) and select the scope "api". These are the default settings.
- Copy the
Application ID
andSecret
into the.env
file and add the URLs forPUBLIC_URL
andGITLAB_URL
.
- Create a new application in GitLab with the following Redirect URI:
- SMTP configuration
Add SMTP credentials to send invitation emails. - Configure the database in the
.env
file. - Starting the application
To start the application and a PostgreSQL database using Docker Compose:docker compose up –env-file .env -d
Alternatively, deployment can also take place with an already present PostgreSQL server by running only the application image
Create .env like specified above and add the database credentials of your existing database. and run the image like:
docker run -d --env-file .env --name git-classrooms -p 3000:3000 ghcr.io/git-classrooms/git-classrooms:latest
For development, we use the git flow branching model for simplicity.
The Setup for development is documented in the following file dev_setup.md
The following file-types in our repo are auto-generated:
- mocks
- gorm-gen queries
- swagger documentation
- swagger-client
The first three types are generated when running go generate
which is automatically executed before each build when running the app through air.
To generate the frontend swagger-client
after some changes to the docs the following script needs to be executed:
# Linux / Mac / WSL
./script/swagger-codegen.sh
# Windows
./script/swagger-codegen.ps1
To test the completely build image locally you can use the following command:
docker compose -f docker-compose.dev.yml up --build
And access the application via http://localhost:3000
- Run the app described in Dev-Setup
- Add Swag comments directly above your endpoint
- Visit the page
http://localhost:5173/docs.html
- Click on the
Sign-In
-Button on the top-right - Get your csrf-token
- Test your endpoints
- Refresh page after swag-comments were edited
- Login via gitlab in the browser
- Copy the session_id cookie from the browser to your postman environment
- Copy the csrf_ cookie from the browser to your postman environment
- Add the following header to your
POST|PUT|PATCH|DELETE
requests:X-CSRF-Token: {{csrf_}}
...
To run the test simply exec the following script:
# Linux / Mac / WSL
./script/test_backend.sh
./script/test_frontend.sh
# Windows
./script/test_backend.ps1
./script/test_frontend.ps1
We have to environments:
- Staging:
https//staging.hs-flensburg.dev