File tree Expand file tree Collapse file tree 1 file changed +75
-0
lines changed Expand file tree Collapse file tree 1 file changed +75
-0
lines changed Original file line number Diff line number Diff line change 11# CRA TypeScript Firebase Template
2+
3+ ## ⚙️ Usage
4+
5+ ``` bash
6+ npx create-react-app your-project-name --template typescript-firebase
7+ ```
8+
9+ Or
10+
11+ ``` bash
12+ yarn create react-app your-project-name --template typescript-firebase
13+ ```
14+
15+ ` npx ` command installs the most recent stable version of CRA from npm.
16+
17+ ` --template ` parameter points to this template, note that ` cra-template- ` prefix is omitted.
18+
19+ ## ✨ Featues
20+
21+ ### 1. Routing
22+
23+ Routing setup using ` react-router-dom ` .
24+
25+ - With easily implementable private routes (routes only authenticated users can use).
26+
27+ - Easily add new screens.
28+
29+ ### 2. Authentication
30+
31+ Authentication implemented implemented
32+
33+ SignIn with Google implemented using ` firebase ` and ` react-firebase-hooks ` .
34+
35+ ### 3. Firebase Configured
36+
37+ Firebase configured with ` GoogleAuthProvider ` implemented.
38+
39+ ### 4. Material UI
40+
41+ Login Screen UI built using ` @mui/material ` .
42+
43+ ## 🔧 File Structure
44+
45+ ```
46+ ├── src
47+ │ ├── components
48+ │ │ ├── auth
49+ │ │ | ├── AuthChecker.tsx
50+ │ │ | ├── AuthContainer.tsx
51+ │ │ | ├── Logout.tsx
52+ │ │ ├── utils
53+ │ │ | ├── Center.tsx
54+ │ ├── config
55+ │ │ ├── firebase.config.ts
56+ │ │ ├── firebase.ts
57+ │ │ ├── routes.ts
58+ │ ├── screens
59+ │ │ ├── Login.tsx
60+ │ │ ├── Home.tsx
61+ ```
62+
63+ ### To create a new screen
64+
65+ 1 . Create a new component in ` src/screens `
66+
67+ 2 . In your ` src/config/routes.ts `
68+
69+ ``` tsx
70+ {
71+ path : " /your-route" ,
72+ component : YourScreenComponentName ,
73+ name : " Screen Name For Reference" ,
74+ protected : false , // if user needs to be authenticated to access this screen
75+ }
76+ ```
You can’t perform that action at this time.
0 commit comments