Coder Social home page Coder Social logo

Comments (6)

tiangolo avatar tiangolo commented on May 2, 2024 2

I'm glad it's been useful!

Yes, that's the next thing I'll do, an equivalent to this project but based on FastAPI. I hope to release it in the next days / week.

As everything is very modular, you can add your Angular code to replace the Vue.js frontend but keeping the Docker multi-stage build (if you want more details on Docker multi-stage build for Angular, check: https://medium.com/@tiangolo/angular-in-docker-with-nginx-supporting-environments-built-with-multi-stage-docker-builds-bb9f1724e984).

As the backend uses SQLAlchemy, you will be able to replace the PostgreSQL with MariaDB (or MySQL) very easily, mainly changing the Docker DB image.

About Nginx, as FastAPI is asynchronous, using Uvicorn with ASGI (instead of WSGI), is production ready, you don't need Nginx. Actually, it has some of the best achievable performances: https://fastapi.tiangolo.com/#performance

And if you use FastAPI you can use the official image: https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker

from full-stack.

bryanray67 avatar bryanray67 commented on May 2, 2024

Hello Sebastián.
Thank you for your reply. I see your comment about Nginx is not needed if I'm using FastAPI and Uvicorn. This is my misunderstanding. I thought Nginx would be needed to serve static files (html/css etc...) and FastAPI was only for the api. I will read up on how to serve my Angular static files with Uvicorn.
Regards,
Bryan

from full-stack.

tiangolo avatar tiangolo commented on May 2, 2024

Ah, get it. Actually, Nginx makes sense for your static files (and frontend). This stack (and the next one) have Nginx serving the frontend. But only that service. The backend is served by Uvicorn managed by Gunicorn.

from full-stack.

tiangolo avatar tiangolo commented on May 2, 2024

Here it is! 🎉 🍰 🚀

FastAPI with PostgreSQL using SQLAlchemy: https://github.com/tiangolo/full-stack-fastapi-postgresql

You can change it to MariaDB or MySQL by modifying a couple of lines in the docker-compose files and a couple of lines in the code and the Alembic configs. But as it uses SQLAlchemy, most of the code should be quite standard for any of these relational DBs.

from full-stack.

tiangolo avatar tiangolo commented on May 2, 2024

Hi @bryanray67 , I'll assume you were able to solve your problem and I'll close this issue now.


If you are still using this project, I suggest you check the equivalent project generator for FastAPI that solves the same use cases in a much better way.

Because of that, this Flask-based project generator is now going to be deprecated. You are still free to use it, but it won't receive any new features, changes, or bug fixes.

from full-stack.

Nsandomeno avatar Nsandomeno commented on May 2, 2024

@bryanray67 @tiangolo #23 (comment)

I'm having a lot of trouble fixing the Alembic config for this, any chance you can give me an idea for that?

I've done the docker-compose(image), alembic/env.py (env variables), app/core/config.py (PostgresDsn --> AnyUrl, and env variables), as well as added the drivers as dependencies in pyproject.toml (have tried all drivers because of a consistent ACCESS DENIED error from the backend with credentials that work from within the docker container itself) prior to building the image (from a clean spot as well). Here is a bit more info if anyone has a few minutes: PyMySQL/PyMySQL#909 (comment)

from full-stack.

Related Issues (16)

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.