Discover Fascinating Facts Across Multiple Categories
FactVerse is a React-based web application that displays interesting facts across various categories. It fetches random facts using an API when All is selected and retrieves category-specific facts from Firebase Realtime Database. The app is fully responsive and works seamlessly on different screen sizes.
- Display Random Facts: Select a category (All, Science, Universe, History, Technology) to fetch a random fact.
- Dynamic Fact Fetching:
- All: Fetches random facts from Useless Facts API
- Specific Categories: Curated facts from Firebase Realtime Database
- Save Favorites: Save your favorite facts and manage them (add/delete).
- Responsive Design: Optimized for mobile π±, tablet, and desktop π».
- Secure: Firebase API keys are securely managed using environment variables π.
- React (HTML, CSS, JavaScript) - Frontend framework
- Bootstrap - Styling and responsiveness
- Firebase Realtime Database - Data storage for categorized facts
- Netlify - Deployment platform
To run FactVerse locally, follow these steps:
-
Clone the repository:
git clone https://github.com/Princepm02/FactVerse.git cd FactVerse -
Install dependencies:
npm install
-
Firebase Setup:
- Create Firebase project at Firebase Console
- Enable Realtime Database
- Structure your database with categories:
{ "facts": { "science": ["fact1", "fact2"], "history": ["fact1", "fact2"], "technology": ["fact1", "fact2"], "universe": ["fact1", "fact2"] } } -
Set up Firebase environment variables:
Create a
.envfile in the root directory and add the following:REACT_APP_FIREBASE_API_KEY=your_api_key REACT_APP_FIREBASE_AUTH_DOMAIN=your_auth_domain REACT_APP_FIREBASE_DATABASE_URL=your_database_url REACT_APP_FIREBASE_PROJECT_ID=your_project_id REACT_APP_FIREBASE_STORAGE_BUCKET=your_storage_bucket REACT_APP_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id REACT_APP_FIREBASE_APP_ID=your_app_id REACT_APP_FIREBASE_MEASUREMENT_ID=your_measurement_id
-
Start the development server:
npm start
FactVerse is deployed on Netlify. You can deploy your own version by linking your GitHub repository to Netlify and setting up environment variables in Netlifyβs UI.
FactVerse/
βββ src/
β βββ components/ # Reusable React components
β βββ firebase.js # Firebase configuration
β βββ App.js # Main application logic
β βββ App.css # Styling
β βββ index.js # Entry point
βββ public/
βββ .env # Environment variables (not committed to GitHub)
βββ package.json # Dependencies and scripts
βββ README.md # Project documentation
- Select a category: Use the dropdown to choose your fact category.
- Generate a fact: Click "Generate Fact" to display a random fact.
- Save your favorite: Click "Save to Favorites" to store the fact.
- Manage favorites: View and delete saved facts from the Saved Facts section.

Experience the magic of facts!
Contributions are always welcome! Feel free to:
- Fork the repository.
- Create a new branch (
feature/new-feature). - Commit your changes.
- Push to the branch.
- Open a Pull Request.
The website is deployed on Netlify. You can access it here.
Prince Mishra
Made with β€οΈ by Prince Mishra.