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

v1 backend migration #7

Closed
13 of 36 tasks
joschahenningsen opened this issue Nov 21, 2021 · 16 comments
Closed
13 of 36 tasks

v1 backend migration #7

joschahenningsen opened this issue Nov 21, 2021 · 16 comments

Comments

@joschahenningsen
Copy link
Member

joschahenningsen commented Nov 21, 2021

Cronjobs

Endpoints

This is a list of endpoints that should be served here (via rest and grpc):
Update Note (previously unused in the Android app ⇒ needs a discussion)

Members/Users

  • POST /members/:lrz_id

notifications

  • GET /notifications
  • GET /notifications/confirm/:notification_id

Device

  • POST /device/register
  • GET /device/verifyKey
  • POST /device/addGcmToken
  • GET /device/uploaded/:lrz_id

Feedback

Cafeterias

  • GET /mensen

Kinos

News

other endpoints

Study Rooms (basically just a thin API-Wrapper around iris' api. Unclear if needed)

  • GET /studyroom/list

Events And Tickets (currently unused ⇒ needs a discussion if this is needed)

  • GET /event/list
  • POST /event/ticket/my
  • POST /event/ticket/:ticket_id
  • GET /event/ticket//type/:event_id
  • POST /event/ticket/reserve/multiple
  • POST /event/ticket/payment/stripe/purchase/multiple
  • POST /event/ticket/payment/stripe/ephemeralkey
  • GET /event/ticket/status/:event_id

Offloaded to [NavigaTUM](https://github.com/TUM-Dev/NavigaTUM)

Opening Hours

  • GET /openingtimes/:language
  • GET /locations/:location_id
  • GET /barrierfree/contacts
  • GET /barrierfree/getBuilding2Gps
  • GET /barrierfree/nerby/:building_id
  • GET /barrierfree/listOfToilets
  • GET /barrierfree/listOfElevators
  • GET /barrierfree/moreInformation

@joschahenningsen joschahenningsen added the good first issue Good for newcomers label Nov 21, 2021
@kmodexc
Copy link

kmodexc commented May 10, 2022

Is openingtimes already migrated? I could not find it.

@kordianbruck
Copy link
Member

Nope, that isn't being worked on yet.

@barisconur
Copy link

I am going to work on this task in the following weeks.

@barisconur
Copy link

Could you please give me some information about the migration? Is there a new api version and do we want to migrate these endpoints to the new one?

@joschahenningsen joschahenningsen changed the title Migrate existing endpoints Implement existing endpoints May 18, 2022
@kmodexc
Copy link

kmodexc commented May 18, 2022

As i understand it, the old backend is private source so you cant take that as a starting point.

Some of these will be implemented in #1422

The code is located in the campus-backend repo and there is a swagger file so this is where you might start.

@joschahenningsen
Copy link
Member Author

Yes, we basically want to reimplement the current (closed source) api written in php. It might make sense to open source it to aid the progress here. Let's discuss this in the next team meeting (ping @kordianbruck)

For further discussion I suggest meeting up about this on discord? @barisconur You're on the server already, right?

@barisconur
Copy link

barisconur commented May 18, 2022

@joschahenningsen I am not on the server. Could you please send dc server link?
@kordianbruck When is the next team meeting?

@joschahenningsen
Copy link
Member Author

@barisconur https://discord.gg/WSRzBkr7

Next meeting is scheduled for June, first @ 7PM

@barisconur
Copy link

Yes, we basically want to reimplement the current (closed source) api written in php. It might make sense to open source it to aid the progress here. Let's discuss this in the next team meeting (ping @kordianbruck)

Hello again. I am going to work on this migration endpoints in the next 2 weeks. How can I access the source code of old api written in php.

@barisconur
Copy link

Yes, we basically want to reimplement the current (closed source) api written in php. It might make sense to open source it to aid the progress here. Let's discuss this in the next team meeting (ping @kordianbruck)

Hello again. I am going to work on this migration endpoints in the next 2 weeks. How can I access the source code of old api written in php.

Additionally, I created a new branch and I am trying to push it to the repo but it throws the error below.
remote: Permission to TUM-Dev/Campus-Backend.git denied to barisconur. fatal: unable to access 'https://github.com/TUM-Dev/Campus-Backend.git/': The requested URL returned error: 403

@tobiasjungmann
Copy link
Collaborator

You can not directly push to this repository if you are not a member. Instead you have to fork the repository, clone your fork (or set the git parameters in the version you have downloaded at the moment). Then you can push commits to your forked repo. These commits can then be added with a Pull Request from your forked repo to this repository.

@barisconur
Copy link

@tobiasjungmann I am stuck at connecting my local database. I created a mariadb running container with:
docker run --detach \ --name mariadb-tum-backend \ --env MARIADB_USER=root \ --env MARIADB_ROOT_PASSWORD=example \ --restart always \ -p 3306:3306 \ --volume "$(pwd)"/init.sql:/init.sql \ mariadb:latest --init-file /init.sql

I am able to connect it via DataGrip but I am not sure how to connect it in main.go. I tried: // main.go line 49-50
// conn = sqlite.Open("test.db") conn = mysql.Open("jdbc:mariadb://localhost:3306")

@joschahenningsen
Copy link
Member Author

@barisconur no need to modify the code. To connect to the local mariadb you have to add the database connection string (root:example@tcp(localhost:3306)/tca-portal?charset=utf8mb4&parseTime=True&loc=Local) to your environment variables like this:

image
image
image

@barisconur
Copy link

@barisconur no need to modify the code. To connect to the local mariadb you have to add the database connection string (root:example@tcp(localhost:3306)/tca-portal?charset=utf8mb4&parseTime=True&loc=Local) to your environment variables like this:

image image image

Hello,
It throws this error:
image

I also tried with:
root:example@tcp(localhost:3306)/mariadb-tum-backend?charset=utf8mb4&parseTime=True&loc=Local

I changed tca_portal to mariadb-tum-backend.

@joschahenningsen
Copy link
Member Author

Not sure if you successfully imported the database schema. If not, open the database connection in dataGrip, create a new query console, run CREATE DATABASE tca-portal; and then run this script on the database: https://raw.githubusercontent.com/TUM-Dev/Campus-Backend/db-models/model/souce-schema.sql

@barisconur
Copy link

https://raw.githubusercontent.com/TUM-Dev/Campus-Backend/db-models/model/souce-schema.sql

Thanks. But it gives sql syntax error for "CREATE DATABASE tca-portal;". So I changed it to "tca_portal". But then the script threw some errors afterwards.
image
image

@tobiasjungmann tobiasjungmann mentioned this issue Jun 12, 2022
5 tasks
@CommanderStorm CommanderStorm changed the title Implement existing endpoints v1 backend migration Sep 13, 2023
@CommanderStorm CommanderStorm removed the good first issue Good for newcomers label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants