Coder Social home page Coder Social logo

bibektimilsina000 / fastapi-pgstarterkit Goto Github PK

View Code? Open in Web Editor NEW
74.0 74.0 22.0 17.16 MB

FastAPI & PostgreSQL starter kit with Docker. Revamped backend template for modern needs.

Dockerfile 0.45% Python 76.86% Mako 0.69% HTML 21.62% Shell 0.38%
backend backend-api backend-development backend-template docker dockerized-backend fastapi fastapi-starter-kit fastapi-te modern-backend pgadmin postgresql swagger

fastapi-pgstarterkit's People

Contributors

gmos avatar nsxsnx avatar romstar 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

Watchers

 avatar  avatar  avatar  avatar  avatar

fastapi-pgstarterkit's Issues

Doesn't run - not reachable

I downloaded the repo and ran docker-compose up --build

and got this:
image

I tried going to http://localhost:8000/docs as per the readme but got "This site can’t be reached"
I also noticed in the screenshot above that the uvicorn port says 80, not 8000? But even going to localhost:80 doesn't work either though

JWT Secret should come from an environment variable

Currently the config.py file sets the JWT secret to a random 32 character string upon the service startup and this is a really bad practice because in the wild this would force every single user to relogin upon a deployment among many other issues.

Also, the line load_dotenv() needs to exist before the definition of the class Settings otherwise environment variables aren't available within the Settings class.

how to run the tests?

AWESOME work!

I was wandering, though, how can I run the tests? In the "original" tiangolo version, there are a bunch of scripts that creates testing stack and run the tests on it. I'm trying to run the tests from your version with just pytest, but they're not passing 😒

Screenshot 2023-08-19 at 18 57 21

SQLModel

I want to include SQLModel in the backend to remove redundancies between models and schemas. Would that fit your plans with the repo?

What are the steps for adding new models / tbls?

If I make model changes then run:

alembic revision --autogenerate -m "Added ..."

I get the following error:

    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name "db" to address: nodename nor servname provided, or not known

Cannot run the default package

Hi. I got this error right after I installed package and run docker-compose up --build.

fastapi-app_1 | INFO:__main__:Initializing service fastapi-app_1 | INFO:__main__:Starting call to '__main__.init', this is the 1st time calling it. pgadmin | NOTE: Configuring authentication for SERVER mode. pgadmin | pgadmin | pgAdmin 4 - Application Initialisation pgadmin | ====================================== pgadmin | pgadmin | postfix/postlog: starting the Postfix mail system pgadmin | [2023-08-19 23:17:06 +0000] [1] [INFO] Starting gunicorn 20.1.0 pgadmin | [2023-08-19 23:17:06 +0000] [1] [INFO] Listening at: http://[::]:80 (1) pgadmin | [2023-08-19 23:17:06 +0000] [1] [INFO] Using worker: gthread pgadmin | [2023-08-19 23:17:06 +0000] [91] [INFO] Booting worker with pid: 91 fastapi-app_1 | ERROR:__main__:(psycopg2.OperationalError) connection to server at "db" (172.18.0.2), port 5432 failed: Connection timed out fastapi-app_1 | Is the server running on that host and accepting TCP/IP connections? fastapi-app_1 | fastapi-app_1 | (Background on this error at: https://sqlalche.me/e/20/e3q8) fastapi-app_1 | WARNING:__main__:Finished call to '__main__.init' after 129.312(s), this was the 1st time calling it. fastapi-app_1 | INFO:__main__:Starting call to '__main__.init', this is the 2nd time calling it.

Deployment guide

Hi guys,

First of all, Thank you very much for this amazing starterKit :)

Are there some deployment guidelines?
I am trying to follow the one provided here but it would be definitely better if there were a Deployment guide specifically designed for this starterKit.

Cheers

problem on mac

Thanks a lot for working on getting this live! I tried to run this on mac and I am getting this issue: any idea on how to fix this? Thanks in advance!

Building 0.7s (2/3) docker:desktop-linux
[+] Building 1.2s (3/3) FINISHED docker:desktop-linux
=> [fastapi-app internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 288B 0.0s
=> [fastapi-app internal] load .dockerignore 0.1s
=> => transferring context: 111B 0.0s
=> ERROR [fastapi-app internal] load metadata for docker.io/library/python 0.6s

[fastapi-app internal] load metadata for docker.io/library/python:3.11-slim:


failed to solve: python:3.11-slim: error getting credentials - err: exit status 1, out: ``

Celery to be or not.

What are your plans with Celery? It's now in the code but there is no Celery container. Add Celery or remove the support? Now it fails the test case every time.

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.