Skip to content

This repository contains a full-stack application that integrates Discord OAuth2 for authentication with Firebase to manage authenticated sessions.

Notifications You must be signed in to change notification settings

nawodyaishan/discord-firebase-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord-Firebase Authentication System

This repository contains a full-stack application that integrates Discord OAuth2 for authentication with Firebase to manage authenticated sessions. The system is divided into two main parts:

  • Backend (discord-auth-backend): Implemented with NestJS, it handles Discord OAuth2 authentication, user data retrieval, and Firebase custom token generation.
  • Frontend (discord-auth-frontend): Built with React, it utilizes Firebase to authenticate users based on the tokens generated by the backend and manage user sessions.

Repository Structure

.
├── discord-auth-backend    # Backend service using NestJS
│   ├── src
│   │   ├── app.controller.ts   # Handles incoming requests
│   │   ├── app.service.ts      # Business logic for Discord authentication
│   │   └── ...
│   └── package.json
├── discord-auth-frontend   # Frontend service using React
│   ├── src
│   │   ├── App.tsx         # Main React component
│   │   ├── auth            # Authentication related components
│   │   └── ...
│   └── package.json
└── README.md               # Repository documentation

Getting Started

Prerequisites

  • Node.js
  • Yarn or npm
  • Firebase project
  • Discord Developer Account

Installation

  1. Clone the repository

    git clone https://github.com/nawodyaishan/discord-firebase-auth.git
    cd discord-firebase-auth
  2. Set up the backend

    cd discord-auth-backend
    yarn install
    # Configure environment variables in .env file
    yarn start
  3. Set up the frontend

    cd ../discord-auth-frontend
    yarn install
    # Configure environment variables in .env file
    yarn start

Configuration

Ensure you have the necessary Discord credentials and Firebase configuration details set up in your environment variables or configuration files for both the backend and frontend services.

Usage

Navigate to http://localhost:3000 (or your configured frontend URL) to access the application and test the authentication flow using Discord.

Contributing

Contributions are welcome! Please feel free to submit a pull request or open issues to improve the documentation or code.