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

Add fastapi app #35

Merged
merged 7 commits into from
Apr 3, 2024
Merged

Conversation

ricardogsilva
Copy link

@ricardogsilva ricardogsilva commented Mar 29, 2024

This PR adds a FastAPI app to serve as the entrypoint for the backend.

Fixes #36

It is composed of one main app which then mounts three sub-apps. These are accessible at the following prefixes:

  • /legacy - This is where the original django web app is mounted. It is ran with the FastAPI WSGIMiddleware and the implementation is based on the FastAPI docs, but with some considerable modifications in order to adapt to django. The django app's admin pages static files are also served by FastAPI using an additional mount
  • /v1 - This contains a reimplementation of the legacy app's API, done using FastAPI and pydantic. It thus provides an openapi document and some dev docs, which document how it can be used. Not all path operations are reimplemented yet, but at least the API documentation should be
  • /v2 - This contains an initial draft of what a more flexible API could look like. There aren't many endpoints in it yet, but it notably contains a proxy to THREDDS which is able to serve WMS requests.

Also included:

  • Unified settings management, whereby the settings for the django application are provided by pydantic
  • CLI commands to:
    • Launch the server using uvicorn
    • Run django-admin commands
  • Refactor of the Dockerfile in order to cope with the new FastAPI application
  • Refactor of the docker compose file
  • Refactor of the tests in order to cope with the new FastAPI application

@ricardogsilva ricardogsilva marked this pull request as ready for review April 2, 2024 17:59
@francbartoli francbartoli merged commit c2470f2 into geobeyond:main Apr 3, 2024
1 check passed
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 this pull request may close these issues.

create FastAPI application and use it as the main backend entrypoint
2 participants