Code Monkey home page Code Monkey logo

mern-tutorial's Introduction

MERN Tutorial

The MERN Stack is a set of libraries and frameworks that allow developers to develop full-stack applications using only JavaScript. The stack consists of:

This stack is appealing because it allows developers who might traditionally be "trapped" on the front-end to extend their JavaScript super powers across the entire pipeline of an application without the cognitive-overhead of context switching between programming languages and oftentimes programming paradigms.

Jump In (Run Tutorial Examples)

step-0 || step-1

step-0 and step-1 can be run by simply opening their corresponding index.html files in a browser. step-0 is a bare-minimum "Hello, World" for React using JSX but no build step ๐ŸŽ‰! step-1 is a fully client-side implementation of the app we will be building.

step-2 || step-3

step-2 and step-3 can be run with npm run start:step-{2 or 3}. step-2 introduces the Node server and Express for serving content. step-3 implements a REST-ful API using Express and stores/retrieves data from a MongoDB database.

NOTE: You must have mongoDB installed and running to run these examples. (See below for installation and start up instructions)

Getting Started (From Scratch)

The following instructions walk through setting up MongoDB on MacOS. Instructions for other OS platforms can be found here.

Install & Run mongoDB

  1. install mongodb - brew update && brew install mongodb

  2. create folder for database storage - mkdir -p /data/db

  3. set read/write permissions - sudo chmod 0755 /data/db && chown $USER /data/db

  4. start mongodb - mongod

Initialize Application

  1. mkdir mern-tutorial && cd mern-tutorial

  2. npm init

  3. npm install express body-parser mongoose --save

Beyond This Tutorial

The purpose of this tutorial is to serve as a jumping-off point for full-stack Javascript development. To expand on the ideas and concepts implemented here, I recommend checking out mern.io for a fully-featured, production-ready implementation of the "MERN Stack" that includes server-side rendering, component generation CLI, a development pipeline using Webpack, and much more!

If you have any questions feel free to reach out either here or find me on Twitter @arahansen. I'd be more than happy to chat!

mern-tutorial's People

Contributors

arahansen avatar

Watchers

James Cloos avatar Deepanshu Sinha avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.