The CWA is in heavy development
Installation
Quick Start
1. Clone our skeleton template
You will add your own code and configuration inside this skeleton.
You can start a fresh new project with the GitHub command line tool:
gh repo create my-website \
--template="components-web-app/components-web-app" \
--private --clone
2. Start docker containers
Open a terminal, and navigate to the directory containing your project skeleton. Run the following command to start all services using Docker Compose:
The following command will build the images (when they do not exist) and start them up in detached mode:
docker compose up --detach
- To stop the containers you can run
docker compose down
- To view and follow logs you can run
docker compose logs -f [optional:container-name]
- If you need to rebuild in future without the cache you can run
docker compose build --no-cache
3. Create data fixtures
To create some default routes and fixtures so your template resembles our playground you can load the pre-build fixtures.
docker compose exec php bin/console doctrine:fixtures:load
4. Login page - Delete or modify
In the template, we have modified the login page to include a notice. You can simply delete the file at /app/pages/login.vue
to use the default login page, or modify it to suit your needs using slots in our pre-built components, or using them as a guide.
5. Authentication Configuration
- You need to create keys for generating JWT tokens. First you can bash into the php container
Terminal
docker compose exec php sh
- Now you are writing in the command line within the php container. First create the JWT directory.
Terminal
mkdir -p config/jwt
- Copy
api/.env
toapi/.env.local
- this will be your private environment variables and will not be pushed to your git repository. - Then find and change
JWT_PASSPHRASE
in yourapi/.env.local
- this should always be a secret and you can use real environment variables in production. Note down the passphrase. - Generate the private key - when prompted, enter/paste the passphrase you noted down above.
Terminal
openssl genpkey -out config/jwt/private.pem -aes256 -algorithm rsa -pkeyopt rsa_keygen_bits:4096
- Create the public key - again it will prompt you for the private key passphrase.
Terminal
openssl pkey -in config/jwt/private.pem -out config/jwt/public.pem -pubout
You have now created your JWT keys and will be able to login at https://localhost/login
6. Congratulations!
That's it! You can now start writing your components 🚀
Continue to read our usage documentation to find out how.