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

First set of API refactor changes #797

Merged
merged 16 commits into from
Nov 2, 2020
Merged

First set of API refactor changes #797

merged 16 commits into from
Nov 2, 2020

Conversation

mattyweb
Copy link
Collaborator

@mattyweb mattyweb commented Aug 27, 2020

Lot's of work being done:

  • Added new materialized views (councils, regions, request_types, service_requests)
  • Added FastAPI and Gino
  • Added ORM-based routes for new views
  • Added CORS
  • Added OpenAPI docs
  • Added index route to expose legacy services as-is

To try it:

  1. Start new server from API directory with python code/run
  2. Ensure Test API is running with welcome message at http://localhost:5000/
  3. Test API using OpenAPI at http://localhost:5000/docs
  4. Run the ReactJS app to make sure frontend works

Status of legacy APIs for services;

  • '/'
  • '/status/api'
  • '/status/sys'
  • '/status/db'
  • '/servicerequest/
  • '/map/clusters'
  • '/map/heat'
  • '/map/pins'
  • '/visualizations'
  • '/comparison/frequency'
  • '/comparison/timetoclose'
  • '/comparison/counts'
  • '/open-requests'
  • '/feedback'

@mattyweb mattyweb added the Do Not Merge Do not merge this PR, it is likely blocked by something else label Aug 27, 2020
@mattyweb
Copy link
Collaborator Author

mattyweb commented Sep 1, 2020

Added routes for all legacy endpoints.
Can't test the /feedback route since I'm lacking the GitHub credentials.
Started some shim routes that use legacy formats but point to new (async) database code.

@mattyweb
Copy link
Collaborator Author

mattyweb commented Sep 2, 2020

  • now starting the FastAPI via python code/run.py
  • simplified the Docker base image with one that includes gcc etc. rather than having to install it
  • need to make sure that .env file exists in api folder which is used by image (just rename env.example)

postman tests are failing now however. not sure why. need to investigate.

@mattyweb
Copy link
Collaborator Author

mattyweb commented Sep 3, 2020

compose is working now and setting the proper environment variables

there are 4 postman tests that are still failing:

  • 2 are expecting 400 errors whereas the new API sends 422 errors for bad input data
  • the other 2 are sending city council districts and that might be causing problems

@jmensch1 jmensch1 force-pushed the 796-major-backend-refactor branch from 34c6c80 to 5b916f8 Compare September 4, 2020 00:02
@jmensch1 jmensch1 merged commit a1f94c7 into dev Nov 2, 2020
@jmensch1 jmensch1 deleted the 796-major-backend-refactor branch November 2, 2020 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Do Not Merge Do not merge this PR, it is likely blocked by something else
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants