The backend for eduBoard, written in Go with httprouter and MongoDB.
- Install
dep
- Run
dep ensure
to install dependencies
The backend needs MongoDB to be connected. Connection parameters can be changed using ENV.
The easiest way to run the backend is using Docker. Just run docker-compose up
and you are done.
The traefik reverse proxy is used for https support. Some changes need to be made to traefik.toml
- change email to a valid email
- change domain to your domain
- move the file to /opt/traefik/traefik.toml
The watchtower makes sure that you that you always have the newest eduboard version running.
You can start it over the command line (your container name might be different from eduboard_server_1
)
docker run -d \ --name watchtower \ -v /var/run/docker.sock:/var/run/docker.sock \ v2tec/watchtower eduboard_server_1
/
reservered for frontend static files
-
/api/register
Register a new user.{ "name": "Mathias", "surname": "Hertzel (optional)", "email": "mathias.hertzel@example.com", "password": "supersecret" }
{ "name": "Mathias", "surname": "Hertzel", "email": "mathias.hertzel@example.com", "password": "supersecret" }
-
/api/login
Login an existing user.{ "email": "mathias.hertzel@example.com", "password": "supersecret" }
{ "name": "Mathias", "surname": "Hertzel", "email": "mathias.hertzel@example.com" }
-
/api/logout
Logout current user.
-
/api/v1/me
GET own user (based on SessionToken).{ "id": "12345", "name": "Mathias", "surname": "Hertzel", "email": "mathias.hertzel@gmail.com" }
-
/api/v1/users/:id
GET users.{ "id": "12345", "name": "Mathias", "surname": "Hertzel", "email": "mathias.hertzel@gmail.com" }
-
/api/v1/users/:id/courses
GET all courses a member is subscribed to[ { "id:": "1", "title": "Course 1", "description": "a short description" }, { "id": "2", "title": "Course 2", "description": "another short description" } ]
-
/api/v1/courses/
GET all accessible courses[ { "id:": "1", "title": "Course 1", "description": "a short description" }, { "id": "2", "title": "Course 2", "description": "another short description" } ]
-
/api/v1/courses/:id
GET a certain course{ "id": "1", "title": "Course 1", "description": "a short description", "members": [ "12345", "12346" ], "labels": [ "123", "124" ], "entries": [ { "id": "1", "date": "2018-06-20 15:04:05", "message": "test test", "pictures": [ "https://example.com/picture1.png", "https:/example.com/picture2.jpg" ] }, { "id": "2", "date": "2018-06-20 15:12:48", "message": "hello world", "pictures": [ "https://example.com/picture1.png", "https:/example.com/picture2.jpg" ] } ] }
-
/api/v1/courses/:id/users
GET all subscribed members from a course[ { "id": "12345", "name": "Mathias", "surname": "Hertzel", "email": "mathias.hertzel@gmail.com" }, { "id": "12345", "name": "Mathias", "surname": "Hertzel", "email": "mathias.hertzel@gmail.com" } ]
-
/api/v1/courses/:id/users/subscribe
POST user ids that will be subscribed to the course Input[ { "id": "1" }, { "id": "2" } ]
-
/api/v1/courses/:id/users/unsubscribe
POST user ids that will be unsubscribed from the course Input[ { "id": "1" }, { "id": "2" } ]