- Docker installed and running
- Docker compose installed
- Clone this repository on your machine
- Go to the reverse-proxy folder and run
bash generate_keys.sh
. This will generate the pair of keys for the ssl certificate - Get back to the root of the repository and build the app running
docker-compose build
- Then upload the app and let this running with this command
docker-compose up
Once the app is running you can access to it with https://localhost/qrcodes
The purpose of the API is to convert a string into a Base64 QR code that you can paste in a Base64 to Image Converter to scan it.
This are the Endpoints that you can use to play
[
{
"id": "1",
"text_value": "saved string ",
"encoded_qr": "Base 64 QR Code"
}
]
{
"id": "1",
"text_value": "saved string ",
"encoded_qr": "Base 64 QR Code"
}
Send the body with a JSON like this
{
"text_value": "The text that I want to convert to QR Code"
}
It must returns this
{
"QR ID": "QRID",
"Status": "Created"
}
{
"ID": "QRID",
"Status": "Updated"
}
{
"ID": "QRID",
"Status": "Deleted"
}
{
"BD Connection": "Running",
"QR Codes Saved": "1"
}
This is an app to generate and manage QR codes from a text. The API is build in Golang and it's connected to a MySQL database. With the run of the Docker Compose the application will upload the following architecture:
Where you can see there are three Docker containers: One that works as a reverse proxy, the API container and the database.
You can see the Dockerfile inside each folder in this repo.
- To run this service in a production environment, we must deploy the containers in a Cloud service. We could use a service like AWS ECS to run Docker containers.
- To be able to connect with the service, the container nginx container must have a public IP. To access to it easier, we could use a DNS service to give it a domain name.
- Include a bash script that makes the build and deploy of the app, including functional tests
- Makefile with those phases
- Refactor of the code app
- Include replicas with Docker swarm to make it more reliable
- Environment variables