Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ccrisc/matomo-task-scheduler
Web app designed in Flask built to perform API calls through scheduled tasks and display the fetched data through statistics
https://github.com/ccrisc/matomo-task-scheduler
api flask-application github-actions matomo-analytics statistics vercel web-development
Last synced: 6 days ago
JSON representation
Web app designed in Flask built to perform API calls through scheduled tasks and display the fetched data through statistics
- Host: GitHub
- URL: https://github.com/ccrisc/matomo-task-scheduler
- Owner: ccrisc
- License: gpl-3.0
- Created: 2024-09-05T17:31:15.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-17T23:23:29.000Z (about 2 months ago)
- Last Synced: 2024-10-10T23:23:25.679Z (27 days ago)
- Topics: api, flask-application, github-actions, matomo-analytics, statistics, vercel, web-development
- Language: HTML
- Homepage: https://matomo-task-scheduler.vercel.app
- Size: 119 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Task Scheduler for Matomo
Table of Contents
## About The Project
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](https://developer.matomo.org/api-reference/reporting-api)
Main functionalities:
* API calls from Matomo Analytics
* CRUD Operations
* DB operations
* Scheduled jobs
* Automatic deployment
* Authentication### Built With
* 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## Getting Started
To get a local copy up and running be sure to have the following steps checked.
### Prerequisites
* 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](db%2Fcreate_tables.sql)### Installation
1. Clone the repo
```sh
git clone https://github.com/ccrisc/matomo-task-scheduler.git
```
2. Install necessary packages
```sh
pip install -r requirements.txt
```
3. To work on your local environment create a `.env` file in the main root of the project and define the following variables
```php
ENVIRONMENT=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
```
5. Start your Flask app
```sh
python app.py
```
6. Visit http://127.0.0.1:5000### Set up production environment
## Usage
### Login
Login with your user credentials. If you successfully set up the db you can log in with the following credentials:username: demo
password: abcdYou will be automatically logged out after 30 minutes of inactivity
### Dashboard
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.
### Users
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.
### Api Calls
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.### Statistics
## Contributing
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](https://github.com/ccrisc/matomo-task-scheduler/issues/new/choose).
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!1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull RequestFor more details see See `CONTRIBUTING.md`
## License
Distributed under the GNU GENERAL PUBLIC License. See `LICENSE.txt` for more information.