A community-driven web application for tracking Tesla Model Y orders, delivery timelines, and statistics. Built with Next.js 16, React 19, and Prisma.
- Order Tracking: Track Tesla Model Y orders with detailed configuration information
- Statistics Dashboard: Visualize order trends, delivery timelines, and configuration distributions
- Multi-Quarter Support: Organize orders by quarter (Q1 2026, Q4 2025, Q3 2025, etc.)
- Real-time Updates: See when orders were last modified
- User Highlighting: Highlight your own order via URL parameter (
?user=yourname) - Dark Mode: Full dark mode support
- Mobile Responsive: Optimized for both desktop and mobile devices
- Admin Dashboard: Manage orders, options, and settings
- Data Import: Import orders from Google Sheets (Excel format)
- Framework: Next.js 16 with App Router
- Language: TypeScript
- Styling: Tailwind CSS 4 + shadcn/ui components
- Database: SQLite (local) / Turso (production)
- ORM: Prisma 7
- Charts: Recharts
- Forms: React Hook Form + Zod validation
- Authentication: JWT-based admin authentication
- Deployment: Vercel
- Node.js 18+
- npm, yarn, pnpm, or bun
-
Clone the repository:
git clone https://github.com/svenger87/tesla_order_tracker.git cd tesla_order_tracker -
Install dependencies:
npm install
-
Set up environment variables:
cp .env.example .env.local
-
Configure your
.env.local:# Database URL (for local SQLite) DATABASE_URL="file:./prisma/dev.db" # JWT Secret for admin authentication JWT_SECRET="your-secure-random-string-here" # Default admin credentials (used on first login) ADMIN_USERNAME="admin" ADMIN_PASSWORD="your-secure-password"
-
Initialize the database:
npx prisma generate npx prisma db push
-
Start the development server:
npm run dev
-
Open http://localhost:3000 in your browser.
- View Orders: Browse all tracked Tesla orders organized by quarter
- Statistics: View charts and statistics about orders, delivery times, and configurations
- Filtering: Filter orders by model, country, color, drive type, and more
- Sorting: Click column headers to sort by any field
- Search: Search orders by name
- User Highlighting: Add
?user=yournameto the URL to highlight your order
Access the admin dashboard at /admin/login.
- Manage Orders: Edit or delete any order
- Import Data: Import orders from Excel/Google Sheets exports
- Manage Options: Configure dropdown options (countries, colors, models, etc.)
- Settings: Configure donation links, archive settings, and more
Users can create orders using an "edit code" system:
- Click "Neue Bestellung" (New Order)
- Fill in your order details
- Set an optional edit code to protect your entry
- Use the same edit code later to modify your order
-
Link to Vercel:
vercel link
-
Set up Turso Database (production):
- Create a Turso database at turso.tech
- Get your database URL and auth token
- Add environment variables in Vercel:
TURSO_DATABASE_URL=libsql://your-database.turso.io TURSO_AUTH_TOKEN=your-turso-auth-token JWT_SECRET=your-production-jwt-secret ADMIN_USERNAME=admin ADMIN_PASSWORD=your-secure-admin-password
-
Deploy:
npm run deploy # or for preview npm run deploy:preview
Use the included deploy script:
# Linux/macOS
./deploy.sh "Your commit message"
# Windows PowerShell
.\deploy.ps1 "Your commit message"This script will:
- Commit any changes
- Push to GitHub
- Deploy to Vercel
The project uses SQLite for local development. The database file is stored at prisma/dev.db.
# Generate Prisma client
npx prisma generate
# Push schema changes
npx prisma db push
# View/edit data
npx prisma studioFor production, the app uses Turso (libSQL) for edge-compatible database hosting.
-
Create a Turso database:
turso db create tesla-tracker turso db show tesla-tracker
-
Get your credentials:
turso db tokens create tesla-tracker
-
The app automatically uses Turso when
TURSO_DATABASE_URLis set.
Import orders from Google Sheets:
- Export your Google Sheet as Excel (.xlsx)
- Place the file in the project root
- Run the import script:
npm run import:sheets
The script maps columns automatically based on German headers (Bestelldatum, Farbe, etc.).
| Endpoint | Method | Description |
|---|---|---|
/api/orders |
GET | List all orders |
/api/orders |
POST | Create a new order |
/api/orders/[id] |
PUT | Update an order |
/api/orders/[id] |
DELETE | Delete an order |
/api/options |
GET | List dropdown options |
/api/options |
POST | Create option (admin) |
/api/settings |
GET | Get app settings |
/api/settings |
PUT | Update settings (admin) |
/api/admin/login |
POST | Admin authentication |
tesla_order_tracker/
├── prisma/
│ ├── schema.prisma # Database schema
│ └── migrations/ # Database migrations
├── scripts/
│ └── import-from-sheets.ts # Data import script
├── src/
│ ├── app/
│ │ ├── api/ # API routes
│ │ ├── admin/ # Admin pages
│ │ └── page.tsx # Main page
│ ├── components/
│ │ ├── ui/ # shadcn/ui components
│ │ ├── statistics/ # Chart components
│ │ └── admin/ # Admin components
│ ├── hooks/ # React hooks
│ └── lib/ # Utilities and types
└── public/ # Static assets
| Variable | Required | Description |
|---|---|---|
DATABASE_URL |
Yes (local) | SQLite database path |
TURSO_DATABASE_URL |
Yes (prod) | Turso database URL |
TURSO_AUTH_TOKEN |
Yes (prod) | Turso authentication token |
JWT_SECRET |
Yes | Secret for JWT tokens |
ADMIN_USERNAME |
Yes | Default admin username |
ADMIN_PASSWORD |
Yes | Default admin password |
If you find this project helpful, consider supporting its development:
Your support helps cover hosting costs and motivates continued development. Thank you!
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is open source and available under the MIT License.