A modern Random Quote Generator built with React, TypeScript, Vite, and Tailwind CSS.
The application displays randomly selected quotes with a clean, responsive, and fast user interface.
This project emphasizes clean architecture, type safety, and scalable project structure, making it suitable for learning, experimentation, and portfolio use.
Deploy this project to see it live!
You can deploy it using Vercel, Netlify, or any other hosting platform.
- Framework: React
- Language: TypeScript
- Bundler: Vite
- Styling: Tailwind CSS
- Deployment: Vercel
- 🎲 Generate a random quote on each button click
- 🧠 Quotes managed in a structured, type-safe way
- ⚡ Fast development and build times with Vite
- 🎨 Responsive and minimal UI using Tailwind CSS
- 🧩 Clean and scalable folder structure
- 🔒 Full TypeScript type safety
random-quote-generator/
│
├─ public/
│ └─ favicon.svg
│
├─ src/
│ ├─ assets/
│ │ └─ quotes.ts
│ │
│ ├─ components/
│ │ ├─ QuoteCard.tsx
│ │ └─ GenerateButton.tsx
│ │
│ ├─ hooks/
│ │ └─ useRandomQuote.ts
│ │
│ ├─ types/
│ │ └─ quote.ts
│ │
│ ├─ App.tsx
│ ├─ main.tsx
│ ├─ index.css
│ └─ vite-env.d.ts
│
├─ index.html
├─ postcss.config.js
├─ tsconfig.json
├─ package.json
└─ vercel.json
Reusable UI elements such as QuoteCard and GenerateButton.
Business logic is isolated using a custom hook (useRandomQuote).
Static quote data is stored separately and typed.
Centralized TypeScript interfaces ensure consistency and safety.
This approach keeps the codebase clean, maintainable, and easy to scale.
git clone https://github.com/yourusername/random-quote-generator.git
cd random-quote-generatornpm installnpm run devOpen your browser at: http://localhost:5173
Create an optimized production build:
npm run buildPreview the production build locally:
npm run previewThis project is optimized for deployment on Vercel.
- Push the project to GitHub
- Import the repository into Vercel
- Configure the project:
- Framework Preset: Vite
- Build Command:
npm run build - Output Directory:
dist
- Deploy 🚀
- 🌐 Fetch quotes from an external API
- 🌙 Light / Dark mode toggle
- 💾 Save favorite quotes using localStorage
- 🐦 Share quotes on social platforms
- ✨ Add more animations and transitions
- ✅
Prevent repeated quotes(Already implemented!)
- Modern React + TypeScript development
- Clean separation of concerns
- Scalable project architecture
- Tailwind CSS best practices
- Mobile-responsive design
- Production-ready build and deployment workflow
This project is licensed under the MIT License.
If you find this project useful, consider giving it a star on GitHub.