Skip to content

code4fukui/parking-view

Repository files navigation

parking-view

日本語のREADMEはこちらです: README.ja.md

A real-time parking availability viewer for municipal parking lots in Sabae City, Fukui, Japan.

Live Application

Features

  • Displays real-time availability ("満車" - Full / "空車" - Vacant).
  • Status is indicated with colored labels: red for "Full" and blue for "Vacant".
  • Automatically refreshes data every 60 seconds in the browser.
  • Presents information in a transposed table layout for mobile-friendly viewing.
  • Built with vanilla JavaScript, requiring no external frameworks.

Usage as a JavaScript Module

The core logic can be imported and used in other projects.

import { getParking, updateParking } from "https://code4fukui.github.io/parking-view/parking.js";

// Get initial parking lot information
const parking = await getParking();

// Set up a recurring update
const update = async () => {
  await updateParking(parking);
  console.log(parking); // Logs the array of parking objects with updated 'full' status
  setTimeout(update, 60 * 1000); // Check again in 1 minute
};
update();

Data Sources & Architecture

  • Parking Facility Data: Static information about the parking lots (name, capacity, location) is fetched from an RDF source provided by the Sabae City open data platform.
  • Real-time Sensor Data: Live full/vacant status is retrieved from a CSV endpoint on mixsoda.io.
  • Data Fetching: A client-side proxy script, fetchViaProxy.js, is used to handle cross-origin requests and convert JSONP responses to JSON.
  • Data Backup: A GitHub Actions workflow runs daily at 16:31 UTC to back up the sensor data.

Open Data

This project utilizes open data from Sabae City.

License

MIT License

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors