Table of Contents
This web app designed in Flask is built to perform daily a scheduled API call from matomo analytics, the fetched data is stored it into a database and the interface serves as a management system to look aut for the API status and data statistics
The API call performed from matomo is Live.getLastVisitsDetails you can read the matomo API documentation here
Main functionalities:
- API calls from Matomo Analytics
- CRUD Operations
- DB operations
- Scheduled jobs
- Automatic deployment
- Authentication
- The application environment is built with Flask.
- The postgreSQL db is hosted with Supabase.
- The app is deployed on Vercel.
- The scheduled job is performed with Github Actions
To get a local copy up and running be sure to have the following steps checked.
- Make sure you have pip installed
- Create your DB instance.
- Create necessary DB tables. You can execute all the CREATE queries in db/create_tables.sql
- Clone the repo
git clone https://github.com/ccrisc/matomo-task-scheduler.git
- Install necessary packages
pip install -r requirements.txt
- To work on your local environment create a
.env
file in the main root of the project and define the following variablesENVIRONMENT=development SUPABASE_HOST=localhost SUPABASE_PORT=5432 SUPABASE_DB_NAME=matomo_task_scheduler SUPABASE_PASSWORD=xxxx (you delete the row on localhost if no username is set) SUPABASE_USER=xxxx (you delete the row on localhost if no pw is set) FLASK_SECRET_KEY=xxxx MATOMO_API_URL=xxxx
- Start your Flask app
python app.py
- Visit http://127.0.0.1:5000
Login with your user credentials. If you successfully set up the db you can log in with the following credentials:
username: demo password: abcd
You will be automatically logged out after 30 minutes of inactivity
The dashboard shows on the left the navigation sidebar. You can expand it by clicking on the burger menu. On the top right you can perform log out and read the latest messages.
The dashboard shows the last api call status if it was successful or if it failed and datetime of when it was performed.
Only if the current user logged has admin privilege he can access the users management section.
In the users table you have an overview of all your users that have an account. The table can be filtered by column
CRUD Operations:
You can create a NEW USER by clicking the button on the top right of the table. You will be asked to specify the username, the password and if the user is an admin or not.
By clicking the EDIT button you can proceed to edit data for that specific user
By clicking the DELETE button you will remove the selected user. You will be asked for confirmation prior irreversible delete.
Here you will have an overview of all the API calls performed and if they were successful or not. In the table you see the column state that indicates if the call was successful (green) or if it failed (red). At the same time if the call failed then it will be shown the details of the error.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you think you found a bug in this repo, you can submit an issue.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
For more details see See CONTRIBUTING.md
Distributed under the GNU GENERAL PUBLIC License. See LICENSE.txt
for more information.