Giter Site home page Giter Site logo

Comments (4)

valentierra avatar valentierra commented on May 21, 2024

Recently I came across Zeit and was impressed by its integration of services towards the serverless. I am trying to develop the Zeit builders for this full-stack. I think this is the best approach for those who just want to devote themselves to developing their own application.

from full-stack-fastapi-couchbase.

tiangolo avatar tiangolo commented on May 21, 2024

Hi @valentierra ! Sorry for the delay.

I guess that using those tools/services you probably wouldn't use/need containers. The drawback might be the vendor locking I guess.

Frontend on Netlify

You can have your frontend built on Netlify building servers directly. Or if you want to do it in Docker, you can push the built code as part of the build process.

In Netlify you would get a somecustomdomain.netlify.com. You can set a DNS record (a CNAME) to point somecustomdomain.com to somecustomdomain.netlify.com. That way, whenever someone goes to somecustomdomain.com, they will see your content served from Netlify.

Frontend CORS

Then you just have to add that domain to your CORS in your backend (in the backend.env file if you use a recent version of this stack).

And that's it, it doesn't matter that your frontend is actually served by Netlify, as long as your backend has the host (https://somecustomdomain.com) in its configuration of CORS.

Backend in AWS/GCP

AWS and GCP can provide you virtual machine instances. Those are just standard Linux instances. You normally have sudo in those machines. And normally, each instance gets a fixed public IP for as long as it exists.

If you plan on removing them and changing them and you want to keep a fixed IP, you can add "floating IPs" (each one has its name for them) and then redirect them to your VM.

Backend in PaaS, Heroku, Google App Engine, etc

If you use one of the "platform as a service" systems, where you don't have control of an actual Linux instance behind, but you just provide your code to some system and it runs it, you are, more or less, in their hands. Some people like it some don't. Setting up IPs, ports, domains, HTTPS, all that is done through their custom private systems.

In that case, you would probably also use one of their "database as a service", like Heroku's Postgres, AWS and Google Cloud have their own versions and also several custom "NoSQL" versions. You would probably not use Couchbase in that scenario. But you would have to adapt your code to use those databases.

Less things to worry yourself (they handle the DB) in exchange of more vendor locking and price fee.

Backend in Function as a service

If you want to use one of the Function as a service (also called "serverless") systems, you might want to try https://github.com/erm/mangum, with it, you can put FastAPI in one of these services.

This gives even more responsibility to the service provider.

from full-stack-fastapi-couchbase.

valentierra avatar valentierra commented on May 21, 2024

Thank you @tiangolo!

Impeccable answer! Your feedback is much appreciated!

I am closing the issue but keep posting if I find something with the merit to add/comment.

Cheers!

from full-stack-fastapi-couchbase.

tiangolo avatar tiangolo commented on May 21, 2024

Awesome, thanks!

from full-stack-fastapi-couchbase.

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.