- Firstly Install nvm (Node Version Manager) and instal Node version 18.x and 16.x since the frontend and backend use two separate versions.
- run
npm installin the project root directory and inside the/backenddirectory (don't forget to switch to Node v16.x when installing dependencies or running the strapi environment inside/backend). - within the
/backenddirectory find.env.example, make a.envfile resembling the example file, for,
APP_KEYS="toBeModified1,toBeModified2"
API_TOKEN_SALT=tobemodified
ADMIN_JWT_SECRET=tobemodified
JWT_SECRET=tobemodified
replace tobemodified with any random base64 string (you can find many base64 generators online).
-
populate the strapi server with some dummy content before making api calls.
-
In the project root create an
.env.developmentfile and populate it with the following fields,STRAPI_TOKEN=<your api key here> STRAPI_API_URL=http://127.0.0.1:1337 -
To generate your own API Key start the strapi development server within
/backendwithnpm run develop, head over to admin panellocalhost:1337/adminand create an account and wait for the admin to assign you permissions to create your own API key. -
To start the frontend run
gatsby developin the root (remember to install gatsby globally withnpm install -g gatsby-cli)