Giter Club home page Giter Club logo

hero-app's Introduction

Hero

FastAPI is a popular package nowadays, and I have decided to share my setup for an async web-server using this framework. The Hero app repository is an example of ultimate setup for async web-service.

Dependencies

Here is a short description of python packages used in the article (just to make a whole picture to save your time):

  1. Poetry - is a tool for dependency management and packaging in Python. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you;
  2. FastAPI - is a modern, fast (high-performance), web framework for building APIs with Python 3.6+ based on standard Python type hints;
  3. Pydantic - Data validation and settings management using Python type hinting;
  4. SQLAlchemy - SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL;
  5. SQLModel - SQLModel is a library for interacting with SQL databases from Python code, with Python objects;
  6. Alembic - Alembic is a lightweight database migration tool for usage with the SQLAlchemy Database Toolkit for Python.

Deployment

Use this command to build Docker container: docker build --build-arg ENV_FILE=".env" -t hero-app -f Dockerfile . And this command to start container: docker run -d -p "8080:80" --name hero-app hero-app

hero-app's People

Contributors

etretyakov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

hero-app's Issues

Having trouble with Relationship between models

When trying to create let say a role table and permission table with the relation role->permissions, when using the prefix to name the tables and using the same to set the foreign_key produce the error:

prefix = "rol"

Foreign key associated with column 'rol_permissions.role_id' could not find table 'rol_roles' with which to generate a foreign key to target column 'id'

If I change the f"{prefix}_roles" with "rol_roles" both in the name and the foreign key it works.

  1. Is there a flag or what can I do to maintain the same code and have relationship between tables?
  2. What about using relationship between models from different models?

Getting issue while running docker failing at alembic upgrade head

Dear Sir,
RUN alembic upgrade head
---> Running in abf1ce0bccc0
Traceback (most recent call last):
File "/usr/local/bin/alembic", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.10/site-packages/alembic/config.py", line 588, in main

KINDLY SUGGEST HOW TO RESOLVE THIS ISSUE

Thanks
srikanth

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.