Welcome to the Code Quiz Open Source project from How To Code Well.
This is an Open Source project that includes an API and an App for the daily code quizzes.
The daily code quizzes are published to Instagram and Twitter. This GitHub project is under development and will eventually allow access to the quizzes via a JSON API, Mobile app and website.
This Monorepo contains the following three projects.
- API - A Symfony 6, PHP 8 and Maria DB backend.
- API-Client - A NPM package for mock testing the API.
- App - A Mobile application that displays code quizzes.
- Website - A Website that displays code quizzes.
This project is being developed live on YouTube most Tuesdays at 6pm BST and most Sundays on Twitch.
If you would like to help build the project then please pick a ticket from the issues. If you are new to Open Source then pick an issue labeled good first issue
.
Pull requests may be reviewed live on Twitch/YouTube.
See the CONTRIBUTING guide on how to contribute to the project.
- Docker
- Docker Compose
- Node
- NPM
- Yarn
- Clone the repository
git clone git@github.com:howToCodeWell/code-quiz.git
- Spin up the containers
docker-compose up -d
- Install database migrations
docker-compose exec api bin/console doctrine:migration:migrate
- Load data fixtures
docker-compose exec api bin/console doctrine:fixtures:load
- Add the following entry to the
/etc/hosts
127.0.0.1 codequiz.local
127.0.0.1 api.codequiz.local
From the api
folder run the following to create openapi.yaml
in the ./docs/generated
folder. This is ignored from the code base
docker-compose exec api bash -c "bin/console api:openapi:export --yaml" > ./docs/generated/openapi.yaml
- Run the migrations
docker-compose exec api bash -c 'bin/console doctrine:migrations:migrate'
- Run the data fixtures
docker-compose exec api bash -c 'bin/console doctrine:fixtures:load'
- The API can be reached at http://api.codequiz.local/v1
- The website can be reached at http://codequiz.local/
Get a list of quizzes
curl -X 'GET' \
'http://api.codequiz.local/v1/quizzes' \
-H 'accept: application/ld+json'
Get the first quiz
curl -X 'GET' \
'http://api.codequiz.local/v1/quiz/1' \
-H 'accept: application/ld+json'
Get the first question
curl -X 'GET' \
'http://api.codequiz.local/v1/question/1' \
-H 'accept: application/ld+json'
- Install the packages
yarn install
- Run the mock server
yarn start
- Generate the OpenAPI TypeScript module Make sure you have already generated the openapi spec file.
yarn run generate-api
yarn run lint
yarn run test
Yet to be built