THELEEROOMMOTORS
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data β all from the browser, and deployed in milliseconds.
A comprehensive, secure, and scalable car dealership website with user and admin functionality.
- Browse and search cars by brand, model, year, price, mileage, fuel type
- View detailed car specifications with image galleries
- User registration and authentication (JWT-based)
- Wishlist and car comparison functionality
- Contact dealership and request test drives
- Responsive mobile-first design
- Complete admin dashboard for car inventory management
- User account and inquiry management
- Analytics and reporting on car views and leads
- Role-based access control
- Bulk operations and advanced filtering
- RESTful API with comprehensive endpoints
- JWT authentication with refresh tokens
- Role-based authorization (user/admin)
- Image upload and management
- Advanced search and filtering
- Responsive UI with Tailwind CSS
- SQLite database (easily upgradeable to PostgreSQL)
βββ backend/
β βββ database/
β β βββ migrations.ts # Database schema and migrations
β β βββ queries.ts # Database query functions
β β βββ README.md
β βββ routes/
β β βββ auth.ts # Authentication routes
β β βββ cars.ts # Car management routes
β β βββ users.ts # User management routes
β β βββ admin.ts # Admin-specific routes
β β βββ static.ts # Static file serving
β βββ middleware/
β β βββ auth.ts # JWT authentication middleware
β β βββ validation.ts # Request validation
β βββ utils/
β β βββ jwt.ts # JWT utilities
β β βββ security.ts # Security utilities
β βββ index.ts # Main backend entry point
β βββ README.md
βββ frontend/
β βββ components/
β β βββ App.tsx # Main app component
β β βββ Layout/ # Layout components
β β βββ Auth/ # Authentication components
β β βββ Cars/ # Car-related components
β β βββ Admin/ # Admin dashboard components
β β βββ Common/ # Shared components
β βββ hooks/ # Custom React hooks
β βββ services/ # API service functions
β βββ types/ # TypeScript type definitions
β βββ utils/ # Frontend utilities
β βββ index.html # Main HTML template
β βββ index.tsx # Frontend entry point
β βββ style.css # Global styles
β βββ README.md
βββ shared/
β βββ types.ts # Shared TypeScript types
β βββ constants.ts # Shared constants
β βββ utils.ts # Shared utility functions
βββ README.md
- The backend runs on Hono framework with TypeScript
- Frontend uses React 18 with TypeScript and Tailwind CSS
- Database uses SQLite with comprehensive schema
- Authentication uses JWT with role-based access control
- JWT authentication with refresh tokens
- Role-based access control (user/admin)
- Password hashing with bcrypt
- Request validation and sanitization
- CORS handling
- Rate limiting protection
- SQL injection prevention
- users: User accounts with roles and profiles
- cars: Vehicle inventory with specifications
- car_images: Multiple images per vehicle
- wishlists: User saved cars
- inquiries: Contact requests and test drive bookings
- analytics: Page views and user interactions
- Mobile-first responsive design
- Advanced search and filtering
- Image galleries with zoom
- Comparison tools
- Real-time updates
- Loading states and error handling
- Accessibility compliance
- Car inventory management (CRUD operations)
- User account management
- Inquiry and lead tracking
- Analytics and reporting
- Bulk operations
- Role management
POST /api/auth/register
- User registrationPOST /api/auth/login
- User loginPOST /api/auth/refresh
- Token refreshPOST /api/auth/logout
- User logout
GET /api/cars
- List cars with filteringGET /api/cars/:id
- Get car detailsPOST /api/cars
- Add new car (admin)PUT /api/cars/:id
- Update car (admin)DELETE /api/cars/:id
- Delete car (admin)
GET /api/users/profile
- Get user profilePUT /api/users/profile
- Update profileGET /api/users/wishlist
- Get user wishlistPOST /api/users/wishlist/:carId
- Add to wishlist
GET /api/admin/users
- List all usersGET /api/admin/analytics
- Get analytics dataGET /api/admin/inquiries
- List inquiries
The application is designed to be deployed on Val Town with:
- Backend API serving on HTTP trigger
- Frontend served as static files
- SQLite database for data persistence
- Environment variables for configuration