Coder Social home page Coder Social logo

reflex-on-fly's Introduction

reflex-on-fly

GH Actions driven continuous deoployment of Reflex App.

Application Architecture

Backend: Deployed to fly.io

Frontend: Served from Cloudflare Pages

Database: Uses Fly.io Postgres

Prerequisites

The following must be derived ahead of using the repo's Continuous Deployment process.

In this Github repo, go to Settings -> Secrets and enter the following:

FLY_API_TOKEN - You must have a valid fly.io account and run the flyctl tool locally.

CLOUDFLARE_ACCOUNT_ID - Identifies your Cloudflare Account

CLOUDFLARE_API_TOKEN - This must be scoped to include Edit permissions for the Account's Cloudflare Pages. If you wish to reuse this same token for provisioning Cloudflare DNS, the token scope should include Zone:DNS edit permissions.

Provisioning Cloudflare Pages

This should be setup before any application CI/CD runs. Use Terraform to spin up Cloudflare Pages resources. You must provide the following variables to the Terraform run:

cloudflare_token - As described earlier

cloudflare_account_id - As described earlier

cloudflare_zone_id - Cloudflare DNS Zone id

cloudflare_project_name - Use this to identify your Cloudflare pages project. It will be used as the subdomain on which your pages app is served from, e.g. ${cloudflare_project_name}.yourdomain.com. Note that the same value should be passed in as variable to the deploy_backend github workflow.

Provisioning Tigris Object Data store

We must create an object store (bucket) to host the frontend of the application. See here for a step by step guide. First, create a public bucket with a name that matches the CNAME of the host you will serve the app from, e.g.

fly storage create images.myapp.com --public

Optionally the bucket can be given a custom domain:

fly storage update images.myapp.com --custom-domain images.myapp.com

reflex-on-fly's People

Contributors

dinie avatar

Watchers

 avatar

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.