A simple project to demonstrate GitHub OAuth login integration with separate frontend and backend installations.
- GitHub OAuth authentication
- Secure session management
- User profile retrieval from GitHub
- Environment-based configuration
- Only supports GitHub as an OAuth provider
- No database integration (user data is not persisted)
- 500- GitHub API call per user per hours
git clone https://github.com/itsnarutouzumaki/contribution.git
cd github-login
cd backend
npm install
cd ../frontend
npm install
- Copy
.sample.env
to.env
in thebackend
directory:cp .sample.env .env
cd backend
npm run start
cd ../frontend
npm run dev
- Visit the frontend port and click "Login with GitHub"
Your backend/.env
file should look like as backend/.sample.env
- User clicks "Login with GitHub" on the frontend.
- User is redirected to GitHub for authentication.
- After successful login, GitHub redirects back to your backend.
- The backend exchanges the code for an access token.
- User profile information is retrieved and sent to the frontend for display.