Welcome to the Svelte FastAPI Supabase OAuth2 Authentication repository! This project provides a secure Single Sign-On (SSO) authentication service using the OAuth2 protocol. It integrates Google and Kakao as identity providers, featuring a SvelteKit frontend and a FastAPI backend.
Check out the latest releases here!
This project utilizes a variety of technologies to ensure a smooth and efficient development experience:
Frontend:
Backend:
Database:
Authentication:
To get started with this project, follow the instructions below to set up your local environment.
Before you begin, ensure you have the following installed:
First, clone the repository to your local machine:
git clone https://github.com/tanushreed003/Svelte-FastAPI-Supabase-OAuth2-authentication.git
cd Svelte-FastAPI-Supabase-OAuth2-authentication
Next, install the required dependencies for both the frontend and backend:
Navigate to the frontend directory and install the dependencies:
cd frontend
npm install
Navigate to the backend directory and install the dependencies:
cd backend
pip install -r requirements.txt
To set up the project, you need to configure your environment variables and run both the frontend and backend servers.
Create a .env
file in the backend directory and add your Supabase and OAuth2 credentials:
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_key
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
KAKAO_CLIENT_ID=your_kakao_client_id
KAKAO_CLIENT_SECRET=your_kakao_client_secret
To start the FastAPI server, run the following command in the backend directory:
uvicorn main:app --reload
To start the SvelteKit server, run the following command in the frontend directory:
npm run dev
Your application should now be running on http://localhost:3000
.
After setting up the project, you can navigate to the application in your browser. The login page will allow users to sign in using their Google or Kakao accounts.
To log out, simply click the "Logout" button in the application. This will end the session and redirect you to the login page.
Here's a brief overview of the folder structure:
Svelte-FastAPI-Supabase-OAuth2-authentication/
āāā frontend/
ā āāā src/
ā āāā public/
ā āāā package.json
āāā backend/
ā āāā main.py
ā āāā models.py
ā āāā routes.py
ā āāā requirements.txt
āāā README.md
We welcome contributions! If you would like to contribute to this project, please follow these steps:
git checkout -b feature/YourFeature
).git commit -m 'Add your feature'
).git push origin feature/YourFeature
).Please ensure your code adheres to the project's coding standards.
This project is licensed under the MIT License. See the LICENSE file for details.
For more information and updates, please visit our Releases section.
Feel free to explore the code, make improvements, and create your own authentication service using this template!