taskman
1.0.0
Manajer tugas sederhana yang dibuat menggunakan Symfony.
Proyek ini menerapkan konsep TDD, DDD, CQRS dan Event Driven Architecture.
Untuk menjalankan proyek ini, Anda harus menginstal Docker
dan Docker-Compose
.
Sebelum menjalankan proyek, silakan jalankan perintah berikut:
make setup
docker-compose exec php sh -c '
set -e
mkdir -p config/jwt
jwt_passphrase=${JWT_PASSPHRASE:-$(grep ''^JWT_PASSPHRASE='' .env | cut -f 2 -d ''='')}
echo "$jwt_passphrase" | openssl genpkey -out config/jwt/private.pem -pass stdin -aes256 -algorithm rsa -pkeyopt rsa_keygen_bits:4096
echo "$jwt_passphrase" | openssl pkey -in config/jwt/private.pem -passin stdin -out config/jwt/public.pem -pubout
setfacl -R -m u:www-data:rX -m u:"$(whoami)":rwX config/jwt
setfacl -dR -m u:www-data:rX -m u:"$(whoami)":rwX config/jwt
'
Setelah proyek disiapkan dan container telah dimulai, Anda dapat:
docker-compose exec php bin/console app:register-user
curl --location --request POST 'http://localhost/api/auth-token'
--form 'username=YOUR_USERNAME'
--form 'password=YOUR_PASSWORD'
curl --location --request POST 'http://localhost/api/tasks'
--header 'Authorization: Bearer YOUR_JWT_TOKEN'
--form 'title=Task #1'
--form 'execution_date=2020-09-20'
# if you don't set the `execution_date` param, the default value is the current date
curl --location --request GET 'http://localhost/api/tasks?execution_date=2020-09-20'
--header 'Authorization: Bearer YOUR_JWT_TOKEN'
Untuk menjalankan pengujian unit dan fungsional:
make test