- Node
- Yarn
- Docker (optional - if you want full local dev) (https://docs.docker.com/get-docker/)
- Hasura CLI (optional - for CLI access to Hasura) (https://hasura.io/docs/latest/graphql/core/hasura-cli/install-hasura-cli.html#install-hasura-cli)
- Clone the repo and run
yarn install
in the project directory. - Copy .env.example into a new .env file and fill in missing environment variables.
- Generate GraphQL
NEXT_PUBLIC_GRAPHQL_API="<HASURA API URL>" HASURA_ADMIN_SECRET="<HASURA ADMIN SECRET>" yarn generate
in the project root. - Run
yarn global add concurrently
to install the concurrently package, which is used duringyarn dev
. - Run
yarn dev
.
Interact with local Firebase functions (optional - can use functions already deployed to Firebase project)
- Start the local firebase function emulator (firebase repository)
- Set
NEXT_PUBLIC_ENV
to local in .env file (NOTE: This will still use Firestore and Storage in the currently set firebase project in the cloud) - Start admin using
yarn dev
-
Install Docker.
-
Run
docker-compose up
in the project root.- hasura: http://localhost:8080
- pgadmin: http://localhost:5050
-
Set
NEXT_PUBLIC_GRAPHQL_API
tohttp://localhost:8080/v1/graphql
inside of .env file -
Run
yarn dev
- Import schema.sql into Hasura via Hasura UI SQL interface or directly into Postgres DB (Can use pgadmin)
- Import Hasura manifest file through Hasura UI
- (optional) Dump DB from staging/production and import to local
NOTE: The schema.sql file should be maintained to match the production environment
We should look into Github hooks for the Firebase deploy, which are available, but for now, the manual deployment process is as follows:
- (Optional, but good to avoid ambiguity with previous builds)
rm -rf .next out
yarn build
yarn deploy
On initialization:
- Import schema.sql into Hasura instance through Hasura or directly to Postgres DB
- Import Hasura manifest file through Hasura UI
Afterwards, Hasura can be updated in several ways:
- Directly updating fields and tables through Hasura interface
- Export migration files using Hasura CLI and import migrations (https://hasura.io/docs/latest/graphql/core/migrations/index.html)