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

Closes #8 Replace flask with fastapi #26

Merged

Conversation

leelaprasadv
Copy link

@leelaprasadv leelaprasadv commented Nov 6, 2020

Hey @adiralashiva8 ,

First of all - this is an awesome tool!

Here is a PR to replace Flask with Fast API along with few refactoring and optimizations
Closes #8

Change log:

Enhancements:

  • Replaced Flask with FastAPI
  • Serves static content on /static http path (using aiofiles and jinja2 templates)
  • All routes are moved to a routes.py, this makes the main app.py easy to read and understand.
  • Added a dal mysql adaptor for mysql db interactions. This avoids redundant code for connection object from being added.
  • MySql connection object can be created with various predefined connection arg params as a dict
  • Added support for managing configuration object through out applications
  • Swagger support with FastAPI inbuilt
  • Added a docker-compose.yml to local building of mysql in docker container and testing.

Refactoring

  • Changes to html and static assets for relative paths since static content will now be served on /static .
  • Mysql
    • Replaced with mysql-connector-python.
    • Connection object usage in all modules.
    • Adjusted mysql queries for syntax changes.
  • Adjusted all routes to FastAPI standards/syntax.
  • Refactored other modules to follow the changes above.
  • Updated setup.py with version and dependency packages information.
  • Updated README.md with latest instructions and information.

### Note: Changes are tested with MySql version 5.7

PS: The UI for rfhistoric remains the same, below swagger is a nice default addition by FastAPI

Attached screenshot of FastAPI swagger UI after changes.
image

Cheer!
Prasad

Change Log:
* Replaced Flask with FastAPI
* All Static files are now served at `/static`
* Configuration object support
* MySQL DB connection factory/adaptor refactoring
Change Log:
* Updated version in README.md
* Refactored reparser
* Updated version in setup.py
@leelaprasadv leelaprasadv changed the title Closes adiralashiva8/robotframework-historic#8 Replace flask with fastapi closes adiralashiva8/robotframework-historic#8 Replace flask with fastapi Nov 6, 2020
@leelaprasadv leelaprasadv changed the title closes adiralashiva8/robotframework-historic#8 Replace flask with fastapi Closes #8 Replace flask with fastapi Nov 6, 2020
@adiralashiva8
Copy link
Owner

Thanks a lot @leelaprasadv for pull request and improvements let me try these changes

@adiralashiva8 adiralashiva8 changed the base branch from master to fast-api November 9, 2020 04:57
@adiralashiva8 adiralashiva8 merged commit bfa0963 into adiralashiva8:fast-api Nov 9, 2020
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.

Use Fast API instead of Flask
2 participants