This is a Strapi starter for the latest version as of its setup, 4.22.1. It includes:
- Strapi setup with Typescript and PostgreSQL
- Docker setup with docker-compose for development and test
- Test setup using PostgreSQL as test database
- ESLint and Prettier configuration with Husky to run on commit
- CI configuration for GitHub Actions
- Simple Access Role setup as a Strapi Content-Type
For more information about the motivation for this Starter within PALO IT, check this Sharepoint page.
Assuming you have Node.js 20 and Docker installed:
- Clone this project
- Search in all files for "strapi-starter" and change it to the name of your project
- Copy
.env.example
to.env
, no need to change any value - Run
yarn install
- Run
yarn docker:dev
- Run
yarn develop
Start your Strapi application with autoReload enabled. Learn more
yarn develop
Launch your tests. Setup based on this + improved in this repo to allow running tests individually.
yarn test
Note
Because of the way the strapi
constant is initialised and made available to the tests, the tests must run in band (already specified when running yarn test
), and --watch
is not available.
The tests use a test PostgreSQL database that is installed when you run yarn docker:dev
. This database schema is setup and cleared every time you run the tests, check tests/setup/strapi.ts
for more details.
If you get duplicate key errors while running tests, it might mean that the database was not cleared properly. To clear it manually, run:
yarn test:reset-database
Which will drop the Docker test database container and volume and recreate it.
Start your Strapi application with autoReload disabled. Learn more
yarn start
Build your admin panel. Learn more
yarn build
- Add maildev to develop emails locally.
- Add Email Designer plugin
- Add Conventional Commits to Husky
Strapi gives you many possible deployment options for your project including Strapi Cloud. Browse the deployment section of the documentation to find the best solution for your use case.
- Resource center - Strapi resource center.
- Strapi documentation - Official Strapi documentation.
- Strapi tutorials - List of tutorials made by the core team and the community.
- Strapi blog - Official Strapi blog containing articles made by the Strapi team and the community.
- Changelog - Find out about the Strapi product updates, new features and general improvements.
Feel free to check out the Strapi GitHub repository. Your feedback and contributions are welcome!
- Discord - Come chat with the Strapi community including the core team.
- Forum - Place to discuss, ask questions and find answers, show your Strapi project and get feedback or just talk with other Community members.
- Awesome Strapi - A curated list of awesome things related to Strapi.