Skip to content

SSzzPP/movecar-telegram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

πŸš— movecar-telegram - Move Car Notification System

Smart Move Car Notification System powered by Cloudflare Workers.

Features

  • πŸ’° Serverless architecture, zero operational costs.
  • πŸ”” Telegram instant push notifications.
  • 🚨 Two-way location sharing, reducing malicious harassment.
  • πŸ” Protect both parties' privacy.

Preview

Guides

πŸ‘€ Guest

  1. Visit Notify Car Owner page.
  2. Leave a message (optional), e.g. Your car is blocking me.
  3. Allow access to location (If denied, will delay notification by 30 seconds).
  4. Click Notify button.
  5. Awaiting car owner's reply, car owner's location can be viewed.

πŸ™Ž‍♂️ Car Owner

  1. Received a notification from Telegram
  2. Visit Confirm Remove Car page
  3. Check guest's location
  4. Click Confirm button, share your location with guest.

Architecture

sequenceDiagram
    participant Guest
    participant Car Owner

    Guest->>Guest: Visit 'Notify Car Owner' page
    Guest->>Guest: Access location

    alt Available
        Guest->>Car Owner: Push notification
    else Unavailable
        Guest->>Car Owner: Delay 30 seconds
    end

    Car Owner->>Car Owner: Received notification
    Guest->>Guest: Waiting...
    Car Owner->>Car Owner: Check guest's location
    Car Owner->>Guest: Share location
    Guest->>Guest: View Car Owner's location
Loading

Deploy

  1. Visit Cloudflare to Register an account.
  2. Go toγ€ŒWorkers & Pages」and create a worker.
  3. Worker code uses movecar.js and deploy it.
  4. Go toγ€ŒWorkers KV」and create a namespace named MOVE_CAR_STATUS.
  5. Return to worker and bind it.
  6. Add variables TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID, PHONE_NUMBER (optional), GOOGLE_MAPS_API_KEY(optional).
  7. Custom domain can be configured as needed.

Suggestions

πŸ’‘ You can package it nicely, e.g. QR Code or NFC Tag.

✨ Use third-party location services to meet more features.

⚠️ Restrict regional access to prevent malicious attacks

async function handleRequest(request) {
  const country = request.cf?.country;
  if (country && country !== "US") {
    return new Response("Access Denied", { status: 403 });
  }
  ...
}

License

movecar-telegram is MIT licensed.

About

πŸš— movecar-telegram - Smart Move Car Notification System, powered by Cloudflare Workers.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors