This backend infrastructure is currently parked and not deployed, github actions are disabled
Live at https://thestoryengine.co.uk
This is a Next.js React application hosted on Vercel, with a GraphQL backend deployed to AWS, see /infrastructure README for more details.
The frontend has 2 environments: Production & Preview, these follow the default Vercel pattern where Production always reflects the latest commit on main
branch, and all pull requests on main
get their own Preview deployment. The Preview deployments all point to the staging
backend deployment.
After cloning the repository:
- Install NPM dependencies with
npm install
- Get local instance of backend running with docker:
- Install docker app https://www.docker.com/products/docker-desktop
- Navigate to
/infrastructure
- Run
docker compose up -d
- See /infrastructure README for more details
- Navigate to
- Install docker app https://www.docker.com/products/docker-desktop
- Copy
/env.example
to/.env.local
and enter the keys in.env.local
for:- Stripe
- Postmark
- Hasura (see infrastructure/docker-compose.yaml for local defaults)
- Run
npm run dev
in/
- Go to http://localhost:3000
- Install Hasura bash app with
curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash
- Navigate to /infrastructure/hasura
- Run
hasura console
- Explore the hasura docs to find out how to add & change database tables in the console.
- As changes are made in the console, hasura will automatically make file changes in
infrastructure/hasura/metadata
& ininfrastructure/hasura/migrations
. migrations
holds SQL migrations run on the underlying PostgreSQL databasemetadata
holds hasura layer config:- Which tables in PostgreSQL to track (
tables.yaml
) - User permissions for each table (
tables.yaml
)
- Which tables in PostgreSQL to track (
/
- writers can write a story here, if it's the first time they've arrived, a blank story is automatically created and it's ID saved in browser sessionStorage. If an existing story is found in localstorage, the browser connects to that story as the writer.
See the reqs.http file for example bodies and responses for each endpoint.