Skip to content

Commit 465df38

Browse files
Merge branch 'main' into trivia
2 parents 0dfe644 + b4194c2 commit 465df38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+5364
-612
lines changed

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
VITE_OMDB_API_KEY=your_api_key_here
2+
VITE_WEATHER_API_KEY=your_api_key_here

.github/workflows/require-assigned-issue.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Here if the issue is not referenced in PR an alert pops up
12
name: Require referenced assigned issue
23

34
on:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ dist
33
.DS_Store
44
*.log
55
package-lock.json
6+
.env

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ src/
2424

2525
If you’re unsure where to start, open a discussion or comment on an issue to be assigned.
2626

27+
> Pro Tip : If you raise a valid issue - you WILL BE assigned that
28+
2729
## Contribution Ideas
2830
General:
2931
- Add accessibility (aria labels, focus states, skip links)

CONTRIBUTORS.html

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1" />
6+
<title>Contributors — commitra/react-verse</title>
7+
<style>
8+
body { font-family: Inter, Arial, sans-serif; margin: 32px; color: #111827; }
9+
h1 { font-size: 1.6rem; margin-bottom: 8px; }
10+
.controls { margin-bottom: 16px; }
11+
.grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 12px; }
12+
.card { border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; display:flex; gap:12px; align-items:center; }
13+
img { width:56px; height:56px; border-radius:50%; }
14+
.meta { display:flex; flex-direction:column; }
15+
.login { font-weight:600; }
16+
.small { color:#6b7280; font-size:0.9rem }
17+
.error { color: #b91c1c; }
18+
footer { margin-top: 24px; color:#6b7280; font-size:0.85rem }
19+
.spinner { animation:spin 1s linear infinite; border:2px solid #e5e7eb; border-top-color:#374151; border-radius:50%; width:18px; height:18px; }
20+
@keyframes spin { to { transform: rotate(360deg); } }
21+
</style>
22+
</head>
23+
<body>
24+
<h1>Contributors to commitra/react-verse</h1>
25+
<div class="controls">
26+
<label for="token">Personal access token (optional, increases rate limits): </label>
27+
<input id="token" placeholder="ghp_... (optional)" style="width:360px;" />
28+
<button id="load">Load contributors</button>
29+
<span id="status"></span>
30+
</div>
31+
32+
<div id="results"></div>
33+
34+
<footer>
35+
This page fetches contributor data from the GitHub REST API: /repos/commitra/react-verse/contributors. If you see incomplete results, the repository may have many contributors — open issues or try providing a personal access token.
36+
</footer>
37+
38+
<script>
39+
const owner = 'commitra';
40+
const repo = 'react-verse';
41+
const perPage = 100;
42+
43+
const statusEl = document.getElementById('status');
44+
const resultsEl = document.getElementById('results');
45+
const tokenEl = document.getElementById('token');
46+
const loadBtn = document.getElementById('load');
47+
48+
function setStatus(text, isError) {
49+
statusEl.textContent = text || '';
50+
statusEl.className = isError ? 'error' : '';
51+
}
52+
53+
async function fetchContributors(token) {
54+
setStatus('Loading contributors...', false);
55+
resultsEl.innerHTML = '<div class="spinner" style="display:inline-block;margin-left:8px;"></div>';
56+
57+
const headers = { 'Accept': 'application/vnd.github+json' };
58+
if (token) headers['Authorization'] = `token ${token}`;
59+
60+
const url = `https://api.github.com/repos/${owner}/${repo}/contributors?per_page=${perPage}&anon=1`;
61+
62+
try {
63+
const res = await fetch(url, { headers });
64+
if (res.status === 403) {
65+
const rate = res.headers.get('x-ratelimit-remaining');
66+
const reset = res.headers.get('x-ratelimit-reset');
67+
setStatus(`Rate limited by GitHub API. Remaining: ${rate}. Reset: ${reset ? new Date(reset*1000).toLocaleString() : 'unknown'}`, true);
68+
resultsEl.innerHTML = '';
69+
return [];
70+
}
71+
if (!res.ok) {
72+
const txt = await res.text();
73+
setStatus(`GitHub API error: ${res.status} ${res.statusText}` , true);
74+
resultsEl.innerHTML = `<pre class="error">${escapeHtml(txt)}</pre>`;
75+
return [];
76+
}
77+
const data = await res.json();
78+
setStatus('Loaded contributors (' + data.length + ').', false);
79+
return data;
80+
} catch (err) {
81+
setStatus('Network or CORS error: ' + err.message, true);
82+
resultsEl.innerHTML = '';
83+
return [];
84+
}
85+
}
86+
87+
function escapeHtml(s) {
88+
return s.replace(/[&<>'"]/g, c => ({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":"&#39;"}[c]));
89+
}
90+
91+
function render(contributors) {
92+
if (!contributors || contributors.length === 0) {
93+
resultsEl.innerHTML = '<p>No contributors found.</p>';
94+
return;
95+
}
96+
97+
const grid = document.createElement('div');
98+
grid.className = 'grid';
99+
100+
contributors.forEach(c => {
101+
const card = document.createElement('div');
102+
card.className = 'card';
103+
104+
const avatar = document.createElement('img');
105+
avatar.src = c.avatar_url || '';
106+
avatar.alt = c.login || c.name || 'contributor';
107+
108+
const meta = document.createElement('div');
109+
meta.className = 'meta';
110+
111+
const login = document.createElement('a');
112+
login.className = 'login';
113+
login.href = c.html_url || '#';
114+
login.textContent = c.login || (c.name || 'unknown');
115+
login.target = '_blank';
116+
117+
const details = document.createElement('div');
118+
details.className = 'small';
119+
details.innerHTML = `Contributions: ${c.contributions || 0}${c.type ? ' • type: ' + c.type : ''}`;
120+
121+
meta.appendChild(login);
122+
meta.appendChild(details);
123+
124+
card.appendChild(avatar);
125+
card.appendChild(meta);
126+
127+
grid.appendChild(card);
128+
});
129+
130+
resultsEl.innerHTML = '';
131+
resultsEl.appendChild(grid);
132+
}
133+
134+
loadBtn.addEventListener('click', async () => {
135+
const token = tokenEl.value.trim() || null;
136+
const data = await fetchContributors(token);
137+
render(data);
138+
});
139+
140+
// Auto-load on open if no token and quick fetch allowed
141+
(async function autoLoad(){
142+
// try to read token from URL query param ?token= or from localStorage
143+
const params = new URLSearchParams(location.search);
144+
const urlToken = params.get('token');
145+
const stored = localStorage.getItem('GITHUB_TOKEN');
146+
if (urlToken) tokenEl.value = urlToken;
147+
else if (stored) tokenEl.value = stored;
148+
149+
// auto-fetch small list but only if not explicitly skipped
150+
try {
151+
const data = await fetchContributors(tokenEl.value.trim() || null);
152+
render(data);
153+
} catch(e) { /* ignore */ }
154+
})();
155+
156+
// store token if user enters one
157+
tokenEl.addEventListener('change', () => {
158+
const v = tokenEl.value.trim();
159+
if (v) localStorage.setItem('GITHUB_TOKEN', v);
160+
else localStorage.removeItem('GITHUB_TOKEN');
161+
});
162+
</script>
163+
</body>
164+
</html>

README.md

Lines changed: 90 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,96 @@
1-
# React Verse – Free API Dashboard (Hacktoberfest)
2-
3-
An all-in-one React (Vite) dashboard showcasing multiple free, no-auth public APIs. Built as a friendly Hacktoberfest playground for first-time and seasoned contributors alike.
4-
5-
## Dashboards Implemented
6-
- Weather (wttr.in)
7-
- Cryptocurrency (CoinGecko)
8-
- Space & Astronomy (Open Notify – ISS + Astronauts)
9-
- Movies (Studio Ghibli API)
10-
- Recipes (TheMealDB)
11-
- Trivia Quiz (Open Trivia DB)
12-
- Jokes & Quotes (Official Joke API + Quotable)
13-
- Dog / Cat Images (Dog CEO + Cataas)
14-
- COVID-19 Tracker (covid19api.com)
15-
16-
## Quick Start
1+
# 🌐 ReactVerse – The Open API Playground
2+
3+
**ReactVerse** is an open-source API dashboard built with **React + Vite**, designed to help developers explore, visualize, and learn how to integrate public APIs safely and responsibly.
4+
It’s more than just a project — it’s a **community-driven learning space** for understanding how APIs work, managing data securely, and contributing meaningfully to open source.
5+
6+
Perfect for **beginners**, and **API enthusiasts** who want to get hands-on experience using real-world APIs.
7+
8+
---
9+
10+
## 🚀 What’s Inside
11+
12+
A collection of interactive dashboards that fetch and display data from **free, no-auth public APIs** — all in one unified, open-source interface.
13+
14+
| Dashboard | API Used | Description |
15+
| --------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
16+
| ☀️ Weather | [wttr.in](https://wttr.in/:help) | Get real-time weather updates and forecasts |
17+
| 💰 Cryptocurrency | [CoinGecko](https://www.coingecko.com/en/api) | Track live crypto prices and market data |
18+
| 🛰️ Space & Astronomy | [Open Notify](http://open-notify.org/Open-Notify-API/) | View ISS location and current astronauts in orbit |
19+
| 🎬 Movies | [Studio Ghibli API](https://ghibliapi.vercel.app/) | Explore Studio Ghibli’s magical movie catalog |
20+
| 🍳 Recipes | [TheMealDB](https://www.themealdb.com/api.php) | Find meal ideas and cooking inspiration |
21+
| 🎯 Trivia Quiz | [Open Trivia DB](https://opentdb.com/api_config.php) | Challenge yourself with fun trivia questions |
22+
| 😂 Jokes & Quotes | [Joke API](https://official-joke-api.appspot.com/) + [Quotable](https://github.com/lukePeavey/quotable) | Daily dose of humor and motivation |
23+
| 🐶🐱 Pets | [Dog CEO](https://dog.ceo/dog-api/) + [Cataas](https://cataas.com/#/) | Random cute dog and cat images |
24+
| 🦠 COVID-19 Tracker | [COVID19 API](https://covid19api.com/) | Track pandemic stats and trends globally |
25+
26+
---
27+
28+
## 🧠 Why ReactVerse?
29+
30+
* 🧩 **Learn by doing** — See how public APIs work and how to safely handle data fetching.
31+
* 🔐 **Promote API safety** — No API keys, no secrets, just best practices for secure integration.
32+
* 🌍 **Open to everyone** — Ideal for contributors learning React, APIs, or GitHub workflows.
33+
* 💬 **Collaborative & inclusive** — A space where you can build, break, and improve together.
34+
35+
---
36+
37+
## ⚙️ Quick Start
38+
1739
```bash
1840
npm install
1941
npm run dev
2042
```
21-
Open http://localhost:5173
22-
23-
## Tech Stack
24-
- React 18 + Vite
25-
- React Router v6
26-
- Fetch API (no extra client)
27-
- Simple CSS (custom light/dark theme)
28-
29-
## Contributing (Hacktoberfest)
30-
See `CONTRIBUTING.md` for detailed instructions, ideas, and open enhancement areas. Beginner-friendly issues will be labeled.
31-
32-
## Roadmap / TODO Highlights
33-
- Enhance UI polish, accessibility, and animations
34-
- Add search, filters, and favorites persistence per dashboard
35-
- Add charts (price trends, COVID daily trends, weather graphs)
36-
- Replace placeholder chart component with a real library
37-
- Add service worker + offline caching for selected data
38-
- Add testing (Vitest + React Testing Library)
39-
- Add type safety (TypeScript migration) – optional future step
40-
41-
## API References
42-
| Area | API | Docs |
43-
| ---- | --- | ---- |
44-
| Weather | wttr.in | https://wttr.in/:help |
45-
| Crypto | CoinGecko | https://www.coingecko.com/en/api |
46-
| Space | Open Notify | http://open-notify.org/Open-Notify-API/ |
47-
| Movies | Studio Ghibli | https://ghibliapi.vercel.app/ |
48-
| Recipes | TheMealDB | https://www.themealdb.com/api.php |
49-
| Trivia | Open Trivia DB | https://opentdb.com/api_config.php |
50-
| Jokes | Official Joke API | https://official-joke-api.appspot.com/ |
51-
| Quotes | Quotable | https://github.com/lukePeavey/quotable |
52-
| Pets | Dog CEO / Cataas | https://dog.ceo/dog-api/ / https://cataas.com/#/ |
53-
| COVID-19 | COVID19 API | https://covid19api.com/ |
54-
55-
## License
56-
MIT – see `LICENSE`.
57-
58-
## Acknowledgements
59-
Community-driven project for educational purposes. External API data © respective providers.
60-
61-
## Credits
62-
63-
Hrishikesh Dalal (https://www.hrishikeshdalal.tech/)
64-
65-
Venisha Kalola (https://www.venishakalola.tech/)
6643

44+
Then open [http://localhost:5173](http://localhost:5173) in your browser.
45+
46+
---
47+
48+
## 🧰 Tech Stack
49+
50+
* ⚛️ React 18 + Vite
51+
* 🧭 React Router v6
52+
* 🌐 Fetch API (no external client)
53+
* 🎨 Custom Light/Dark CSS Theme
54+
55+
---
56+
57+
## 🤝 Contributing
58+
59+
We welcome contributions of all levels — from design tweaks to feature enhancements!
60+
61+
* Check out `CONTRIBUTING.md` for setup instructions and issue labels.
62+
* Look for **`good first issue`** or **`help wanted`** tags to get started.
63+
* Participate in **Hacktoberfest** and grow your open-source journey with us.
64+
65+
---
66+
67+
## 🗺️ Roadmap
68+
69+
* ✨ Improve UI/UX and accessibility
70+
* 🔍 Add search, filters, and persistent favorites
71+
* 📊 Integrate charts (e.g. weather graphs, price trends)
72+
* 🧱 Introduce a real charting library (e.g. Recharts or Chart.js)
73+
* ⚙️ Add offline caching with service workers
74+
* 🧪 Include testing (Vitest + React Testing Library)
75+
* 🧾 Optional: Migrate to TypeScript for type safety
76+
77+
---
78+
79+
80+
## 🪪 License
81+
82+
MIT – see `LICENSE` for full details.
83+
84+
---
85+
86+
## 💡 Acknowledgements
87+
88+
This project is community-built for **educational and open-source learning** purposes.
89+
90+
---
91+
92+
## 👥 Credits
93+
94+
* [Hrishikesh Dalal](https://www.hrishikeshdalal.tech/)
95+
* [Venisha Kalola](https://www.venishakalola.tech/)
6796

favicon/android-chrome-192x192.png

16.4 KB
Loading

favicon/android-chrome-512x512.png

50.6 KB
Loading

favicon/apple-touch-icon.png

14.8 KB
Loading

favicon/favicon-16x16.png

675 Bytes
Loading

0 commit comments

Comments
 (0)