invis

An inventory and auto-generated shoplist app for all things needed 🚥

Stars
1

Invis App

TODO: update instructions!

Development

  • This step only applies if you've opted out of having the CLI install dependencies for you:

    prisma migrate dev --name init
    
  • Initial setup: If you just generated this project, this step has been done for you.

    npm run setup
    
  • Start dev server:

    npm run dev
    

This starts your app in development mode, rebuilding assets on file changes.

Deployment

Prior to your first deployment, you'll need to do a few things:

  • Install Fly

  • Sign up and log in to Fly

    fly auth signup
    

    Note: If you have more than one Fly account, ensure that you are signed into the same account in the Fly CLI as you are in the browser. In your terminal, run fly auth whoami and ensure the email matches the Fly account signed into the browser.

  • Create two apps on Fly, one for staging and one for production:

    fly apps create invis
    fly apps create invis-staging
    
  • Add a FLY_API_TOKEN to your GitHub repo. To do this, go to your user settings on Fly and create a new token, then add it to your repo secrets with the name FLY_API_TOKEN.

  • Create a persistent volume for the sqlite database for both your staging and production environments. Run the following:

    fly volumes create data --size 1 --app invis
    fly volumes create data --size 1 --app invis-staging
    

Now that everything is set up you can commit and push your changes to your repo. Every commit to your main branch will trigger a deployment to your production environment, and every commit to your dev branch will trigger a deployment to your staging environment.

Connecting to your database

fly ssh --app invis-staging console
fly ssh --app invis console

sqlite3 /data/sqlite.db

Seeding data

cd app
npm run db:seed

GitHub Actions

We use GitHub Actions for continuous integration and deployment. Anything that gets into the main branch will be deployed to production after running tests/build/etc. Anything in the dev branch will be deployed to staging.