A modern, responsive Tesla-inspired website built with React, Node.js, and MongoDB.
- Responsive landing page with full-screen hero sections
- Product pages with detailed specifications
- Car customizer with real-time price updates
- User authentication (signup/login)
- Order management system
- Frontend: React (TypeScript), Tailwind CSS
- Backend: Node.js, Express, MongoDB
- Authentication: JWT, bcrypt
git clone <repository-url>
cd tesla-clone# Frontend
cd frontend
npm install
# Backend
cd ../backend
npm installRename the .env.example file in the backend directory to .env and edit your details:
PORT=5000
MONGODB_URI=your-mongodb-uri
JWT_SECRET=your-secret-key
- For local MongoDB:
MONGODB_URI=mongodb://localhost:27017/tesla - For MongoDB Atlas, use your connection string.
Note: This step is not required now because the database gets auto-seeded by server.ts.
Populate the database with Tesla products:
cd backend
npx ts-node src/seed.ts# Backend
cd backend
npm run dev
# Frontend (new terminal)
cd frontend
npm start- Frontend: http://localhost:3000
- Backend: http://localhost:5000
The application is deployed on Render:
- Frontend: Static site hosting - https://tesla-ev-clone-website.onrender.com/
- Backend: Web service with automatic deployments - https://ev-website-m7td.onrender.com/
- Database: MongoDB Atlas
- Browse Tesla models, view details, and customize your car.
- Place an order (requires login).
- Orders and users are saved in MongoDB.
- Register a new user or log in from the "Login" button in the navbar.
- Browse Tesla models, view details, and customize your car.
- Place an order (requires login).
- Orders and users are saved in MongoDB.
- Deploy the
frontendfolder using your preferred static hosting.
- Deploy the
backendfolder as a Node.js service. - Set environment variables in your hosting dashboard.
POST /api/auth/register— Register new userPOST /api/auth/login— User login
GET /api/products— Get all productsGET /api/products/:id— Get product details
POST /api/orders— Place order (requires JWT)GET /api/orders— Get user orders (requires JWT)
- Fork the repository
- Create your feature branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -m 'Add feature') - Push to the branch (
git push origin feature/your-feature) - Open a Pull Request