Skip to content

MathiasRanna/Praamid-Poller

Repository files navigation

PraamidPoller

Monitor Estonian ferry routes and get an email when tickets matching your criteria become available. Users create a ferry polling request (route, date, time window, vehicle type, language), the system polls the Praamid API and sends a localized email with bookable departures.

Public instance: ferry.finfratech.ee

Features

  • Monitor routes: Heltermaa ↔ Rohuküla, Kuivastu ↔ Virtsu
  • Time window filtering and vehicle type (car/truck) capacity checks
  • Localized UI and emails (EN/ET)
  • One‑off immediate poll on request creation, plus scheduled/background polling
  • Inertia React frontend with Tailwind; email via Laravel notifications

Tech Stack

  • Laravel 12, PHP 8.2, MariaDb
  • Inertia.js + React, Vite, Tailwind CSS

Getting Started

  1. Clone and install
    • composer install
    • npm install
  2. Environment
    • Copy .env.example to .env
    • Set APP_URL, APP_TIMEZONE=Europe/Tallinn
    • Configure mail: MAIL_MAILER, MAIL_HOST, MAIL_PORT, MAIL_USERNAME, MAIL_PASSWORD, MAIL_FROM_ADDRESS
    • Queue: QUEUE_CONNECTION=database
  3. Database and key
    • php artisan key:generate
    • Ensure database/database.sqlite exists (auto-created by composer scripts on first install)
    • php artisan migrate
  4. Run in development (concurrent server, queue, logs, Vite)
    • composer run dev

Alternatively, run individually:

  • php artisan serve
  • php artisan queue:listen --tries=1
  • npm run dev

Scheduling Polling

Run the polling command periodically (e.g., every 5 minutes):

php artisan ferry:poll

Example cron entry:

*/5 * * * * cd /path/to/PraamidPoller && /usr/bin/php artisan ferry:poll >> storage/logs/cron.log 2>&1

Usage

  1. Register/login
  2. From the welcome/dashboard, create a Ferry Request with:
    • Route, Date, Time from/to, Vehicle type (car/truck), Language (EN/ET)
  3. On create, an immediate poll runs; when a matching confirmed departure has capacity, you’ll receive an email with details and booking link.
  4. Requests auto‑delete after their time window passes.

Internationalization

The app and emails support English and Estonian. See INTERNATIONALIZATION.md for keys, usage, and extending languages.

Scripts

  • Dev: composer run dev
  • Build assets: npm run build
  • Tests: composer run test

Notable Paths

  • Service: app/Services/FerryPollingService.php
  • Console command: app/Console/Commands/PollFerryAvailability.php
  • Model: app/Models/FerryRequest.php
  • Notification: app/Notifications/FerryAvailableNotification.php
  • Routes: routes/web.php
  • Frontend: resources/js

Security & Contributions

Please open an issue or PR for bugs and improvements. Do not disclose security issues publicly—reach out privately.

License

MIT

About

Checks for available tickets for praamid.ee ferry tickets and notifies you

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors