Skip to content
Example for NextJs + Craft (GraphQL) Intergration
TypeScript HTML PHP Dockerfile Batchfile
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
craft
docker-config
next
resources
.envrc.example
.gitignore
README.md
docker-compose.yml

README.md

NextJs + Craft Graphql Example

Setup

  1. Fill in .envrc files (rename .envrc.example to .envrc)

    If you do not know what envrc is more info on it here

  2. Run docker compose docker-compose up To build and run the docker container to run craft and mariadb
  3. Import test craft database with docker
docker exec -i ${PROJECT_NAME}--craft--db mysql -u $SQL_USERNAME -p$SQL_PASSWORD craft_${PROJECT_NAME} < ./resources/backup.tar
  1. Install nextjs dependencies
cd next
yarn
  1. Get the craft graphql access token from craft /admin/graphql/schemas and put it in the .envrc under the ./next folder

Testing

  1. Enter next dev mode yarn dev
  2. When next dev mode is active you can live preview the home page
You can’t perform that action at this time.