History Panel is a full-stack web monitoring and analytics tool built around:
- A FastAPI backend (
backend/) that stores page visit metrics (links, words, images, timestamps). - A Chrome Extension frontend (
extension/) that captures browsing data and visualizes visit history. - A PostgreSQL database managed via Docker Compose.
The system allows you to collect, store, and visualize web visit data (links, images, word counts, etc.) in a neat extension side panel.
history-panel/
│
├── backend/ # FastAPI + SQLAlchemy + Alembic + Pytest
│ ├── app/ # Application source
│ ├── tests/ # Backend test suite (pytest)
│ ├── requirements.txt
│ ├── Dockerfile
│ ├── pyproject.toml
│ └── .env # Environment configuration
│
├── extension/ # Chrome extension (React + Vite + Tailwind)
│ ├── src/ # Frontend source
│ ├── public/ # Contains manifest.json
│ ├── tests/ # Jest + Testing Library tests
│ ├── dist/ # Built extension output
│ ├── package.json
│
├── docker-compose.yml # Runs PostgreSQL + backend API + extension build
├── .github/workflows/ci.yml # CI pipeline (backend + frontend)
└── README.md
git clone https://github.com/agbad/history-panel.git
cd history-panelIn backend/.env:
POSTGRES_DB=history
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
DATABASE_URL=postgresql+asyncpg://postgres:postgres@db:5432/historydocker compose up -d db apiThis:
- Starts PostgreSQL
- Builds and runs the FastAPI backend on port 8000
Check:
- API docs → http://localhost:8000/docs
- Health check →
curl http://localhost:8000/api/visit/health
cd extension
npm installnpm run devThe Docker Compose includes an extension-build service:
docker compose run --rm extension-buildThis compiles your extension into extension/dist.
- Open chrome://extensions/
- Enable Developer Mode
- Click “Load unpacked”
- Select the folder
history-panel/extension/dist
You’ll now see the History Sidepanel extension active.
docker compose exec api pytestIncludes:
- FactoryBoy fixtures for test data
cd extension
npm run test:runruff check .
black --check .OR
docker compose exec api ruff check .
docker compose exec api black --check .npm run lintEvery push or pull request runs both:
- ✅ Backend tests + lint + format check
- ✅ Frontend Jest suite
Results appear under the Actions tab in GitHub.
┌────────────┐ ┌──────────────┐ ┌──────────────┐
│ Extension │──────▶│ FastAPI API │──────▶ │ PostgreSQL │
└────────────┘ └──────────────┘ └──────────────┘
▲
│
└── Background/Content Scripts capture
- Links
- Images
- Word count
- Timestamps
- User visits a webpage → content script captures metrics.
- Data is POSTed to
/api/visit(FastAPI backend). - Backend persists metrics in PostgreSQL.
- Extension sidepanel displays charts, pagination, and per-page metrics.
- Run backend locally:
cd backend python -m app.main - You can manually trigger the extension metric event by reloading a tab.
✅ Backend: FastAPI + SQLAlchemy + Pytest
✅ Frontend: React + Vite + Tailwind + Jest
✅ Database: PostgreSQL
✅ CI/CD: GitHub Actions (tests + lint)
✅ Deployment: Docker Compose for local dev