Smallit is an open source api based web application, my target is having an easy to use url shortener with most features..
The default www_user is set as 1000(www-data) in .env.example. feel free to add your own environment.
www-datauser and group available in your machine.docker and docker composeGNU Make(Optional)
- (If you have problems with user and permissions, read this section)
sudo groupadd www-data(Creates the www-data group)sudo useradd -g www-data -s /usr/sbin/nologin -M www-data(Creates www-data user and add it to www-data group)id www-data(Verify that the user and group have been created)- Recommended: Logout after this action
You can use the make command to install Smallit, or just do things manually
-
Just run
makecommand
Since there is some differences between development and production in configurations, Smallit has a Specific Docker for production named docker-compose.prod.yml in root directory.
run it using the following command: compose -f docker-compose.prod.yml up --build --force-recreate
cp .env.example .envdocker compose up --build --force-recreatechgrp -R (username) storage bootstrap/cachechmod -R ug+rwx storage bootstrap/cache
composer install(installing packages and dependencies)php artisan key:generate(generatesAPP_KEY)php artisan migrate(run migrations)php artisan horizon:install(publish horizon configuration and assets)php artisan test(make sure app works fine)php artisan l5-swagger:generate(generates API documentations)php artisan horizon(start horizon)
-
run
dockker exec -t smallit_php bash -c "vendor/bin/phpunit --coverage-text"to see the tests result and coverage and generate an HTML Result inpublic/test-coverage-report.
-
Smallit is using Horizon to manage Queues.
run
docker exec -t smallit_php bash -c "php artisan horizon"to start queues working. -
starting Horizon can be automized using Supervisor, which is available in Production Docker environment.
-
run
docker exec -t smallit_php bash -c "php artisan l5-swagger:generate", Api documentations will generate in route/api/documentation.
The project has a separate contribution file. Please adhere to the steps listed in the separate contributions file
You can reach me on Linkedin @amirdaraby