Skip to content

alice-luc/google-sheets-parser

Repository files navigation

Summary


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:

  1. Data may take a little while to load, you'll see spinner till the server will fully process the data
  2. Refresh page to refresh the data
  3. 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
    Interface

Logs are stored at /.log folder

Setup


  1. Clone repository to local directory
  2. Install docker
  3. Install docker-compose
  4. Create .envfile with environment variables. By default:
    POSTGRES_USER=postgres
    POSTGRES_PASSWORD=123123
    POSTGRES_DB=gsheets_app
  5. Run docker-compose up --build -d
  6. Run docker logs <container name> to make sure everything works correctly.

In case you face any issues, see the 'Troubleshooting' section bellow

DB Setup


  1. Run docker ps to see containers list. Find the ID of postgres:alpine container.
  2. Run docker exec -it {container_id} bash to switch to bash terminal inside the container
  3. Inside docker bash type psql postgres where 'postgres' - is db username
  4. 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;

  5. Press Ctrl+D to quit bash terminal

Telegram Notifications Setup


  1. Uncomment code in notification file
  2. Create file config.ini in services directory
  3. Create environment variables with YOUR telegram data
  4. Uncomment imports and notification call on lines 20, 27 and 28

Troubleshooting


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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published