The application is aimed to parse data from Google sheets document
and display it graphically on a web-page.
back-end: Flask
db: PostgreSQL
front-end: React
The api is running at http://localhost:80
The web-page is running at http://localhost:3000
endpoints:
http://localhost/health - to create DB relations and check server health
http://localhost:3000 - to parse data from google sheets and get statistics
Nota bene:
- Data may take a little while to load, you'll see spinner till the server will fully process the data
- Refresh page to refresh the data
- If it is needed to parse the actual usd rate according to date on each table row, go here
and follow the comments at
_get_converted_values
function
Interface
- Clone repository to local directory
- Install docker
- Install docker-compose
- Create
.env
file with environment variables. By default:
POSTGRES_USER=postgres
POSTGRES_PASSWORD=123123
POSTGRES_DB=gsheets_app - Run
docker-compose up --build -d
- Run
docker logs <container name>
to make sure everything works correctly.
In case you face any issues, see the 'Troubleshooting' section bellow
- Run
docker ps
to see containers list. Find the ID ofpostgres:alpine
container. - Run
docker exec -it {container_id} bash
to switch to bash terminal inside the container - Inside docker bash type
psql postgres
where 'postgres' - is db username - Run
ALTER USER postgres WITH PASSWORD ‘123123’;
CREATE DATABASE gsheets_app;
ALTER ROLE postgres SET client_encoding TO 'utf8';
ALTER ROLE postgres SET default_transaction_isolation TO 'read committed';
ALTER ROLE postgres SET timezone TO 'Asia/Kolkata';
ALTER DATABASE gsheets_app OWNER TO postgres;
\q; - Press Ctrl+D to quit bash terminal
- Uncomment code in notification file
- Create file config.ini in services directory
- Create environment variables with YOUR telegram data
- Uncomment imports and notification call on lines 20, 27 and 28
error checking context: 'can't stat 'path-to-project-folder/.postgres-data''
sudo chown -R $USER path-to-project-folder/.postgres-data
FATAL: password authentication failed for user "postgres"
Repeat the first 3 steps from "DB Setup" section and run
ALTER USER postgres WITH PASSWORD ‘<your_new_password>’;
Make sure you have updated .env file after password changing