Skip to content

A template repository for implementing Firebase Authentication with Flask and JavaScript. This template provides a basic setup for integrating Firebase Authentication into web applications using Flask as the backend framework. It includes functionalities for user signup, signin, signout, and session management.

License

Notifications You must be signed in to change notification settings

BaranDev/Firebase-Authentication-Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Firebase Authentication Template

A comprehensive Flask-based template for implementing Firebase Authentication with a modern JavaScript frontend.

Features

  • Email/Password authentication
  • Secure password hashing
  • Session management
  • Responsive UI with modals
  • Firebase configuration management
  • User session persistence
  • Error handling

Prerequisites

  • Python 3.x
  • Node.js (for npm packages)
  • Firebase account
  • Modern web browser

Installation

  1. Clone the Repository
git clone https://github.com/barandev/Firebase-Authentication-Template.git
cd Firebase-Authentication-Template
  1. Setup Firebase Project
  • Create a project in Firebase Console
  • Enable Email/Password authentication
  • Copy your Firebase configuration
  • Edit the .env file with your Firebase credentials:
FIREBASE_API_KEY=your_api_key
FIREBASE_AUTH_DOMAIN=your_auth_domain
FIREBASE_DATABASE_URL=your_database_url
FIREBASE_PROJECT_ID=your_project_id
FIREBASE_STORAGE_BUCKET=your_storage_bucket
FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id
FIREBASE_APP_ID=your_app_id
FIREBASE_MEASUREMENT_ID=your_measurement_id

Don't forget to put *.env inside your .gitignore file afterwards.

  1. Install Dependencies
pip install -r requirements.txt
  1. Run Application
python main.py
  1. Access Application
  • Open browser at http://localhost:8080

Customization Guide

Frontend

  • Modify HTML templates in /templates
  • Update styles in /static/css/style.css
  • Customize JavaScript logic in /static/js

Backend

  • Edit route handlers in main.py
  • Add new Flask routes as needed
  • Implement additional security measures

Firebase Features

  • Add Firestore integration
  • Implement Cloud Messaging
  • Enable other Firebase services

Security Considerations

  • Environment variables for sensitive data
  • Password hashing implementation
  • Session management
  • CSRF protection
  • Secure authentication flow

Contributing

  1. Fork the repository
  2. Create feature branch
  3. Commit changes
  4. Push to branch
  5. Create Pull Request

GitHub release (latest by date) GitHub License GitHub last commit

About

A template repository for implementing Firebase Authentication with Flask and JavaScript. This template provides a basic setup for integrating Firebase Authentication into web applications using Flask as the backend framework. It includes functionalities for user signup, signin, signout, and session management.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published