Web app to learn touch typing build with the Laravel PHP Framework
- everything needed for laravel (see https://laravel.com/docs/5.5/installation)
Start by copying the .env.example
file to .env
in the project's root directory.
After that, install all dependencies by running composer install
and
generate an application key with php artisan key:generate
If you want to use docker for development, there is a prepared docker-compose.yml file (intended only for development).
However, if you haven't installed docker and docker-compose, it's probably easier to use
a VM like Homestead, you just have to change some settings in your .env
file
(to be specific, DB_HOST
and REDIS_HOST
).
A guide for using homestead: https://laravel.com/docs/5.5/homestead
Start docker containers
docker-compose up -d
To access the application now, go to http://localhost via your browser
Stop docker containers
docker-compose down
Since the docker containers run on their own network,
some artisan commands that require a database connection,
or any other connection to a container,
will fail if called by php artisan
via your local terminal.
In order to make these commands work, you have to run them on the PHP docker container.
There is a little php script to make things easier:
php remote-artisan
This script will simply execute php artisan
on the PHP docker container.
Run phpunit
or ./vendor/bin/phpunit
Again, since the docker containers are on their own network, running phpunit
doesn't work as expected, and, again, there is a php script called start-test, which just runs phpunit
from within the php docker container.
php start-test
Run php artisan migrate --seed
(this will automatically seed the database with a test user).
You may also want to upload the wordlists and lections used by the 'training mode' of the app
(php artisan load:words
and php artisan load:lections
). For more info, read the readme located in ./resources/assets/wordlists.
php remote-artisan migrate --seed
The Laravel framework as well as Typos is open-sourced software licensed under the MIT license.