All Projects → eddedd88 → react-firebase-template

eddedd88 / react-firebase-template

Licence: other
Bootstrap a React + Firebase full stack application with every thing you need pre-configured: hosting, database, authentication, CI, Typescript, Material UI, PWA and other goodies.

Programming Languages

typescript
32286 projects
HTML
75241 projects

Projects that are alternatives of or similar to react-firebase-template

Material Ui Superselectfield
multiselection autocomplete dropdown component for Material-UI
Stars: ✭ 260 (+983.33%)
Mutual labels:  create-react-app, material-ui
Web
⚡️ Supercharged version of Create React App with all the bells and whistles.
Stars: ✭ 594 (+2375%)
Mutual labels:  create-react-app, material-ui
react-mui-pro-starter
Mix of Create React App and Material UI with set of reusable components and utilities to build professional React Applications faster.
Stars: ✭ 14 (-41.67%)
Mutual labels:  create-react-app, material-ui
chatty
A React single-page-application alternative client for the shacknews chatty.
Stars: ✭ 27 (+12.5%)
Mutual labels:  create-react-app, material-ui
ts-ui
Telar Social Network using Reactjs
Stars: ✭ 35 (+45.83%)
Mutual labels:  create-react-app, material-ui
Starter React Flux
Generate your React PWA project with TypeScript or JavaScript
Stars: ✭ 65 (+170.83%)
Mutual labels:  create-react-app, material-ui
React Social Network
Simple React Social Network
Stars: ✭ 409 (+1604.17%)
Mutual labels:  create-react-app, material-ui
react-typescript-material-ui-with-auth-starter
React + Material UI + Auth starter using TypeScript
Stars: ✭ 27 (+12.5%)
Mutual labels:  create-react-app, material-ui
Wanna
💡✔ Wanna is an implementation of a 21st-century to-do list app.
Stars: ✭ 189 (+687.5%)
Mutual labels:  create-react-app, material-ui
P32929.github.io
Second iteration of my portfolio - created using ReactJS, Material-UI, Overmind, etc
Stars: ✭ 84 (+250%)
Mutual labels:  create-react-app, material-ui
react-you-do-you
How I use React + Redux + Material-UI + TypeScript – you do you 💖
Stars: ✭ 103 (+329.17%)
Mutual labels:  create-react-app, material-ui
create-material-ui-app
create-react-app + storybook + storybook-addon-material-ui
Stars: ✭ 55 (+129.17%)
Mutual labels:  create-react-app, material-ui
react-intl.macro
Extract react-intl messages with babel-plugin-macros.
Stars: ✭ 39 (+62.5%)
Mutual labels:  create-react-app
sunshine
Sunshine allows you to manage suits of your automated tests directly from Java code.
Stars: ✭ 12 (-50%)
Mutual labels:  ci
golangci-lint
Fast linters Runner for Go
Stars: ✭ 11,019 (+45812.5%)
Mutual labels:  ci
public-ol-web-template
OrangeLoops Web Project Boilerplate
Stars: ✭ 28 (+16.67%)
Mutual labels:  create-react-app
docker-pega-web-ready
Docker project for generating a tomcat docker image for Pega
Stars: ✭ 46 (+91.67%)
Mutual labels:  ci
stepman
Step collection manager
Stars: ✭ 23 (-4.17%)
Mutual labels:  ci
jenkinsapi
A Python API for accessing resources and configuring Hudson & Jenkins continuous-integration servers
Stars: ✭ 790 (+3191.67%)
Mutual labels:  ci
Itunes-Top-100-albums
Fetching data from itunes api With lazy Loading using react
Stars: ✭ 14 (-41.67%)
Mutual labels:  create-react-app

Bootstrap a full stack application with pre-configured: hosting, database, authentication, CI, CD, component library, state management, form utils.

This template tries to make as many opinionated choices as possible about the dev stack in order to quickly build a product that could sustain a significant amount of traffic/users.

For this template to work all you will need is a Firebase project. I recommend using their free tier to start off.

Tech Stack:

  • create-react-app as the project's starting point, using the cra-template-pwa-typescript template, this includes:
    • React
    • Typescript
    • cra's bundling capabilities
    • Jest for testing
    • PWA pre-configured
  • Firebase for Hosting, Database (Firestore) with offline mode enabled, and Authentication
  • Github Actions to automate tests and deploys
  • material-ui component library
  • recoil for state management
  • react-hook-form for building forms quickly
  • react-testing-library for writing tests

Getting Started

After starting your repo with this template you need to configure your Firebase project:

  • Make sure you have enabled all the Firebase services you wish to use in your project
  • Copy your firebase config located at Firebase Project > Project Settings > Firebase SDK snippet > Config
  • Paste the firebase config to src/db/initFirebase.ts for the respective environment
  • Set your Firebase Project as default at .firebaserc

Automate Deploys to Firebase hosting

CI tests are configured out of the box, but to enable deploys to Firebase do the following:

  • Create a Firebase Auth Token locally: yarn firebase login:ci
  • Add the Firebase token to Github as a secret called FIREBASE_TOKEN. You can add secrets at Github Project > Settings > Secrets.
  • Open the file .github/workflows/ci.yml and uncomment the lines 25-30

Every time a commit is pushed to github, Github will automatically run the CI tests, build the app and deploy the new version to Firebase. See the ci workflow in .github/workflows/ci.yml for more details.

Development

Run the commands: yarn start. The Firebase server is run as an emulator locally, which means that it won't use any quota of your Firebase project.

The Firestore object has been extended with Typescript to enforce a database schema whenever you use firebase to access your Database, you can define it in src/types/Database.ts. You can then match the names of your Firestore Collections to your schema in src/types/FirestoreCollectionPaths.ts.

Testing

I recommend following the react-testing-library advice of writing tests that closely resemble the way your app is used. This means writing more integration tests where you render the whole app and test actual user functionalities.

You can find some functions to help with rendering the app and mocking Firestore collections in the /tests/utils folder. Here is an example of a test:

import renderApp from './utils/renderApp'
import { mockCollection } from './utils/firebaseMocks'

test('display all pets', () => {
  mockCollection('pets', { id: 'test', name: 'Abc' })
  const view = renderApp()
  expect(view.getByText('Abc')).toBeInTheDocument()
})

FAQ

Why is the Github Action workflow not running?

Make sure to "Allow all actions" in your Github Repo settings.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].