Thanks to visit codestin.com
Credit goes to github.com

Skip to content

abarghoud/SentryGuard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

78 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

SentryGuard

License: AGPL-3.0 Node.js Version PRs Welcome Cloudflare

Real-time Tesla vehicle monitoring and security alerts via Telegram


πŸ’ Free & Non-Profit Project

SentryGuard is currently 100% free and open-source. This project is run on a non-profit basis and relies entirely on community donations to cover operational costs (hosting, infrastructure, API fees).

🎯 Our Commitment:

  • βœ… Currently free - no premium features, no paid tiers
  • βœ… Transparent costs - detailed expense reports available on request
  • βœ… Community-driven - funded by Tesla owners, for Tesla owners
  • βœ… Open-source - audit the code, contribute, or self-host

⚠️ Sustainability Notice:
If donations no longer cover operational expenses, the service may close, become paid at actual cost (~$0.50/user), or be limited to current users. Your support keeps it free and open for everyone!

Support the project:
Buy Me A Coffee

Every contribution helps keep SentryGuard running and improves security monitoring for the entire Tesla community! πŸ™


πŸš€ Join the Beta

Want to try SentryGuard? We're currently in beta and looking for Tesla owners to test the platform!

Sign up for beta access here:

Help us improve SentryGuard by being an early adopter. Your feedback will shape the future of the platform!


πŸŽ₯ Demo Video

See SentryGuard in action! Watch our demo video to understand how the platform works.

SentryGuard Demo

Click the image above to watch the demo video on YouTube


SentryGuard is a comprehensive security monitoring solution for Tesla vehicles. It tracks your vehicle's Sentry Mode status and sends instant Telegram notifications when suspicious activity is detected.

✨ Features

  • πŸ” Tesla OAuth Authentication - Secure login with your Tesla account
  • πŸ“± Telegram Integration - Instant alerts via deep linking (no manual chatId setup)
  • πŸš— Multi-Vehicle Support - Monitor all your Tesla vehicles
  • πŸ“Š Real-time Telemetry - Track Sentry Mode, receive a real-time telegram notification when a security event occurs
  • 🌐 SEO-Friendly WebApp - Next.js with server-side rendering
  • πŸ”’ Secure by Design - Encrypted token storage, secure communication
  • 🎨 Modern UI - Beautiful, responsive interface with Tailwind CSS

πŸ—οΈ Architecture

This is an Nx monorepo containing:

  • apps/api - NestJS backend API with TypeORM + PostgreSQL
  • apps/webapp - Next.js 15 frontend with App Router (SEO-optimized)

Tech Stack

Backend:

  • NestJS - Node.js framework
  • TypeORM - ORM with PostgreSQL
  • Telegraf - Telegram Bot API
  • Tesla Fleet API - Official Tesla API
  • Tesla Command Proxy

Frontend:

  • Next.js 15 - React framework with SSR
  • React 19 - UI library
  • Tailwind CSS - Styling
  • TypeScript - Type safety

SentryGuard.drawio.svg

πŸ“± How to Use

1. Login with Tesla

  • Visit the webapp and click "Login with Tesla"
  • Authenticate with your Tesla account
  • You'll be redirected to your dashboard

2. Configure Vehicles

  • Go to the Vehicles page
  • Your Tesla vehicles will be automatically synced
  • Enable telemetry for each vehicle you want to monitor

3. Link Telegram

  • Go to the Telegram page
  • Click "Generate Telegram Link"
  • Open the link in Telegram
  • Your account is now linked!
  • Test with "Send Test Message"

4. Receive Alerts

  • When Sentry Mode is triggered, you'll receive an instant Telegram notification

πŸ”§ Development

Run the API

npx nx serve api

Run the WebApp

npx nx serve webapp

Build for production

# API
npx nx build api

# WebApp
npx nx build webapp

Run tests

# API tests
npx nx test api

# WebApp tests
npx nx test webapp

Lint code

npx nx lint api
npx nx lint webapp

πŸ“Š Project Structure

SentryGuard/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ api/                    # NestJS Backend
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ auth/       # Tesla OAuth
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ telemetry/  # Vehicle telemetry
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ telegram/   # Telegram bot
β”‚   β”‚   β”‚   β”‚   └── zmq/        # ZMQ service
β”‚   β”‚   β”‚   β”œβ”€β”€ entities/       # TypeORM entities
β”‚   β”‚   β”‚   β”œβ”€β”€ config/         # Configuration
β”‚   β”‚   β”‚   └── common/         # Shared utilities
β”‚   β”‚   └── env.example
β”‚   β”‚
β”‚   └── webapp/                 # Next.js Frontend
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   β”œβ”€β”€ app/            # Next.js pages (App Router)
β”‚       β”‚   β”‚   β”œβ”€β”€ dashboard/  # Protected dashboard
β”‚       β”‚   β”‚   └── callback/   # OAuth callback
β”‚       β”‚   β”œβ”€β”€ components/     # React components
β”‚       β”‚   └── lib/            # Utilities & hooks
β”‚       └── tailwind.config.js
β”‚
β”œβ”€β”€ nx.json                     # Nx configuration
└── package.json

πŸ—„οΈ Database Schema

Users

  • Stores Tesla OAuth tokens (encrypted)
  • User profile information

Vehicles

  • Vehicle details (VIN, model, name)
  • Telemetry configuration status

Telegram Configs

  • Link tokens for deep linking
  • Chat IDs for sending alerts

πŸ” Security

  • Token Encryption: All Tesla access tokens are encrypted before storage
  • Secure Communication: HTTPS only in production
  • Differentiated Rate Limiting: Endpoints protected with adaptive rate limits (30-200 req/min depending on sensitivity)
    • Centralized configuration in apps/api/src/config/throttle.config.ts
    • No magic numbers - all limits defined as named constants
  • OAuth 2.0: Secure authentication flow with Tesla
  • No Plaintext Secrets: All sensitive data encrypted

For detailed security information, see SECURITY.md

☁️ Cloudflare Integration

SentryGuard is designed to work seamlessly with Cloudflare's infrastructure:

Cloudflare as CDN/Proxy

  • SSL/TLS: Cloudflare provides automatic HTTPS with flexible SSL options
  • DDoS Protection: Built-in protection against DDoS attacks
  • Rate Limiting: Additional edge-level rate limiting complements API-level controls
  • Caching: Static assets cached at Cloudflare's edge network
  • Analytics: Real-time analytics and insights

Setup with Cloudflare

  1. Add your domain to Cloudflare
  2. Configure DNS records:
    • api.yourdomain.com β†’ Your API server IP
    • yourdomain.com β†’ Your webapp server IP
  3. Enable Cloudflare Proxy (orange cloud)
  4. SSL/TLS Settings: Set to "Full (strict)" mode
  5. Firewall Rules: Configure WAF rules for additional security

Cloudflare Project Alexandria

SentryGuard is part of the Cloudflare Project Alexandria program, supporting open-source projects with Cloudflare's enterprise features.

🀝 Contributing

Contributions are welcome! Please read our Contributing Guide and Code of Conduct before submitting a Pull Request.

πŸ“„ License

This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.

Why AGPL-3.0?

We chose AGPL-3.0 to ensure that:

  • The software remains free and open source
  • Any modifications or improvements are shared with the community
  • Network usage (SaaS) requires source code disclosure
  • The project benefits from community contributions

⚠️ Disclaimer

SentryGuard is not affiliated with, endorsed by, or connected to Tesla, Inc. Tesla and the Tesla logo are trademarks of Tesla, Inc.

Use this software at your own risk. The authors are not responsible for any damage or issues that may arise from using this software.

πŸ†˜ Support

Note: A detailed setup guide with Docker support is coming soon!

πŸ™ Acknowledgments

🌟 Star History

If you find SentryGuard useful, please consider giving it a star ⭐

Star History Chart

πŸ“Š Project Status

  • βœ… Active Development: Regular updates and improvements
  • βœ… Community Driven: Open to contributions
  • βœ… Production Ready: Used by real Tesla owners
  • βœ… Well Documented: Comprehensive setup guides

Made with ❀️ for Tesla owners who care about their vehicle's security

Report Bug Β· Request Feature Β· Contribute

About

Free Real-time Tesla sentry security alerts via Telegram

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published