Giter Site home page Giter Site logo

howtoprojectsetup's Introduction

Project Setup

How to set up a pre-development project

Preparation

Editor

  • vscode

Environment

  • node.js
  • npm OR yarn
  • git (+ Github account)

Setup

0. vscode setting

  • Custom editor configuration
    Open the command palette window(shortcut 'F1') -> open user settings -> user settings
{
    /* Prettier */
    "prettier.eslintIntegration": true,

    /* File */
    "files.eol": "\n",        // End of line 'LF'
    "editor.tabSize": 2,

    /* Editor */
    "editor.minimap.enabled": false,  
    "window.zoomLevel": 0,  

    "search.exclude": {
        "**/node_modules": true
    }, 
}

extensions

  • Install useful extension for develeopment.
  • Required extension: ESLint, Prettier

0.1 Make project folder

  • Type the below code on terminal (in editor, cmd, powershell or bash)
mkdir foldername
cd foldername 

Make essential folder and files in project folder

  • folder: dist, src
  • files: README.md

1. VCS (Version Control System)

git init # Setup the git on project folder
git config user.email "[email protected]" # or git config --global user.email "[email protected]"
git config user.name "your name" # or git config --global user.name "your name"
  • Create .gitignore file
  • Then commit first setup files.
git add -A
git commit -a -m "First project setup Commit"
  • Make github repository at Github
git remote add origin 'your.github.repository.url' # Add remote repository
git push origin master  # Push the first commit to remote repository 

Github SSH setting (optional)

  • Create your SSH key set
cd ~ # your user account folder
ssh-keygen  # If your OS is windows, you can type the code in 'Git Bash' terminal.
# If 'ssh-keygen' command has been ran completely, two files are created in '~/.ssh'
# The 'id_rsa' file is private key, 'id_rsa.pub' file is public key
cat ~/.ssh/id_rsa.pub # Show public key's content
  • You have to upload public key's content to your Github account setting

    • github login -> settings -> SSH and GPG keys -> New SSH key -> upload your public key's content(cat ~/.ssh/id_rsa.pub)
  • Set git remote url

git remote set-url origin "your github repository SSH!'s url"
git remote show origin # Make sure fetch, push url has changed.

Make git's dev branch

  • 'master' branch will be used to stable code version.
  • 'dev' branch will be used to development stage.
git branch dev    # Create dev branch
git checkout dev  # Move to dev branch
git push origin dev # Apply the dev branch to the remote repository.

2. NPM initialize

  • Create package.json file
npm init # To create package.json file

3. Lint (eslint)

  • Setup eslint for code formatting
npm install --save-dev eslint eslint-config-airbnb-base eslint-plugin-import
  • Create eslint configuration file .eslintrc.js in project's root folder
module.exports = {
    "env": {
        "browser": true,
        "es6": true,
        "node": true
    },
    "parserOptions": {
        "sourceType": "module"
    },
    "extends": [
        "airbnb-base"
    ],
    "plugins": [        
        'import'
    ],
};

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.