A customizable API dashboard that provides real-time weather updates, random images, Bitcoin prices, and Game of Thrones quotes. This project showcases API integrations, a light/dark theme toggle, and drag-and-drop functionality for module arrangement.
- Features
- Project Structure
- Technologies Used
- Setup and Installation
- Usage
- Future Improvements
- License
- Weather Module: Displays real-time weather data based on user location.
- Image Module: Shows random images with attribution.
- Bitcoin Module: Provides up-to-date Bitcoin prices.
- Quotes Module: Displays a random Game of Thrones quote.
- Light/Dark Theme: Toggle between light and dark modes for a better user experience.
- Drag-and-Drop: Rearrange modules with drag-and-drop functionality, which saves the layout in
localStorage. - Settings: Choose which modules to display and save preferences in
localStorage.
api-dashboard/
├── favicon.ico
├── index.html # Main HTML file
├── src/
│ ├── css/
│ │ ├── styles.css # Custom styles
│ │ └── themes.css # Light/Dark theme styles
│ ├── js/
│ │ ├── app.js # Main JavaScript application logic
│ │ ├── api/
│ │ │ ├── bitcoinAPI.js # Fetches Bitcoin data
│ │ │ ├── geolocationAPI.js # Fetches user location
│ │ │ ├── imageAPI.js # Fetches random image
│ │ │ ├── quotesAPI.js # Fetches random quote
│ │ │ └── weatherAPI.js # Fetches weather data
- HTML/CSS: Structure and styling.
- JavaScript (ES6): Core logic, API requests, theme toggling, and drag-and-drop functionality.
- Bootstrap: For responsive design and easy styling.
- Axios: To handle API requests.
- SortableJS: To enable drag-and-drop module rearrangement.
-
Clone the repository:
git clone https://github.com/your-username/api-dashboard.git cd api-dashboard -
Open
index.html: Open theindex.htmlfile in a web browser to view the dashboard. -
Dependencies: Ensure internet connectivity for external libraries (Bootstrap, Axios, Font Awesome, SortableJS).
-
Modules:
- Weather: Displays current weather based on IP location.
- Image: Shows a random image from the Picsum Photos API.
- Bitcoin: Shows the current Bitcoin price in USD.
- Quotes: Displays a random Game of Thrones quote.
-
Theme Toggle: Click the "Toggle Theme" button to switch between light and dark modes.
-
Settings Modal:
- Open settings by clicking "Settings" in the navbar.
- Choose which modules to display by checking/unchecking the options.
- Click "Save changes" to apply and save preferences.
-
Drag-and-Drop: Rearrange modules by dragging them. The arrangement is saved in
localStorage.
- Add More APIs: Integrate additional APIs to expand functionality (e.g., news, stock prices).
- User Authentication: Add user accounts for personalized module settings and theme preferences.
- Enhanced Error Handling: Improve error messages and fallback mechanisms for failed API requests.
This project is licensed under the MIT License - see the LICENSE file for details.