Dragon is an internal Next.js application for managing clients, projects, env variables, time tracking, invoicing, book-keeping and reporting for software development agencies.
In the root of the project, run: yarn install. That will make the hasura-cli available for the project. Invoke it with yarn hasura ....
- Set all of the Environment Variables
- Run the project from the root:
docker-compose up - Run migrations and seed data:
./setup.sh - From the root folder, run the
yarn hasura:console:
By default the Hasura console will be running at: http://localhost:9695/console/
In the project root, create a .env file:
HASURA_GRAPHQL_SERVER_PORT=3002
HASURA_GRAPHQL_METADATA_DATABASE_URL=postgres://postgres:pgpass@postgres:5432/postgres
HASURA_GRAPHQL_ENABLE_CONSOLE=false
HASURA_GRAPHQL_DEV_MODE=true
HASURA_GRAPHQL_ENABLED_LOG_TYPES=startup, http-log, webhook-log, websocket-log, query-log
HASURA_GRAPHQL_ADMIN_SECRET=9ltBXk4k2OoPtSKP8qQqQE0J4HLU59WI
HASURA_GRAPHQL_JWT_SECRET=
HASURA_GRAPHQL_DATABASE_URL=postgres://postgres:pgpass@postgres:5432/postgres
HASURA_GRAPHQL_JWT_SECRET is generated from:
https://hasura.io/jwt-config/
Create a api/.env file and set the following:
AUTH0_CLIENT=
AUTH0_CLIENT_SECRET=
AUTH0_AUD=
AUTH0_URI=
DATABASE_URL=postgres://postgres:pgpass@postgres:5432/postgres
HASURA_GRAPHQL_ADMIN_SECRET=
PORT=3006
NODE_ENV=development
Create a client/.env.local file and set the following:
NEXT_PUBLIC_HASURA_ENDPOINT=http://localhost:3002/v1/graphql
NEXTAUTH_SECRET=${openssl rand -base64 32}
AUTH0_CLIENT=
AUTH0_CLIENT_SECRET=
AUTH0_URI=
API_HOST=http://localhost:3006
S3_BUCKET=/localhost/
NODE_ENV=development
PORT=3000
Any environment variables prefixed with NEXT_PUBLIC_ will be publically available in the client: process.env.NEXT_PUBLIC_...
Create a stats/.env file:
AWS_ACCESS_KEY=
AWS_SECRET_KEY=
DATABASE_URL=postgres://postgres:pgpass@postgres:5432/postgres
DB_SCHEMA=stats
NODE_ENV=development
PORT=3004
From the root, run:
docker-compose upThe client will be available at: http://localhost:3000
Run ./setup.sh, this will:
yarn hasura metadata apply
yarn hasura migrate apply --database-name default
yarn hasura seed apply --database-name default
docker-compose exec stats yarn clean
docker-compose exec stats yarn migrate up
docker-compose exec stats yarn seed
yarn hasura metadata reloadyarn hasura:consoleBy default the Hasura console will be running at: http://localhost:9695/console/
See /e2e/README.md
See /api/README.md