React Starter Kit for Firebase a.k.a. Serverless Edition
React Starter Kit for Firebase is a popular project template (aka, boilerplate) for building modern, scalable web applications with React, Relay, and GraphQL using serverless infrastructure provided by Google Cloud (Cloud SQL, Cloud Functions, CDN hosting, and file storage). It allows you to save time and build upon a solid foundation and design patterns.
View online demo (API, data model) | Follow us on Twitter | Get FREE support on Discord | We're hiring!
This project was bootstrapped with React Starter Kit for Firebase by Kriasoft.
Tech Stack
Create React App (★ 73k) for development and test infrastructure (see user guide)
Material UI (★ 52k) to reduce development time by integrating Google's Material Design
Passport.js (★ 17k) for authentication configured with stateless JWT tokens for sessions
GraphQL.js (★ 15k) and Relay (★ 14k) for declarative data fetching and efficient client stage management
Universal Router (★ 1k) + history (★ 6k) for declarative routing and client-side navigation optimized for Relay
PostgreSQL database pre-configured with a query builder and migrations using Knex.js (★ 11k)
Google Cloud & Firebase for serverless architecture - Cloud SQL, Cloud Functions, CDN hosting, file storage (docs)
Directory Layout
Prerequisites
VS Code editor (preferred) + Project Snippets, EditorConfig, ESLint, Prettier, and Babel JavaScript plug-ins
Watchman file watcher used by Relay Modern
PostgreSQL v9.6 or newer, only if you're planning to use a local db for development
Getting Started
Just clone the repo, update environment variables in
.env and/or .env.local file, and start hacking:Then open http://localhost:3000/ to see your app.
In order to re-compile GraphQL fragments, run
yarn relay or yarn relay --watch (in watch mode).How to Migrate Database Schema
While the app is in development, you can use a simplified migration workflow by creating a backup of your existing database, making changes to the existing migration file (see
migrations/20180101000000_initial.js), re-apply the migration and restore data from the backup file (backup.sql):Upon deployment to production, switch to normal migration workflow:
HINT: Test your migration thoroughly with a local instance of the DB first (by using
--env=local or --env=dev (default) flag) then apply it to your test or prod database instance using --env=test or --env=prod command argument.Other helpful database scripts:
How to Test
How to Deploy
For more information refer to the Deployment guide in the project's Wiki.
How to Update
If you keep the original Git history after cloning this repo, you can always fetch and merge the recent updates back into your project by running:
NOTE: Try to merge as soon as the new changes land on the
master branch in the upstream repository, otherwise your project may differ too much from the base/upstream repo. Alternatively, you can use a folder diff tool like Beyond Compare for keeping your project up to date with the base repository.How to Contribute
Anyone and everyone is welcome to contribute to this project. The best way to start is by checking our open issues, submit a new issues or feature request, participate in discussions, upvote or downvote the issues you like or dislike, send pull requests.
Learn React.js and ES6
🎓 React for Beginners and ES6 Training Course by Wes Bos
📗 React: Up & Running: Building Web Applications by Stoyan Stefanov (Aug, 2016)
📗 Getting Started with React by Doel Sengupta and Manu Singhal (Apr, 2016)
📗 You Don't Know JS: ES6 & Beyond by Kyle Simpson (Dec, 2015)
Related Projects
React App SDK — Create React App modification that unlocks server-side rendering
React Starter Kit — Boilerplate and tooling for building isomorphic web apps with React and Relay
Node.js API Starter Kit — Boilerplate and tooling for building data APIs with Docker, Node.js and GraphQL
License
Copyright © 2015-present Kriasoft. This source code is licensed under the MIT license found in the LICENSE.txt file.
0 likes · 11 views · May 16, 2025
Developed a React and Firebase web app template for Kriasoft.