Cap-go / capgo

Instant update for capacitor apps
https://capgo.app
GNU Affero General Public License v3.0
115 stars 57 forks source link
android capacitor cordova ios

Capgo - Instant updates for capacitor

Bugs Security Rating Maintainability Rating Code Smells Lines of Code Technical Debt Reliability Rating Duplicated Lines (%) Vulnerabilities Known Vulnerabilities GitHub license Bump version Build source code and send to Capgo udd-update-dependencies Netlify Status

semantic-release

Commitizen friendly


➡️ Get Instant updates for your App with Capgo 🚀

Fix your annoying bug now, Hire a Capacitor expert 💪


Features


Documentation

https://github.com/Cap-go/capacitor-updater/wiki/Capgo-Sandbox-App

Plugins

All official plugin are install and preconfigured

Dev contribution

Coding Style

Dev tools

Usage

Deploy on Cloudflare Pages

use the CLI to deploy preprod

bun run dev-build
# then deploy
bun run deploy:cloudflare_frontend:preprod

or Prod

bun run build
# then deploy
bun run deploy:cloudflare_frontend:prod

Development

You will need to start each local server in separate terminals.

Before you continue, you need to have these installed:

You can install the supabase CLI globally with bun install supabase -g and you can invoke supabase from anywhere.

Alternatively, you can install the CLI inside this repo with bun install supabase --save-dev but to invoke it use: ./node_modules/supabase/bin/supabase.

The rest of this guide assumes that you installed the supabase CLI globally.

Start Supabase DB Locally

Start the Supabase DB:

supabase start

If the command completed successfully, your console output should be similar to the output below:

Started supabase local development setup.

         API URL: http://localhost:54321
     GraphQL URL: http://localhost:54321/graphql/v1
          DB URL: postgresql://postgres:postgres@localhost:54322/postgres
      Studio URL: http://localhost:54323
    Inbucket URL: http://localhost:54324
      JWT secret: super-secret-jwt-token-with-at-least-32-characters-long
        anon key: xxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXx.xxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXx
service_role key: xxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXx.xxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxXxxxxxXxxxxxX

Start Supabase DB and Functions Locally

You need make sure Docker is running.

bun install
bun backend

Start Frontend Locally

Before starting the frontend, make sure you replace the value of supa_anon.local inside the file configs.json with the value of anon key. If supabase is already running, you can also obtain anon key from the output of supabase status.

In another terminal, run the server with the necessary Netlify functions:

bun serve

Login

Visit http://localhost:5173

There are two login credentials you can use:

Account Username Password
Demo User test@capgo.app testtest
Admin User admin@capgo.app adminadmin

The demo user account has some demo data in it. If the data is not fresh just reset the db with supabase db reset. The seed has been made in the way the data is always fresh.

The admin user has admininstrative rights so he can impersonate other users. You can find the menu for that in the account section.

Supabase DB Reset

Make sure you have Docker running.

This will seed the DB with demo data again.

supabase db reset

Deploy Supabase self hosted

To deploy the supabase instance self hosted, use the Supabase offical guide.

Deploy Supabase cloud

To deploy the supabase instance on cloud, you need a paid account at $25/month.

Link the project to the cloud with the following command:

supabase link

https://supabase.com/docs/reference/cli/supabase-link

Then you need to push the migrations to the cloud with the following command:

supabase db push --linked

https://supabase.com/docs/reference/cli/supabase-migration-up

And seed the DB with demo data:

supabase seed buckets

https://supabase.com/docs/reference/cli/supabase-seed-buckets

Seed the secret for functions:

supabase secrets set --env-file supabase/functions/.env

Push the functions to the cloud:

supabase functions deploy

Build

To build the webApp in mobile, to push to store, run

bun install
bun mobile

And you will see the generated file in dist that ready to be served.