Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPraktikum gocast API/v2 #1279

Draft
wants to merge 51 commits into
base: dev
Choose a base branch
from
Draft

IPraktikum gocast API/v2 #1279

wants to merge 51 commits into from

Conversation

carlobortolan
Copy link
Member

API/v2

Motivation and Context

This PR implements the current state of the new gocast gRPC API/v2 used by gocast mobile as part of the iPraktikum.
You can find a detailled documentation of all currently implemented gRPC methods in our Postman collection.

NOTE: This PR is currently only used to deploy the API/v2 on a test-server, feel free to review it, if you want, but please don't merge it yet.

Description

  • Add user endpoints
  • Add notification endpoints
  • Add course endpoints
  • Add stream endpoints
  • Add push notifications using Firebase Cloud Messaging when a VoD is uploaded

Files changed outside the api_v2 dir:

Changes related to push notifications:

For the push notifications, we went with Firebase Cloud Messaging, as it is also used by the TUM Campus APP. If you want to enable push notifications, see this setup guide (TL;DR: Add the fcmServerKey entry to the config.yaml and you're good to go).

Expose port 12544 for gRPC API/v2:

Steps for Testing

See Postman collection for different test cases for each gRPC method.

NOTE: As of now, the API/v2 has only been tested manually with the test cases that can be found on Postman; unit tests will be added over the next couple of weeks.

joschahenningsen and others added 19 commits November 17, 2023 08:55
* Implement fetching of current user from jwt token sent in request

* Implement GET:/user/me endpoint

* Update user message

* Update

* Clean up api_v2 file structure and implement , , , ,

* Add basic code-doc

* Add `last_name` attribute to the user table

* add bookmark, notification and alert endpoints

* Update errors for bookmark-endpoints

* Add course endpoints

---------

Co-authored-by: Achraf Labidi <[email protected]>
Co-authored-by: Moritz <[email protected]>
* Add postDeviceToken and notification_service.go

* Implement basic push notifications using FCM

* Implement basic push notifications using FCM

* Add note

* Add deleteDeviceToken endpoint

* Add fcm push notification service to worker_grpc

* Add serverKey to config.yaml and tools.config.go

* Add &model.Device{} to tumlive.go automigration

* Add FK to device_token model and update notification endpoints

* Remove TODOs
* add user settings functionality to get and patch user settings

* fix getting current user to change and get settings according to review
@carlobortolan carlobortolan added documentation Improvements or additions to documentation go Pull requests that update Go code docker Pull requests that update Docker code feature ✨ labels Dec 22, 2023
@carlobortolan carlobortolan self-assigned this Dec 22, 2023
Copy link

Your Testserver will be ready at https://1279.test.live.mm.rbg.tum.de in a few minutes.

Logins
Kurs1 Kurs2 Kurs3 Kurs4
public public loggedin enrolled
prof1 prof1 prof2 prof1
prof2
student1
student2
student3
student1
student2
student2
student3
student1
student2

@carlobortolan carlobortolan marked this pull request as ready for review January 12, 2024 13:02
@carlobortolan carlobortolan marked this pull request as draft January 12, 2024 16:39
carlobortolan and others added 18 commits January 12, 2024 17:45
* Add basic tests for course gRPC endpoints

* Add basic tests for gRPC notification endpoints

* Fix testdb

* Handle edge cases in stream and course endpoints

* Implement basic tests for gRPC stream endpoints

* Fix notification target bug

* Fix public courses visibility bug

* Run gofumpt -l -w ./api_v2

* Fix setup

* fix settings enum indexing, 3 months name change cooldown and validation for empty names

* add settings, bookmarks, pinned and user tests

* Fix typo in user tests

* Disable api_v2 tests

---------

Co-authored-by: Moritz <[email protected]>
@carlobortolan carlobortolan deleted the IPraktikum-dev branch July 4, 2024 23:11
@hmelder
Copy link

hmelder commented Jul 5, 2024

Why was this closed?

@hmelder hmelder restored the IPraktikum-dev branch July 5, 2024 08:43
@hmelder hmelder reopened this Jul 5, 2024
@carlobortolan
Copy link
Member Author

Why was this closed?

Looks like GitHub automatically closed the PR when I renamed the branch to enh/api_v2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker Pull requests that update Docker code documentation Improvements or additions to documentation go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[API] Deploy API/v2 on test server
4 participants