https://github.com/mateusjssilva/analytics-dashboard
A robust application developed in Python (FastAPI) that integrates public data from multiple sources, providing a modern interface for data visualization, management (CRUD), and analysis.
https://github.com/mateusjssilva/analytics-dashboard
fastapi ibge intefration test
Last synced: 4 months ago
JSON representation
A robust application developed in Python (FastAPI) that integrates public data from multiple sources, providing a modern interface for data visualization, management (CRUD), and analysis.
- Host: GitHub
- URL: https://github.com/mateusjssilva/analytics-dashboard
- Owner: MateusjsSilva
- Created: 2026-01-24T14:05:30.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-01-24T14:17:17.000Z (5 months ago)
- Last Synced: 2026-01-25T02:16:57.172Z (5 months ago)
- Topics: fastapi, ibge, intefration, test
- Language: HTML
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Analytics Dashboard
A robust application developed in **Python (FastAPI)** that integrates public data from multiple sources, providing a modern interface for data visualization, management (CRUD), and analysis.
## Features
- **Analytical Dashboard**: General statistics visualization and dynamic charts (Chart.js) for data analysis.
- **Integration with Public APIs**:
- **IBGE**: Detailed country data (regions, capitals, area).
- **Chamber of Deputies**: Information about Brazilian parliamentarians (parties, states, contacts).
- **Full CRUD Management**: Ability to create, edit, list, and delete records for both countries and deputies.
- **Real‑time Synchronization**: Button to update the local database by consuming external APIs.
- **Modern Interface**: Responsive layout with Dark theme, using Jinja2, Tailwind‑like CSS, and subtle animations.
## Technologies Used
- **Backend**: Python 3.9+, FastAPI, SQLAlchemy (ORM).
- **Database**: MySQL 8.0 running in a Docker container.
- **Frontend**: HTML5, CSS3 (Vanilla), Jinja2 Templates, JavaScript (Chart.js).
- **Infrastructure**: Docker & Docker Compose.
## Project Structure
```text
analytics-dashboard/
├── app/
│ ├── core/ # Database and environment configurations
│ ├── models/ # SQLAlchemy models (Country, Deputy)
│ ├── services/ # Business logic and API integration
│ ├── templates/ # Jinja2 HTML files
│ ├── static/ # CSS and static assets
│ └── main.py # Application entry point
├── docker-compose.yml # Database orchestration
├── requirements.txt # Project dependencies
└── .env # Environment variables
```
## How to Run
### 1. Prerequisites
- Docker Desktop installed and **running**.
- Python 3.9+ installed locally.
### 2. Set Up the Database
Start the MySQL container using Docker Compose:
```bash
docker-compose up -d
```
### 3. Set Up the Python Environment
Create a virtual environment and install dependencies:
```bash
# Create venv
python -m venv venv
# Activate venv (Windows)
.\\venv\\Scripts\\activate
# Activate venv (Linux/macOS)
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
```
### 4. Run the Application
Start the Uvicorn server:
```bash
uvicorn app.main:app --reload
```
Access the app at: `http://localhost:8000` (recommended) or `http://127.0.0.1:8000`
## Usage
1. **Synchronization**: On first access, go to the Dashboard and click **"Synchronize All Data"**. This will populate the local database with data from IBGE and the Chamber.
2. **Navigation**: Use the side menu to switch between the Dashboard (charts), the Countries list, and the Deputies list.
3. **CRUD**: In each listing, you will find options to add new records manually, edit existing ones, or delete them.
## Configuration (.env)
The `.env` file at the root controls the database connection. Default for Docker:
```env
DB_HOST=localhost
DB_PORT=3306
DB_NAME=test_db
DB_USER=user
DB_PASSWORD=vobys_local_pass
```