Skip to content

A quick start Create React App template with TypeScript, react-router-dom, material-ui, gh-pages and firebase. With google authentication, routing and deployment capabilities built in.

License

Notifications You must be signed in to change notification settings

pettiboy/cra-template-typescript-firebase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CRA TypeScript Firebase Template

npm License MIT PRs Welcome

React TypeScript NPM

Make sure you ⭐️ this repository if you find it helpful or interesting :)

✨ Installation

npx create-react-app your-project-name --template typescript-firebase

OR

yarn create react-app your-project-name --template typescript-firebase

⚙️ Usage

SetUp firebase

  1. Go to https://console.firebase.google.com/

  2. Click on Add project.

    • Follow steps and create project.
  3. Click on web icon.

    • Register web app.
    • You will get details for setting up Firebase SDK.
  4. Add your config details in your .env.

SetUp SignIn with google

  1. In your project console, click on Authentication and Get Started.

  2. In Sign-in method, click on Google.

  3. Toggle Enable and click on Save.

To create a new screen

  1. Create a new component in src/screens.

  2. In your src/config/routes.ts.

{ path: "/your-route", component: YourScreenComponentName, name: "Screen Name For Reference", protected: false, // if user needs to be authenticated to access this screen }

✨ Featues

1. Routing

Routing setup using react-router-dom.

  • With easily implementable private routes (routes only authenticated users can use).

  • Easily add new screens.

2. Authentication

Authentication implemented implemented

SignIn with Google implemented using firebase and react-firebase-hooks.

3. Firebase Configured

Firebase configured with GoogleAuthProvider implemented.

4. Material UI

Login Screen UI built using @mui/material.

🔧 File Structure

├── src │ ├── components │ │ ├── auth │ │ | ├── AuthChecker.tsx │ │ | ├── AuthContainer.tsx │ │ | ├── Logout.tsx │ │ ├── utils │ │ | ├── Center.tsx │ ├── config │ │ ├── firebase.config.ts │ │ ├── firebase.ts │ │ ├── routes.ts │ ├── screens │ │ ├── Login.tsx │ │ ├── Home.tsx 

About

A quick start Create React App template with TypeScript, react-router-dom, material-ui, gh-pages and firebase. With google authentication, routing and deployment capabilities built in.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published