Skip to content

WomenPlusPlus/deploy-impact-23-kpi-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KPI Monitor

Objectives:

The main goal of this application is to provide Pro Juventute members an easy and standardized way to collect and visualize KPIs.

Setup:

1. Prerequisites:

2. Run locally:

  1. run local Supabase instance
cd ~/dev # or another location where you want to store the Supabase repository
git clone --depth 1 https://github.com/supabase/supabase
cd supabase/docker
cp .env.example .env
docker compose pull
docker compose up -d
grep 'ANON_KEY=' .env | awk -F'=' '{print $2}' # this is the key required to connect the webapp to the backend
  1. run database migrations:
docker run --rm --network supabase_default --volume $(pwd)/migrations:/flyway/sql:ro flyway/flyway:latest -url="jdbc:postgresql://supabase-db:5432/postgres" -user="postgres" -password="your-super-secret-a
nd-long-postgres-password" migrate
  1. run webapp
cd KPI-team1-frontend
touch .env.local
echo "VITE_PUBLIC_SUPABASE_URL=http://localhost:8000" | tee -a .env.local
echo "VITE_PUBLIC_SUPABASE_ANON_KEY=<<ANON_KEY_FROM_POINT_1>>" | tee -a .env.local
npm run dev
  • open localhost:3000 in you browser
  • you should now be able to log in using the user created previously in the Supabase UI

3. Considerations for production deployment

The application is deployed in a test environment. Should you want to use it, please contact one of the KPI 1 team members for credentials.

The project heavily relies on Supabase. The deployment could be done using a self-hosted Supabase instance, which should be secured. An alternative approach is to create a Supabase account. Current GitHub setup allows applying the database migrations automatically:

The frontend application uses Vite which allows different deployment options out of the box.

4. Tools used:

5. Documentation

  • the general architecture of the project is described here
  • the database schema and instructions for management of the application by the Gatekeeper is here