Skip to content

Latest commit

 

History

History
54 lines (30 loc) · 1.92 KB

File metadata and controls

54 lines (30 loc) · 1.92 KB

Next.js (React) + Redux + Express REST API + MongoDB + Mongoose-Crudify boilerplate

Based on nextjs-express-boilerplate, but with added mongoose-crudify and redux-api.

NOTE: this project now uses Redux and redux-api. See the no-redux branch for the (unmaintained) version without Redux.

Why is this awesome?

This is a great starting point for a any project where you want React + Redux (with server-side rendering, powered by Next.js) as frontend and Express/MongoDB as a REST API backend. Lightning fast, all JavaScript.

Demo

See nextjs-express-mongoose-crudify-boilerplate running on Heroku here.

nextjs-express-mongoose-crudify-boilerplate demo on Heroku

How to use

Clone this repository:

git clone https://github.com/tomsoderlund/nextjs-express-mongoose-crudify-boilerplate.git [MY_APP]

Install dependencies:

cd [MY_APP]
yarn  # or npm install

Start it by doing the following:

export MONGODB_URI=*your mongodb url* // you can get one for free at https://www.mlab.com/home
npm run dev

In production:

npm run build
npm start

If you navigate to http://localhost:3001/ you will see a Next.js page with a list of kittens (or an empty list if you haven't added one).

You have your API server running at http://localhost:3001/api/kittens

Deploying

Deploying on Heroku

heroku create [MY_APP]
heroku addons:add mongolab
git push heroku master

Deploying on Now

See instructions on nextjs-express-boilerplate.