Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vasansr/pro-mern-stack-2

Code listing for the book Pro MERN Stack, 2nd Edition
https://github.com/vasansr/pro-mern-stack-2

Last synced: 7 days ago
JSON representation

Code listing for the book Pro MERN Stack, 2nd Edition

Awesome Lists containing this project

README

        

![Pro MERN Stack, 2nd Edition](https://media.springernature.com/w306/springer-static/cover-hires/book/978-1-4842-4391-6)

This is the complete source code compilation of all code listings in the book
Pro MERN Stack, (2nd Edition), published by Apress. The book can be purchased
at any of these websites:

* [Apress](https://www.apress.com/book/9781484243909)
* [Springer](https://www.springer.com/book/9781484243909)
* [Amazon](https://www.amazon.com/Pro-MERN-Stack-Development-Express/dp/1484243900)

The 2nd Edition has the following new things as compared to the original, first edition:

* It uses the latest React (React 16)
* It uses the React Router (React Router 4)
* It uses GraphQL rather than REST based APIs
* It adopts an architecture that lets you run the API and UI on different servers
* It includes deployment instructions on Heroku
* It uses other latest technology such as JWT and CORS.
* ... and many more improvements over the first edition.

Each section in the book ends with a working application, which corresponds to a branch in this
repository. For each section, you can browse the complete source, or look at the differences from
the previous section/step using the appropriate link against each section, in this page.

### Reporting Issues

There is no discussion forum for this book, so if you do find any problems running the code,
or even in the text of the book, do create [New Issue](https://github.com/vasansr/pro-mern-stack-2/issues/new) in this github project. I or some other reader may help you resolve the issue.

### Chapter 1: Introduction

There are no code listings in this chapter.

### Chapter 2: Hello World
* Server-less Hello World: [Full Source](../../tree/02.01-server-less-hello-world)
* JSX: [Full Source](../../tree/02.02-jsx) | [Diffs](../../compare/02.01-server-less-hello-world...02.02-jsx#files_bucket)
* Project Set Up: [Full Source](../../tree/02.03-project-set-up) | [Diffs](../../compare/02.02-jsx...02.03-project-set-up#files_bucket)
* Express: [Full Source](../../tree/02.04-express) | [Diffs](../../compare/02.03-project-set-up...02.04-express#files_bucket)
* Separate Script File: [Full Source](../../tree/02.05-separate-script-file) | [Diffs](../../compare/02.04-express...02.05-separate-script-file#files_bucket)
* JSX Transform: [Full Source](../../tree/02.06-jsx-transform) | [Diffs](../../compare/02.05-separate-script-file...02.06-jsx-transform#files_bucket)
* Older Browser Support: [Full Source](../../tree/02.07-older-browser-support) | [Diffs](../../compare/02.06-jsx-transform...02.07-older-browser-support#files_bucket)
* Automate: [Full Source](../../tree/02.08-automate) | [Diffs](../../compare/02.07-older-browser-support...02.08-automate#files_bucket)

### Chapter 3: React Classes
* React Classes: [Full Source](../../tree/03.01-react-classes) | [Diffs](../../compare/02.08-automate...03.01-react-classes#files_bucket)
* Composing Components: [Full Source](../../tree/03.02-composing-components) | [Diffs](../../compare/03.01-react-classes...03.02-composing-components#files_bucket)
* Passing Data Using Properties: [Full Source](../../tree/03.03-passing-data-using-properties) | [Diffs](../../compare/03.02-composing-components...03.03-passing-data-using-properties#files_bucket)
* Passing Data Using Children: [Full Source](../../tree/03.04-passing-data-using-children) | [Diffs](../../compare/03.03-passing-data-using-properties...03.04-passing-data-using-children#files_bucket)
* Dynamic Composition: [Full Source](../../tree/03.05-dynamic-composition) | [Diffs](../../compare/03.04-passing-data-using-children...03.05-dynamic-composition#files_bucket)

### Chapter 4: React State
* Initial State: [Full Source](../../tree/04.01-initial-state) | [Diffs](../../compare/03.05-dynamic-composition...04.01-initial-state#files_bucket)
* Async State Initialization: [Full Source](../../tree/04.02-async-state-initialization) | [Diffs](../../compare/04.01-initial-state...04.02-async-state-initialization#files_bucket)
* Updating State: [Full Source](../../tree/04.03-updating-state) | [Diffs](../../compare/04.02-async-state-initialization...04.03-updating-state#files_bucket)
* Lifting State Up: [Full Source](../../tree/04.04-lifting-state-up) | [Diffs](../../compare/04.03-updating-state...04.04-lifting-state-up#files_bucket)
* Event Handling: [Full Source](../../tree/04.05-event-handling) | [Diffs](../../compare/04.04-lifting-state-up...04.05-event-handling#files_bucket)
* Stateless Components: [Full Source](../../tree/04.06-stateless-components) | [Diffs](../../compare/04.05-event-handling...04.06-stateless-components#files_bucket)

### Chapter 5: Express and GraphQL
* About API: [Full Source](../../tree/05.01-about-api) | [Diffs](../../compare/04.06-stateless-components...05.01-about-api#files_bucket)
* GraphQL Schema File: [Full Source](../../tree/05.02-graphql-schema-file) | [Diffs](../../compare/05.01-about-api...05.02-graphql-schema-file#files_bucket)
* List API: [Full Source](../../tree/05.03-list-api) | [Diffs](../../compare/05.02-graphql-schema-file...05.03-list-api#files_bucket)
* Integrate List API: [Full Source](../../tree/05.04-integrate-list-api) | [Diffs](../../compare/05.03-list-api...05.04-integrate-list-api#files_bucket)
* Custom Scalar Types: [Full Source](../../tree/05.05-custom-scalar-types) | [Diffs](../../compare/05.04-integrate-list-api...05.05-custom-scalar-types#files_bucket)
* Create API: [Full Source](../../tree/05.06-create-api) | [Diffs](../../compare/05.05-custom-scalar-types...05.06-create-api#files_bucket)
* Integrate Create API: [Full Source](../../tree/05.07-integrate-create-api) | [Diffs](../../compare/05.06-create-api...05.07-integrate-create-api#files_bucket)
* Query Variables: [Full Source](../../tree/05.08-query-variables) | [Diffs](../../compare/05.07-integrate-create-api...05.08-query-variables#files_bucket)
* Input Validations: [Full Source](../../tree/05.09-input-validations) | [Diffs](../../compare/05.08-query-variables...05.09-input-validations#files_bucket)
* Displaying Errors: [Full Source](../../tree/05.10-displaying-errors) | [Diffs](../../compare/05.09-input-validations...05.10-displaying-errors#files_bucket)

### Chapter 6: MongoDB
* MongoDB Basics: [Full Source](../../tree/06.01-mongodb-basics) | [Diffs](../../compare/05.10-displaying-errors...06.01-mongodb-basics#files_bucket)
* MongoDB Crud Operations: [Full Source](../../tree/06.02-mongodb-crud-operations) | [Diffs](../../compare/06.01-mongodb-basics...06.02-mongodb-crud-operations#files_bucket)
* MongoDB Node.js Driver: [Full Source](../../tree/06.03-mongodb-node.js-driver) | [Diffs](../../compare/06.02-mongodb-crud-operations...06.03-mongodb-node.js-driver#files_bucket)
* Schema Initialization: [Full Source](../../tree/06.04-schema-initialization) | [Diffs](../../compare/06.03-mongodb-node.js-driver...06.04-schema-initialization#files_bucket)
* Reading From MongoDB: [Full Source](../../tree/06.05-reading-from-mongodb) | [Diffs](../../compare/06.04-schema-initialization...06.05-reading-from-mongodb#files_bucket)
* Writing To MongoDB: [Full Source](../../tree/06.06-writing-to-mongodb) | [Diffs](../../compare/06.05-reading-from-mongodb...06.06-writing-to-mongodb#files_bucket)

### Chapter 7: Architecture and ESLint
* UI Server: [Full Source](../../tree/07.01-ui-server) | [Diffs](../../compare/06.06-writing-to-mongodb...07.01-ui-server#files_bucket)
* Multiple Environments: [Full Source](../../tree/07.02-multiple-environments) | [Diffs](../../compare/07.01-ui-server...07.02-multiple-environments#files_bucket)
* Proxy Based Architecture: [Full Source](../../tree/07.03-proxy-based-architecture) | [Diffs](../../compare/07.02-multiple-environments...07.03-proxy-based-architecture#files_bucket)
* ESLint: [Full Source](../../tree/07.04-eslint) | [Diffs](../../compare/07.03-proxy-based-architecture...07.04-eslint#files_bucket)
* ESLint For Front End: [Full Source](../../tree/07.05-eslint-for-front-end) | [Diffs](../../compare/07.04-eslint...07.05-eslint-for-front-end#files_bucket)
* React Proptypes: [Full Source](../../tree/07.06-react-proptypes) | [Diffs](../../compare/07.05-eslint-for-front-end...07.06-react-proptypes#files_bucket)

### Chapter 8: Modularization and Webpack
* Backend Modules: [Full Source](../../tree/08.01-backend-modules) | [Diffs](../../compare/07.06-react-proptypes...08.01-backend-modules#files_bucket)
* Front End Modules and Webpack: [Full Source](../../tree/08.02-front-end-modules-and-webpack) | [Diffs](../../compare/08.01-backend-modules...08.02-front-end-modules-and-webpack#files_bucket)
* Transform and Bundle: [Full Source](../../tree/08.03-transform-and-bundle) | [Diffs](../../compare/08.02-front-end-modules-and-webpack...08.03-transform-and-bundle#files_bucket)
* Libraries Bundle: [Full Source](../../tree/08.04-libraries-bundle) | [Diffs](../../compare/08.03-transform-and-bundle...08.04-libraries-bundle#files_bucket)
* Hot Module Replacement: [Full Source](../../tree/08.05-hot-module-replacement) | [Diffs](../../compare/08.04-libraries-bundle...08.05-hot-module-replacement#files_bucket)
* Debugging: [Full Source](../../tree/08.06-debugging) | [Diffs](../../compare/08.05-hot-module-replacement...08.06-debugging#files_bucket)

### Chapter 9: React Router
* Simple Routing: [Full Source](../../tree/09.01-simple-routing) | [Diffs](../../compare/08.06-debugging...09.01-simple-routing#files_bucket)
* Route Parameters: [Full Source](../../tree/09.02-route-parameters) | [Diffs](../../compare/09.01-simple-routing...09.02-route-parameters#files_bucket)
* Query Parameters: [Full Source](../../tree/09.03-query-parameters) | [Diffs](../../compare/09.02-route-parameters...09.03-query-parameters#files_bucket)
* Links: [Full Source](../../tree/09.04-links) | [Diffs](../../compare/09.03-query-parameters...09.04-links#files_bucket)
* Programmatic Navigation: [Full Source](../../tree/09.05-programmatic-navigation) | [Diffs](../../compare/09.04-links...09.05-programmatic-navigation#files_bucket)
* Nested Routes: [Full Source](../../tree/09.06-nested-routes) | [Diffs](../../compare/09.05-programmatic-navigation...09.06-nested-routes#files_bucket)
* Browser History Router: [Full Source](../../tree/09.07-browser-history-router) | [Diffs](../../compare/09.06-nested-routes...09.07-browser-history-router#files_bucket)

### Chapter 10: Forms
* Controlled Components: [Full Source](../../tree/10.01-controlled-components) | [Diffs](../../compare/09.07-browser-history-router...10.01-controlled-components#files_bucket)
* Controlled Components in Forms: [Full Source](../../tree/10.02-controlled-components-in-forms) | [Diffs](../../compare/10.01-controlled-components...10.02-controlled-components-in-forms#files_bucket)
* More Filters: [Full Source](../../tree/10.03-more-filters) | [Diffs](../../compare/10.02-controlled-components-in-forms...10.03-more-filters#files_bucket)
* Typed Inputs: [Full Source](../../tree/10.04-typed-inputs) | [Diffs](../../compare/10.03-more-filters...10.04-typed-inputs#files_bucket)
* Edit Form: [Full Source](../../tree/10.05-edit-page) | [Diffs](../../compare/10.04-typed-inputs...10.05-edit-page#files_bucket)
* Number Input: [Full Source](../../tree/10.06-number-input) | [Diffs](../../compare/10.05-edit-page...10.06-number-input#files_bucket)
* Date Input: [Full Source](../../tree/10.07-date-input) | [Diffs](../../compare/10.06-number-input...10.07-date-input#files_bucket)
* Text Input: [Full Source](../../tree/10.08-text-input) | [Diffs](../../compare/10.07-date-input...10.08-text-input#files_bucket)
* Update API: [Full Source](../../tree/10.09-update-api) | [Diffs](../../compare/10.08-text-input...10.09-update-api#files_bucket)
* Updating an Issue: [Full Source](../../tree/10.10-updating-an-issue) | [Diffs](../../compare/10.09-update-api...10.10-updating-an-issue#files_bucket)
* Updating a Field: [Full Source](../../tree/10.11-updating-a-field) | [Diffs](../../compare/10.10-updating-an-issue...10.11-updating-a-field#files_bucket)
* Delete API: [Full Source](../../tree/10.12-delete-api) | [Diffs](../../compare/10.11-updating-a-field...10.12-delete-api#files_bucket)
* Deleting an Issue: [Full Source](../../tree/10.13-deleting-an-issue) | [Diffs](../../compare/10.12-delete-api...10.13-deleting-an-issue#files_bucket)

### Chapter 11: React Bootstrap
* Bootstrap Installation: [Full Source](../../tree/11.01-bootstrap-installation) | [Diffs](../../compare/10.13-deleting-an-issue...11.01-bootstrap-installation#files_bucket)
* Buttons: [Full Source](../../tree/11.02-buttons) | [Diffs](../../compare/11.01-bootstrap-installation...11.02-buttons#files_bucket)
* Navigation Bar: [Full Source](../../tree/11.03-navigation-bar) | [Diffs](../../compare/11.02-buttons...11.03-navigation-bar#files_bucket)
* Panels: [Full Source](../../tree/11.04-panels) | [Diffs](../../compare/11.03-navigation-bar...11.04-panels#files_bucket)
* Tables: [Full Source](../../tree/11.05-tables) | [Diffs](../../compare/11.04-panels...11.05-tables#files_bucket)
* Forms: [Full Source](../../tree/11.06-forms) | [Diffs](../../compare/11.05-tables...11.06-forms#files_bucket)
* The Grid System: [Full Source](../../tree/11.07-grid-system) | [Diffs](../../compare/11.06-forms...11.07-grid-system#files_bucket)
* Inline Forms: [Full Source](../../tree/11.08-inline-forms) | [Diffs](../../compare/11.07-grid-system...11.08-inline-forms#files_bucket)
* Horizontal Forms: [Full Source](../../tree/11.09-horizontal-forms) | [Diffs](../../compare/11.08-inline-forms...11.09-horizontal-forms#files_bucket)
* Validation Alerts: [Full Source](../../tree/11.10-validation-alerts) | [Diffs](../../compare/11.09-horizontal-forms...11.10-validation-alerts#files_bucket)
* Toasts: [Full Source](../../tree/11.11-toasts) | [Diffs](../../compare/11.10-validation-alerts...11.11-toasts#files_bucket)
* Modals: [Full Source](../../tree/11.12-modals) | [Diffs](../../compare/11.11-toasts...11.12-modals#files_bucket)

### Chapter 12: Server Rendering
* New Directory Structure: [Full Source](../../tree/12.01-directory-structure) | [Diffs](../../compare/11.12-modals...12.01-directory-structure#files_bucket)
* Basic Server Rendering: [Full Source](../../tree/12.02-basic-server-rendering) | [Diffs](../../compare/12.01-directory-structure...12.02-basic-server-rendering#files_bucket)
* Webpack for the Server: [Full Source](../../tree/12.03-webpack-for-server) | [Diffs](../../compare/12.02-basic-server-rendering...12.03-webpack-for-server#files_bucket)
* HMR for the Server: [Full Source](../../tree/12.04-hmr-for-server) | [Diffs](../../compare/12.03-webpack-for-server...12.04-hmr-for-server#files_bucket)
* Server Router: [Full Source](../../tree/12.05-server-router) | [Diffs](../../compare/12.04-hmr-for-server...12.05-server-router#files_bucket)
* Hydrate: [Full Source](../../tree/12.06-hydrate) | [Diffs](../../compare/12.05-server-router...12.06-hydrate#files_bucket)
* Data from APIs: [Full Source](../../tree/12.07-data-from-apis) | [Diffs](../../compare/12.06-hydrate...12.07-data-from-apis#files_bucket)
* Syncing Initial Data: [Full Source](../../tree/12.08-syncing-initial-data) | [Diffs](../../compare/12.07-data-from-apis...12.08-syncing-initial-data#files_bucket)
* Common Data Fetcher: [Full Source](../../tree/12.09-common-data-fetcher) | [Diffs](../../compare/12.08-syncing-initial-data...12.09-common-data-fetcher#files_bucket)
* Generated Routes: [Full Source](../../tree/12.10-generated-routes) | [Diffs](../../compare/12.09-common-data-fetcher...12.10-generated-routes#files_bucket)
* Data Fetcher with Parameters: [Full Source](../../tree/12.11-data-fetcher-with-parameters) | [Diffs](../../compare/12.10-generated-routes...12.11-data-fetcher-with-parameters#files_bucket)
* Data Fetcher with Search: [Full Source](../../tree/12.12-data-fetcher-with-search) | [Diffs](../../compare/12.11-data-fetcher-with-parameters...12.12-data-fetcher-with-search#files_bucket)
* Nested Components: [Full Source](../../tree/12.13-nested-components) | [Diffs](../../compare/12.12-data-fetcher-with-search...12.13-nested-components#files_bucket)
* Redirects: [Full Source](../../tree/12.14-redirects) | [Diffs](../../compare/12.13-nested-components...12.14-redirects#files_bucket)

### Chapter 13: Advanced Features
* Higher Order Component for Toast: [Full Source](../../tree/13.01-higher-order-component-for-toast) | [Diffs](../../compare/12.14-redirects...13.01-higher-order-component-for-toast#files_bucket)
* MongoDB Aggregate: [Full Source](../../tree/13.02-mongodb-aggregate) | [Diffs](../../compare/13.01-higher-order-component-for-toast...13.02-mongodb-aggregate#files_bucket)
* Issue Counts API: [Full Source](../../tree/13.03-issue-counts-api) | [Diffs](../../compare/13.02-mongodb-aggregate...13.03-issue-counts-api#files_bucket)
* Report Page: [Full Source](../../tree/13.04-report-page) | [Diffs](../../compare/13.03-issue-counts-api...13.04-report-page#files_bucket)
* List API with Pagination: [Full Source](../../tree/13.05-list-api-with-pagination) | [Diffs](../../compare/13.04-report-page...13.05-list-api-with-pagination#files_bucket)
* Pagination UI: [Full Source](../../tree/13.06-pagination-ui) | [Diffs](../../compare/13.05-list-api-with-pagination...13.06-pagination-ui#files_bucket)
* Undo Delete API: [Full Source](../../tree/13.07-undo-delete-api) | [Diffs](../../compare/13.06-pagination-ui...13.07-undo-delete-api#files_bucket)
* Undo Delete UI: [Full Source](../../tree/13.08-undo-delete-ui) | [Diffs](../../compare/13.07-undo-delete-api...13.08-undo-delete-ui#files_bucket)
* Text Index API: [Full Source](../../tree/13.09-text-index-api) | [Diffs](../../compare/13.08-undo-delete-ui...13.09-text-index-api#files_bucket)
* Search Bar: [Full Source](../../tree/13.10-search-bar) | [Diffs](../../compare/13.09-text-index-api...13.10-search-bar#files_bucket)

### Chapter 14: Authentication
* Sign-In UI: [Full Source](../../tree/14.01-sign-in-ui) | [Diffs](../../compare/13.10-search-bar...14.01-sign-in-ui#files_bucket)
* Google Sign-In: [Full Source](../../tree/14.02-google-sign-in) | [Diffs](../../compare/14.01-sign-in-ui...14.02-google-sign-in#files_bucket)
* Verifying the Google Token: [Full Source](../../tree/14.03-verifying-google-token) | [Diffs](../../compare/14.02-google-sign-in...14.03-verifying-google-token#files_bucket)
* JSON Web Tokens: [Full Source](../../tree/14.04-json-web-tokens) | [Diffs](../../compare/14.03-verifying-google-token...14.04-json-web-tokens#files_bucket)
* Signing Out: [Full Source](../../tree/14.05-signing-out) | [Diffs](../../compare/14.04-json-web-tokens...14.05-signing-out#files_bucket)
* Authorization: [Full Source](../../tree/14.06-authorization) | [Diffs](../../compare/14.05-signing-out...14.06-authorization#files_bucket)
* Authorization-Aware UI: [Full Source](../../tree/14.07-auth-aware-ui) | [Diffs](../../compare/14.06-authorization...14.07-auth-aware-ui#files_bucket)
* React Context: [Full Source](../../tree/14.08-react-context) | [Diffs](../../compare/14.07-auth-aware-ui...14.08-react-context#files_bucket)
* CORS with Credentials: [Full Source](../../tree/14.09-cors-with-credentials) | [Diffs](../../compare/14.08-react-context...14.09-cors-with-credentials#files_bucket)
* Server Rendering with Credentials: [Full Source](../../tree/14.10-server-rendering-with-credentials) | [Diffs](../../compare/14.09-cors-with-credentials...14.10-server-rendering-with-credentials#files_bucket)
* Cookie Domain: [Full Source](../../tree/14.11-cookie-domain) | [Diffs](../../compare/14.10-server-rendering-with-credentials...14.11-cookie-domain#files_bucket)

### Chapter 15: Deployment
* Git Repositories: [Full Source](../../tree/15.01-git-repositories) | [Diffs](../../compare/14.11-cookie-domain...15.01-git-repositories#files_bucket)
* MongoDB: [Full Source](../../tree/15.02-mongodb) | [Diffs](../../compare/15.01-git-repositories...15.02-mongodb#files_bucket)
* Heroku: [Full Source](../../tree/15.03-heroku) | [Diffs](../../compare/15.02-mongodb...15.03-heroku#files_bucket)
* The API Application: [Full Source](../../tree/15.04-api-application) | [Diffs](../../compare/15.03-heroku...15.04-api-application#files_bucket)
* The UI Application: [Full Source](../../tree/15.05-ui-application) | [Diffs](../../compare/15.04-api-application...15.05-ui-application#files_bucket)
* Proxy Mode: [Full Source](../../tree/15.06-proxy-mode) | [Diffs](../../compare/15.05-ui-application...15.06-proxy-mode#files_bucket)
* Non-Proxy Mode: [Full Source](../../tree/15.07-non-proxy-mode) | [Diffs](../../compare/15.06-proxy-mode...15.07-non-proxy-mode#files_bucket)

### Chapter 16: Looking Ahead

There are no code listings in this chapter.