roadiz/skeleton
Headless API project skeleton built on Roadiz v2+
Install
COMPOSER_MEMORY_LIMIT=-1 composer create-project roadiz/skeleton my-website
cp .env .env.localIf Composer complains about memory limit issue, just prefix with COMPOSER_MEMORY_LIMIT=-1.
Edit your .env.local and docker-compose.yml files according to your local environment.
docker-compose build
docker-compose up -d --force-recreateThen wait for your services to initialize, especially your database could take several seconds to initialize (filesystem, database and user creation).
When you're ready you can check that Symfony console responds through your Docker service:
docker-compose exec -u www-data app bin/consoleGenerate JWT private and public keys
# Generate a strong secret
openssl rand --base64 16;
# Fill JWT_PASSPHRASE env var.
openssl genpkey -out config/jwt/private.pem -aes256 -algorithm rsa -pkeyopt rsa_keygen_bits:4096;
openssl pkey -in config/jwt/private.pem -out config/jwt/public.pem -pubout;Install database
# Create Roadiz database schema
docker-compose exec -u www-data app bin/console doctrine:migrations:migrate
# Migrate any existing data types
docker-compose exec -u www-data app bin/console themes:migrate ./src/Resources/config.yml
# Install base Roadiz fixtures, roles and settings
docker-compose exec -u www-data app bin/console install
# Clear cache
docker-compose exec -u www-data app bin/console cache:clear
# Create your admin account
docker-compose exec -u www-data app bin/console users:create -m username@roadiz.io -b -s usernameFeatures
- Configured to be used in headless mode with API Platform
- Configured with lexik/jwt-authentication-bundle
- All-Docker development and production environments
- Supervisor daemon for execution symfony/messenger consumers
- Solr and Varnish services right out-the-box
- Gitlab CI ready
- Use phpcs and phpstan to ensure code-smell and static analysis
Common content endpoint
/api/common_content endpoint is meant to expose common data about your website.
You can fetch this endpoint once in your website frontend, instead of embedding the same data in each web response.
Versioning
Make sure your .env file does not contain any sensitive data as it must be added to your repository: git add --force .env
in order to be overridden by .env.local file.
Sensitive and local data must be filled in .env.local which is git-ignored.