Được TopGit lập chỉ mục từ metadata GitHub: kriasoft/react-firebase-starter có 4.5k sao, viết chủ yếu bằng JavaScript. Boilerplate (seed) project for creating web apps with React.js, GraphQL.js and Relay
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
React Starter Kit for Firebase a.k.a. Serverless Edition
React Starter Kitfor 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)
Also, you need to be familiar with HTML, CSS, JavaScript (ES2015) and React.
Directory Layout
├── build/ # Compiled output
├── migrations/ # Database schema migration files
├── node_modules/ # 3rd-party libraries and utilities
├── public/ # Static files such as favicon.ico etc.
├── scripts/ # Automation scripts (yarn update-schema etc.)
├── src/ # Application source code
│ ├── admin/ # Admin section (Dashboard, User Management etc.)
│ ├── common/ # Shared React components and HOCs
│ ├── hooks/ # React.js hooks and Context providers
│ ├── icons/ # Icon components
│ ├── legal/ # Terms of Use, Privacy Policy, etc.
│ ├── misc/ # Other pages (about us, contacts, etc.)
│ ├── mutations/ # GraphQL mutations to be used on the client
│ ├── news/ # News section (example)
│ ├── server/ # Server-side code (API, authentication, etc.)
│ │ ├── mutations/ # GraphQL mutations
│ │ ├── queries/ # The top-level GraphQL query fields
│ │ ├── templates/ # HTML templates for server-side rendering
│ │ ├── types/ # GraphQL types: User, UserRole, UserIdentity etc.
│ │ ├── api.js # GraphQL API middleware
│ │ ├── app.js # Express.js application
│ │ ├── config.js # Configuration settings to be passed to the client
│ │ ├── context.js # GraphQL context wrapper
│ │ ├── db.js # PostgreSQL database client (Knex.js)
│ │ ├── relay.js # Relay factory method for Node.js environment
│ │ ├── index.js # Node.js app entry point
│ │ ├── login.js # Authentication middleware (e.g. /login/facebook)
│ │ ├── schema.js # GraphQL schema
│ │ └── ssr.js # Server-side rendering, e.g. ReactDOMServer.renderToString(<App />)
│ ├── user/ # User pages (login, account settings, user profile, etc)
│ ├── utils/ # Utility functions
│ ├── relay.js # Relay factory method for browser environment
│ ├── index.js # Client-side entry point, e.g. ReactDOM.render(<App />, container)
│ ├── router.js # Universal application router
│ ├── serviceWorker.js # Service worker helper methods
│ └── theme.js # Overrides for Material UI default styles
├── ssl/ # SSL certificates for connecting to Cloud SQL instance
├── .env # Environment variables for local development
├── .env.production # Environment variables for the production build
├── .env.test # Environment variables for the test build
├── graphql.schema # GraphQL schema (auto-generated, used by Relay)
└── package.json # The list of project dependencies + NPM scripts
Prerequisites
Node.js v10.15 or higher + Yarn v1.17 or higher (HINT: On Mac install
them via Brew)
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:
$ git clone https://github.com/kriasoft/react-firebase-starter.git MyApp
$ cd MyApp
$ yarn setup # Installs dependencies; creates PostgreSQL database
$ yarn start # Compile the app and opens it in a browser with "live reload"
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:
$ yarn db-change <name> # Create a new database migration file
$ yarn db-migrate --env=dev # Migrate database to the latest version
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:
$ yarn db-version --env=dev # Print the version number of the last migration
$ yarn db-rollback --env=dev # Rollback the latest migration
$ yarn db-restore --env=dev # Restore database from backup.sql
$ yarn db-seed --env=dev # Seed database with test data
$ yarn db --env=dev # Open Knex.js REPL shell (type ".exit" for exit)
$ yarn psql --env=dev # Open PostgreSQL shell (type "\q" for exit)
How to Test
$ yarn lint # Check JavaScript and CSS code for potential issues
$ yarn lint-fix # Attempt to automatically fix ESLint warnings
$ yarn test # Run unit tests. Or, `yarn test -- --watch`
How to Deploy
$ yarn build # Build the in production mode (NODE_ENV=production)
$ yarn deploy-test # Deploy the app to TEST environment
$ yarn deploy-prod # Deploy the app to PROD environment
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.
Backers
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
:mortar_board: React for Beginners and ES6 Training Course by Wes Bos
:green_book: React: Up & Running: Building Web Applications by Stoyan Stefanov (Aug, 2016)
:green_book: Getting Started with React by Doel Sengupta and Manu Singhal (Apr, 2016)
:green_book: You Don't Know JS: ES6 & Beyond by Kyle Simpson (Dec, 2015)
kriasoft/react-firebase-starter thuộc nhóm Frontend trên TopGit, cùng 20 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về kriasoft/react-firebase-starter ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/kriasoft/react-firebase-starter là nguồn chính thức.
kriasoft/react-firebase-starter có bao nhiêu sao?
kriasoft/react-firebase-starter có 4.5k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/kriasoft/react-firebase-starter. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
kriasoft/react-firebase-starter có những chủ đề gì?
kriasoft/react-firebase-starter có phải mã nguồn mở không?
Có — kriasoft/react-firebase-starter phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/kriasoft/react-firebase-starter.
kriasoft/react-firebase-starter có trang demo không?
Dự án có trang chủ ở https://firebase.reactstarter.com. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
kriasoft/react-firebase-starter còn đang phát triển không?
Commit gần nhất trên kriasoft/react-firebase-starter là 2.6 năm trước (theo timestamp GitHub). Repo có 753 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về react-firebase-starter?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về react-firebase-starter.