My implementation of @PicPay using Java and Spring Framework to create a small representation of the PicPay API
| Overview | Technologies | Project | Routes | Run | Author |
This API is my implementation of the PicPay. Simulates a microservice for transactions with authentication and authorization. It was done following the best practices of Clean Architecture and DDD, with Tests, Docker Containers and complete Documentation with Swagger.
📡 | Hosted on Render: https://pic-pay.onrender.com/
📝 | Documentation: https://pic-pay.onrender.com/swagger-ui/index.html
- Spring Framework
- Spring Security
- JWT
- Authentication & Authorization
- PostgreSQL
- Docker
- Consume External API
- Maven
- REST
- Swagger
- Validation
- Lombok
- Environment
- Clean Architeture
- DDD
- JUnit
- H2 Database
- Error Handler
Among Others...
The API has an Authentication System that identifies the registered user based on a JWT Token and an Authorization System that defines which resources an authenticated user can access, a normal user cannot create other users, but a admin user can, for example. User password is encrypt with Bcrypt for better security.
Once authenticated, a normal user can transact an amount with others if they have enough balance, they will request an external simulated microservice to see if they can carry out the transaction. All Domain Rules are encapsulated in Policies that are implemented at the Application Layer. After the transaction is completed successfully, the API consults another external simulated microservice to send a notification to users informing them that everything went well.
All data passed through this microservice has validation and expected structure defined by DTOs and all documentation is done with Swagger
In the testing environment, I have configured H2 for Database instead of a dedicated PostgreSQL as H2 uses Memory which is very fast and since it is just a test and I don't need to save data, I actually want the database to be restarted when starting, that is, it is faster, disposable and emulates the real behavior of a database, it is perfect for testing.
I use Docker to set up the environment and run tests. This application has an image that is published on github with each commit in the Main Branch automated by Github actions
📡 | Hosted on Render: https://pic-pay.onrender.com/
📝 | Documentation: https://pic-pay.onrender.com/swagger-ui/index.html
$ git clone "[email protected]:Samuel-Ricardo/Pic-Pay_simplified.git"
$ git pull "[email protected]:Samuel-Ricardo/Pic-Pay_simplified.git"
This application use Docker
so you dont need to install and cofigurate anything other than docker on your machine.
Navigate to project folder and run it using docker-compose
# After setup docker environment just run this commmand on root project folder:
$ docker-compose up --build # For First Time run this command
$ docker-compose up # to run project
#Apps Running on:
$ API: http://localhost:8080
$ PostgreSQL: http://localhost:5432
$ PGAdmin: http://localhost:5050
See more: ./docker-compose.yaml
- Samuel Ricardo