(macOS) Go-Vue.js 2-Quasar 개발 셋팅

Setting

1. Homebrew

update

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • xcode command line tool 없으면 설치

2. node.js/npm 최신 버전 설치

nodejs.org 설치 확인

$ npm -v
6.4.1
$ node -v
v10.15.3

3. golang 최신 버전 설치

golang.org

4. GitHub Desktop 설치

github.com

5. mariaDB 설치

$ brew install mariadb 

6. Quasar 설치

vue-cli 설치

$ npm install -g vue-cli # or @vue/cli @vue/cli-init // recommended

6.1. quasar-cli 설치

$ npm uninstall -g quasar-cli
removed 1111 packages in 9.432s
$ npm i -g [email protected]
$ quasar
...
Commands
init          Create a project folder
dev           Start a dev server for your App
build         Build your app for production
clean         Clean all build artifacts
new           Quickly scaffold page/layout/component/... vue file
mode          Add/remove Quasar Modes for your App
info          Display info about your machine and your App
serve         Create an ad-hoc (production-ready) server on App distributables
help          Displays this message

6.2. Cordova 설치

$ npm install -g cordova
/usr/local/bin/cordova -> /usr/local/lib/node_modules/cordova/bin/cordova
+ [email protected]

Quasar CLI가 전역 적으로 설치되면 이제 새로운 프로젝트를 생성 가능

$ quasar init <folder-name>

개발 시작

Developing a SPA

$ quasar dev

…or

$ quasar dev -m spa

Developing for SSR

$ quasar dev -m ssr

Developing a PWA

$ quasar dev -m pwa

Developing a Mobile App (through Cordova)

$ quasar dev -m cordova -T [android|ios]

Developing an Electron App

$ quasar dev -m electron


# DB Start, Create
## Conf 폴더 생성
## Start 

$ mysql.service start

## Create

$ mysql -uroot [mysql] CREATE DATABASE db_name; CREATE USER ‘user_name’ IDENTIFIED BY ‘user_name’; CREATE USER ‘user_name’@’%’ IDENTIFIED BY ‘user_name’; CREATE USER ‘user_name’@’localhost’ IDENTIFIED BY ‘user_name’; CREATE USER ‘user_name’@’127.0.0.0’ IDENTIFIED BY ‘user_name’;

GRANT ALL PRIVILEGES ON db_name.* TO user_name; GRANT ALL PRIVILEGES ON db_name.* TO [email protected]’%’; GRANT ALL PRIVILEGES ON db_name.* TO [email protected]’127.0.0.0’ with grant option; GRANT ALL PRIVILEGES ON db_name.* TO [email protected]’localhost’ with grant option;

SET SESSION FOREIGN_KEY_CHECKS=0;

/* Drop Tables */

DROP TABLE IF EXISTS USER;

/* Create Tables */

CREATE TABLE USER ( USER_IDX int NOT NULL AUTO_INCREMENT, LOGIN_ID varchar(100) COMMENT ‘email’, PASSWORD text, NAME varchar(100), EMAIL varchar(100), LOGIN_TIME datetime COMMENT ‘last login datetime’, UPDATE_TIME datetime COMMENT ‘last updated datetime’, CREATE_TIME datetime NOT NULL COMMENT ‘created datetime’, PRIMARY KEY (USER_IDX) );


## (macOS) golang backend service

cd /…/ProjectName export GOROOT=”/usr/local/go” export GOPATH=”/…/ProjectName” // Cloned Location go get github.com/dgrijalva/jwt-go go get github.com/jmoiron/sqlx go get github.com/go-sql-driver/mysql go get github.com/labstack/echo go get github.com/sirupsen/logrus //go get github.com/spf13/viper go build server.go ./server


## (macOS) vue.js 2 frontend service

cd /…/ProjectName/web npm install npm run dev

chrome: http://localhost:8890/#/ ```

Reference

댓글남기기