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

feat: Set up the Fastapi project #2

Merged
merged 45 commits into from
Oct 6, 2020
Merged

feat: Set up the Fastapi project #2

merged 45 commits into from
Oct 6, 2020

Conversation

frgfm
Copy link
Member

@frgfm frgfm commented Oct 4, 2020

This PR aims at setting up the fastAPI project by:

  • setting up a basic fastapi project structure
  • adding routes for users, sites, events, devices, media, installations and alerts
  • adding CI jobs for lint checking, deps installation, docker container tests

Here is how the documentation renders:
fastapi_docs

Also, once the fastapi server is run, it can be easily accessed using postman for instance:
fastapi_postman

As of now, I implemented the CRUD methods for each route but only added unittests for the "users" route. I'll open up another PR to conduct unittests on the remaining routes.

Any feedback is welcome!

@frgfm frgfm added topic: docs Improvements or additions to documentation type: improvement New feature or request topic: build Related to build, installation & CI endpoint: users endpoint: sites endpoint: events endpoint: cameras labels Oct 4, 2020
@frgfm
Copy link
Member Author

frgfm commented Oct 5, 2020

FYI: there is an option to work on an admin page over there

@florianriche florianriche self-requested a review October 5, 2020 11:40
@florianriche florianriche reopened this Oct 5, 2020
florianriche
florianriche previously approved these changes Oct 5, 2020
Copy link
Contributor

@florianriche florianriche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me althought I have a shallow understanding of fastapi.
You may wish to wait for a more knowledgeable reviewer.

@jean-pasquier
Copy link
Contributor

Great job @frgfm I could play with the API thanks to docker-compose really quickly, well done ! FastAPI seems to get more and more partisans so it should not be a problem to find resources/tuto/etc.

Maybe the way it is designed right now is a bit monolithic and should be okay for MVP, a more sustainable option could be using microservices like described in this article but it may be not the priority thinking about scalability 🙂

README.md Outdated Show resolved Hide resolved
@fe51
Copy link
Member

fe51 commented Oct 6, 2020

Nice PR (full of unittest :) ) !
I am not very familiar with fastapi yet, but as a start this design suits me (and let's dig a little deeper into the possibility of using microservices)

fe51
fe51 previously approved these changes Oct 6, 2020
@frgfm frgfm merged commit 528b212 into master Oct 6, 2020
@frgfm frgfm deleted the fastapi-setup branch October 6, 2020 13:31
This was referenced Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants