Skip to content

publi0/telegram-package-notifier-bot

Repository files navigation

Package Notifier Bot

Receve information about your packages with this telegram bot!

Demo

  1. Starting the bot

image

  1. Choose an option

image

  1. Add an package

image image

  1. My Packages

image

  1. Package Info

image

Stack

  • Java 17
  • Spring Boot
  • Spring Security
  • Auth0
  • MongoDB
  • RabbitMQ
  • TelegramBot

Shippiment Companies

How is structure?

image

  • Companies are structured in a Strategy model

image

Shipping Company interface

image

Factory for finding correct shippiment company

image

Example of usage

How to add a new company?

  1. Implement this interface

image

  1. Create a enum for the company

image

  1. If you need to add some variables this is the place

image

Its done! You have a new company!

How I get the updastes?

  1. A scheduler will trigger a method that find all actives packages in database(mongoDB) and for each is search if has new updates
  2. If there is a new update they will be save in database and a message will be send to the user in telegram

Endpoints for direct updates - API Reference

Get all tracking events

  GET /api/tracking/{company}/{trackingNumber}
Parameter Type Description
Path: company string Required. Shippiment company
Path: trackingNumber string Required. Track id
Header: Authorization string Required. Authorization

Get latest tracking event

  GET /api/tracking/{company}/{trackingNumber}/latest
Parameter Type Description
Path: company string Required. Shippiment company
Path: trackingNumber string Required. Track id
Header: Authorization string Required. Authorization