A production-ready backend API that fetches GitHub contribution data using the GitHub GraphQL API and serves it to the frontend.
Built with Node.js, Express, and secure environment variables, and deployed live on the cloud.
Live API:
https://githubcalendarapi.onrender.com/
This project was built to power a real frontend application with live GitHub contribution data instead of mock or static JSON.
It represents:
- My first fully deployed backend
- Real API integration
- Secure handling of secrets using .env
- End-to-end full-stack thinking
What started as rejection became real engineering.
- Backend: Node.js, Express
- API: GitHub GraphQL API
- Authentication: GitHub Personal Access Token (via environment variables)
- Deployment: Render
- Module System: ES Modules
- Security: .env for secrets
Base URL: https://githubcalendarapi.onrender.com/
Method: GET
Description: Fetches GitHub contribution activity (last 12 months) for the configured user and returns raw GraphQL data.
{ "data": { "user": { "contributionsCollection": { "contributionCalendar": { "weeks": [ { "contributionDays": [ { "date": "2025-01-10", "contributionCount": 3 } ] } ] } } } } }
useEffect(() => { fetch("https://githubcalendarapi.onrender.com/") .then(res => res.json()) .then(data => { console.log(data); }) .catch(err => console.error(err)); }, []);
This project uses a GitHub Personal Access Token stored securely in .env.
.env file (local): GITHUB_TOKEN=ghp_your_github_token_here
Important:
- Never commit .env to GitHub
- The token is injected securely during deployment (Render environment variables)
-
Clone the Repository
git clone https://github.com/your-username/github-calendar-api.git
cd github-calendar-api -
Install Dependencies
npm install -
Create .env
GITHUB_TOKEN=your_github_personal_access_token -
Start the Server
npm start
Server will run on:
http://localhost:5000/
The backend is deployed using Render with:
- Environment variables for secrets
- Dynamic port handling via process.env.PORT
Live Version:
https://githubcalendarapi.onrender.com/
- Working with real-world APIs
- Using GraphQL in production
- Securing secrets using environment variables
- Handling async requests in Express
- Debugging real backend errors
- Deploying a live backend service
- Connecting backend to frontend
This project marks my transition from learning backend to building real backend systems.
- Dynamic username support (/username)
- Format response for heatmaps and charts
- GitHub OAuth login (no tokens required)
- Caching for better performance
- Frontend dashboard integration
Amrit Bhardwaj
Electronics & Communication Engineering Student
Backend • Frontend • Full-Stack Enthusiast
"I waited a year for this moment. I didn’t quit. I built."