A template repository to set up a fullstack web environment
- Strapi REST API + Admin Panel >
admin/
- Svelte application with SSR >
website/
- Cypress end-to-end test runner >
cypress/
- Render Bluesprint specification >
render.yaml
- Create a new repository using this one as a template, or by forking it
- Sign up for an account in Render using your Github account and create a Blueprint linked to your new repository
Once you cloned your repository on your local machine, you need to set up some environment variables
Create a file in the admin
folder named .env
and fill it with the same key/value pairs as in the .env.example
file. You can find information about mandatory environment variables in the documentation from Strapi about server configuration and admin panel configuration.
If you need to make authenticated requests from the website's server to the Strapi API, fill up the
STRAPI_WEBSITE_TOKEN
with a random 128-bytes string
Create a file in the website
folder named .env.local
and fill it with same key/value pairs as in the .env
file.
If you need to make authenticated requests from the website's server to the Strapi API, fill up the
STRAPI_WEBSITE_TOKEN
with the same 128-bytes string from theadmin
step
Run npm install
in both admin
and website
folders
Run npm run build
in the project root folder
Run npm run dev
in the project root folder
Run npm test
in the project root folder
Commit your changes and push them to the main
branch of your repository. Render will automatically detect them and create new deployments for both services.
- Go to your Render Dashboard and enable Pull Request Previews in both services
admin
andwebsite
- Create a new branch in your repository and commit some changes on it
- Open a Pull Request in your repository comparing your branch to the
main
branch
Render will try to deploy a copy of your production environment running the Pull Request code changes.
This template comes with a Github workflow that runs the Cypress E2E test suite against a Preview Environment from Render on any change to a matching Pull Request.
You can follow the steps in this repository to set up your own Sorry-Cypress environment (an open-source alternative to the costly Cypress Studio).
Once all instances are up and running, copy the director service external URL in Render and paste it in the e2e workflow next to the CYPRESS_API_URL
property.
Your next tests will be reported to your Sorry-Cypress dashboard.