Skip to content

yoonlight/node-firebase-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js Firebase Application

Command

  • install dependency
yarn
  • start server
yarn start
  • start dev server
yarn serve

Package

  • express: http web server
    • cookie-parser: parse http cookie
    • csurf: handle CSRF attack
    • cors: handle CORS
  • firebase: database, auth
  • firebase-admin: admin SDK to manage user
  • dotenv: manage env config

Structure

  • admin.js: initialize firebase admin app
  • config.js: manage environment variables
  • firebase.js: initialize firebase app
  • index.js: start express web app
  • userInfo.js: handle user's information data

use case

user information

  • create user info
  • update user info
  • get user info
    • return cache data if don't update info: use LRU cache

item information

  • create item info
  • update item info
  • get item info

Authorization

Server

  • sign up
    • verify email
      • issue: hide link's api key
  • check logged when using api
    • add login checker to middleware
    • manage cookie
    • add csrf
    • refresh expiration token
  • Session
    • Login
      • After cookie expires, actions?
      • Its check speed is too late... (about 1sec)
    • Logout

Client

  • login
  • logout

Reference

How to manage JWT in Firebase

Apply CSURF to Backend & Frontend to block CSRF

Firebase Login Form Error

Todo

Web

  • Login Web page
  • Session Login
  • Session Logout
  • Get user information
  • Login Form

Study

  • cookie
  • sameSite
  • CORS
  • CSRF
  • credential
  • set-cookie
  • cross-site

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published