Skip to content

The-Story-Engine/TheStoryEngine

Repository files navigation

This backend infrastructure is currently parked and not deployed, github actions are disabled

TheStoryEngine UK

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.

Architecture

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.

Local Development

Frontend development

After cloning the repository:

DB changes

  • 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 & in infrastructure/hasura/migrations.
  • migrations holds SQL migrations run on the underlying PostgreSQL database
  • metadata holds hasura layer config:
    • Which tables in PostgreSQL to track (tables.yaml)
    • User permissions for each table (tables.yaml)

Pages

  • / - 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.

API Routes

See the reqs.http file for example bodies and responses for each endpoint.