Example of blog built with React, Next.js, Firebase Firestore, Styled-Component, Mobx State Tree and other cool technologies
This blog uses Next.js for SSR & Firebase Firestore API for storing and fetching data. Create and edit your content in simple custom content management system built with React, Mobx State Tree and Styled Components.
Clone this repo and use it as starting point to create your own fancy blog.
Firestore is still in beta, but it doesn't make it less awesome.
.env
at the root of the project. Do not commit this file. It is personal data that should not be available for everyone..env
in the following format:F_PROJECT_ID=<your Project ID>
F_AUTH_DOMAIN=<your Project ID>.firebaseapp.com
F_API_KEY=<your Web API Key>
In order to be able to initialize database with initial seed we need to generate private Firebase Admin service key.
firebase-service-key.json
at project root.
** Do not commit this file. It's added to .gitignore
by default.We almost finished. Let's initialize our database with initial data.
yarn
yarn run seed
We need manually setup indexes in our Firestore database to be able to make REST requests to our Firebase.
We're ready to launch our blog locally.
yarn dev
Blog is up and running on http://localhost:3000.
Wait.. But what's about CMS part?
authors
collection in Database
authors
collection, where documentId
is UID of the user and name
is id
of user in config.js
file.
Licensed under the MIT License, Copyright © 2018-present Alexander Suevalov
See LICENSE for more information.