Run your API out of the box, and consume it, simple, fast and easy.
Have you ever wanted to perform a proof of concept in which you needed backend software and frontend software? Or, have you ever seen the need to start a project but did not know where?
In this repository you will find code and information on how to start from almost-zero a project that has a backend, frontend, and an Android application!
- Alpine 3.9
- Python 3.7.2
- Flask 1.0.2
- Alpine
- Postgres 11.2
- pgAdmin4.3
- Alpine
- React 16.8
- Node 8.15
Based in Android API 28 and with SDK minimum of API 19. It has Volley ready to be used, to call APIs.
The software is meant to be run with Docker.
And, for the Android App, you need an IDE (e.g. Android Studio) and an Android Device.
Add your frontend URL in backend/source/resources_loader.py
Add your backend URL in frontend/src/config.js
Run separately.
make setup
make run-backend
make run-frontend
And you will have running in:
- PORT 3000: React - Frontend
- PORT 5000: Flask REST API - Backend
- PORT 5432: PostgresDB
- PORT 5433: pgAdmin 4
Open localhost:5433
. The user and password are the ones that are shown in the docker-compose.yml
.
To connect to the postgres database. Click in Add New Server
and add the following information
in the Connection
tab:
Host name/address: postgres
Port: 5432
Maintenance database: postgres
Username: postgres
Role:
Service:
POST :5000/entries/
Content-Type: application/json
{
"value": "sample",
"date": "2019-04-23 16:10:45"
}
And the response will be:
{
"data": {
"internal_id": 1
},
"error": null
}
Make sure the user has permission to run run.sh
and that this file is in LF
format.
docker run '...'
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"run.sh\": executable file not found in $PATH": unknown.
Makefile:27: recipe for target 'run-backend' failed
make: *** [run-backend] Error 127
Make sure the user has permission to run configure-postgres.sh
and that this file is in LF
format.