Celebrity management API with database update logs feature.
- Docker (>= 18.x)
- Docker Compose (>= 1.20)
- Make
- Composer 2.0.x
- PHP 7.4
- Symfony 4.4
- PostgreSQL 13.2
- Nginx 1.x
- Init docker containers
:~$ make up
- Install dependencies
:~$ make composer-install
- Init database (drop and create database. execute migrations )
:~$ make database-init
- Generate JWT SSL keys
:~$ make jwt-generate-keypair
- The following are the user information to
login
and test the api (Security section at API docs
)
-----------------------------------------------------
ROLE_ADMIN
-----------------------------------------------------
username: admin
password: admin
-----------------------------------------------------
-----------------------------------------------------
ROLE_USER
-----------------------------------------------------
username: user_1, user_2, user_3
password: passwd123
-----------------------------------------------------
- For user interface use Artist Management - UI
The database logs feature was implemented using the Doctrine Lifecycle Subscribers because the postUpdate
event allow get the required information (entity, changes and security users) in a single place.
In other hand, there are some pitfalls with this implementation:
- The subscriber resolve all the information and in case it fails, the entire process fails. (i.e update a celebrity)
- The
logs
data is stored in the same database where the changes are performed.
A way to deal with this is try to use some queue
to process the subscriber data afterwards. Also, should be good move all the logs process (create, list etc) into a microservice
.