GithubHelp home page GithubHelp logo

fuullstacknodeproject's Introduction

Full Stack JavaScript project

Getting started

1. Set Up

Setting up the global Dependencies

a) First initialize package.json using npm init

b) npm install --save express for express servers

c) npm install --save mongodb for connecting to mongo db

d) npm install -S react react-dom for front end

Setting up the Dev dependencyies

  1. npm install --save-dev webpack for moduling the code

  2. Babael is a tranfromer we will be using and for the trnspiler

    npm i -D babel-cli npm i -D babel-loader npm i -D babel-preset-es2015 npm i -D babel-preset-stage-2 npm i -D babel-preset-react

  3. When we change anything in the node project restart is necessary. So we will be instlling the nodemon for auto restarting the node engine on saving the file.

npm install --save-dev nodemon

  1. Es Lint

npm i -D eslint npm i -D eslint-plugin-react npm i -D babel-eslint

  1. Creating Initial Directory Structure for the files.

mkdir src for all the code mkdir public for all the static components like hTML js and CSS mkidir api for all our backend code

We will be adding the index files in all the folder for basic setup uses

  1. Creatng Scripts

In the package.json folder add Scripts

"scripts": { "start": "node server.js" }

But our changes is driven by the nodemon so we will be appending the nodemon

"scripts": { "start": "nodemon --exec babel-node server.js" },

Aslo we need to ignore the public folder as it is driven by the crc folder changes

"scripts": { "start": "nodemon --exec babel-node server.js --ignore public/" },

To transform the src file to the webpack bundled file

"scripts": { "start": "nodemon --exec babel-node server.js --ignore public/" , "dev": "webpack -wd" // works with watch and dev mode. },

  1. Webpack Configuration

In This we tell webpack to start from the index file under the src directory and paste it in the output path in the public folder as the bundle.js

We will also run babel loader for all the files in the folder to transpile

  1. babel coniguration

Create a file .babelrc under the root directory and add

{ "preset": ["react", "es2015", "stage-2"] }

This tells babel to all these presets

fuullstacknodeproject's People

Watchers

 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.