Home

Awesome

Next Blog Firestore

code style: prettier style: styled-components

<p align='center'> <img src='https://raw.githubusercontent.com/suevalov/next-blog-firestore/master/docs/logo.png' width='300' alt='Next Blog Firestore'> </p>

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.

Technology stack:

What you get:

Getting started

Step 1. Create Firebase account

<p align='center'> <img src='https://raw.githubusercontent.com/suevalov/next-blog-firestore/master/docs/create-firebase-project.png' width='300' alt='Create Firebase account'> </p>

Step 2. Setup Authentication Method

<p align='center'> <img src='https://raw.githubusercontent.com/suevalov/next-blog-firestore/master/docs/setup-authentication.png' width='300' alt='Setup authentication'> </p>

Step 3. Create Firestore database

<p align='center'> <img src='https://raw.githubusercontent.com/suevalov/next-blog-firestore/master/docs/create-firestore.png' width='300' alt='Create Firestore database'> </p>

Firestore is still in beta, but it doesn't make it less awesome.

Step 4. Database configuration.

Step 5. Set up Firebase secret keys for our app.

F_PROJECT_ID=<your Project ID>
F_AUTH_DOMAIN=<your Project ID>.firebaseapp.com
F_API_KEY=<your Web API Key>

Step 6. Set up Firebase Admin SDK key for importing/exporting data from database.

In order to be able to initialize database with initial seed we need to generate private Firebase Admin service key.

Step 7. Initialize database with initial data.

We almost finished. Let's initialize our database with initial data.

yarn
yarn run seed

Step 8. Setup database indexes.

We need manually setup indexes in our Firestore database to be able to make REST requests to our Firebase.

<p align='center'> <img src='https://raw.githubusercontent.com/suevalov/next-blog-firestore/master/docs/create-indexes.png' width='400' alt='Create indexes'> </p>

Step 9. Run blog locally.

We're ready to launch our blog locally.

yarn dev

Blog is up and running on http://localhost:3000.

Step 10. Sign in to admin part.

Wait.. But what's about CMS part?

<p align='center'> <img src='https://raw.githubusercontent.com/suevalov/next-blog-firestore/master/docs/map-author.png' width='400' alt='Map author and user'> </p>

Step 11. Ready to go!

License

Licensed under the MIT License, Copyright © 2018-present Alexander Suevalov

See LICENSE for more information.