north_outage

command module
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2026 License: GPL-3.0 Imports: 1 Imported by: 0

README

North Outage

North Outage is a tool for monitoring and viewing electricity outage information for the north of Iran. It scrapes data from the electricity distribution company and presents it in a user-friendly web interface.

Screenshot

Features

  • Data Collection: Automatically scrapes outage data from the official website.
  • Web Interface: A clean and modern web UI to view and filter outage information.
  • Timeline View: Visualizes outage times on a daily timeline.
  • Filtering: Allows filtering outages by city and address.
  • Go Backend: A robust backend written in Go.
  • React Frontend: A responsive frontend built with React and TypeScript.

Getting Started

Prerequisites
  • Go (version 1.25 or newer)
  • Make
Installation & Running
  1. Clone the repository:

    git clone https://github.com/fmotalleb/north_outage.git
    cd north_outage
    
  2. Configuration: Copy the example configuration file:

    cp example/config.toml config.toml
    

    You can edit config.toml to change settings like the listening port and database path.

  3. Build the application:

    make build
    
  4. Run the application:

    make run
    

    The web server will start on the port specified in your config.toml (default is :9090).

Configuration

The application is configured using a config.toml file. Here are some of the key options:

  • http_listen: The address and port for the web server (e.g., :9090).
  • database: The database connection string (e.g., sqlite://outage.db).
  • collect_cycle: How often to scrape for new data, using cron format (e.g., @hourly).
  • max_age: The maximum age of outage data to keep.

The collector pipeline for scraping is also defined in this file.

Tech Stack

  • Backend: Go
  • Frontend: React, TypeScript, Vite, Tailwind CSS
  • Scraping: Playwright
  • Database: SQLite (by default)

Contributing

Contributions are welcome! Please feel free to submit a pull request.

Documentation

Overview

Copyright © 2025 Motalleb Fallahnezha

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Directories

Path Synopsis
web

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL