Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Sample project using nextjs, redux, and cloud firestore.

NotificationsYou must be signed in to change notification settings

NickDelfino/nextjs-with-redux-and-cloud-firestore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

App Description

This sample app demonstrates how to create a live list updated by user input in the provided status textbox using reactjs, next.js, redux, and cloud firestore (a firebase product).

Questions, Comments, Concerns

Please direct any questions, comments, or concerns to theissues section of the repo. Thanks for your feedback.

Dependencies and Inspirations

This project was seeded bycreate-next-app. For general questions about the setup of next.js and the structure visit the previously linked github.

This project is inspired by theexamples made by the nextjs team.It combines ideas from both theirwith-reduxandwith-firebase-authentication examplesto show how to create harmonization between redux and, in my case, cloud firestore.

Folder Structure

The project structure is made with going further in mind. Actions and reducers are movedinto their own directories since there should be multiple of them in a full web app. A libdirectory has been added for constant variable and to access the db.

my-app/  README.md  package.json  next.config.js  components/    Head.js    Nav.js    AddPost.js    Loading.js    PostItem.js    PostList.js  pages/    index.js  lib/    const.js    db.js  static/    favicon.ico  reducers/    postReducer.js  actions/    index.js    types.js    postActions.js  store.js

Setting Up Cloud Firestore

Cloud firestore setup is similar to firebase realtime database setup.

The main thing that is need are the initialization keys generated when making a databaseon the site so the example app works.

Go tofirebase.google.com. Login or create an account ifyou don't already have one.

Then, go to console. Select the "Add Project" square.

Name your project anything you like and then on the following page select the option"Add Firebase to your web app".

A model will appear with configuration information. Copy the entire config variable andpaste it over the placeholder one in ../lib/db.js.

Then you are good to go. Your app will start using your Cloud Firestore.

Setup and Running Example

To run the project simply clone this repository and navigate into it.

Run npm install to acquire dependencies.

Then simply perform the commandnpm run dev.

Scripts

npm run dev

Runs the app in the development mode athttp://localhost:3000.

npm run build

Builds the app for production to the.next folder.

npm run start

Starts the application in production mode.

This script is made with heroku in mind. There is a port variable that needs to bespecified for it to run. Heroku needs this for deployment.

About

Sample project using nextjs, redux, and cloud firestore.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp