meteor 개발시작 - 사용할 플러그인 설치
우선, 필요한 패키지를 설치하자.
meteor을 설치하면 자동으로 깔린 package들이 어떤게 있는지 살펴보자.
경로 : 내플젝 - .meteor - local - packages
이런게 깔려있다.
view단은 blaze가 기본으로 설치된다.
입맛에 맞쳐서 vue나 react로 바꿔줘도 된다.
여기서 자동발행해 주는 autopublish, client에서 데이터를 편집해주는 insecure는 삭제해 줍니다.
meteor remove autopublish
meteor remove insecure
삭제 이유는 다음과 같습니다.
autopublish
Now that we have moved all of our app's sensitive code into methods, we need to learn about the other half of Meteor's security story. Until now, we have worked assuming the entire database is present on the client, meaning if we call Tasks.find() we will get every task in the collection. That's not good if users of our application want to store privacy-sensitive data. We need a way of controlling which data Meteor sends to the client-side database.
Just like with insecure in the last step, all new Meteor apps start with the autopublish package. Let's remove it and see what happens:
출처 : https://www.meteor.com/tutorials/blaze/publish-and-subscribe
Publish and subscribe
Meteor is a complete platform for building web and mobile apps in pure JavaScript.
www.meteor.com
insecure
Before this step, any user of the app could edit any part of the database. This might be okay for very small internal apps or demos, but any real application needs to control permissions for its data. In Meteor, the best way to do this is by declaring methods. Instead of the client code directly calling insert, update, and remove, it will instead call methods that will check if the user is authorized to complete the action and then make any changes to the database on the client's behalf.
출처 : https://www.meteor.com/tutorials/blaze/security-with-methods
Security with methods
Meteor is a complete platform for building web and mobile apps in pure JavaScript.
www.meteor.com
쉽게 말하자면, 보안에 취약하므로 client에서 데이터를 맘대로 편집하지말고 surver에서 받아서 해라. 이런말입니다.
자, 거의 다 왔어요.
이제 내가 사용할 package들을 깔아봅시다.
크게 3가지를 꼽을 수 있는데,
1. 나는 node기반의 less를 사용할거라서, less설치
meteor add less
2. spa가 대새니까 router도 설치
(저는 iron router를 사용합니다. 현재 공식으로는 kadira flow roter로 바뀌어져 있네요.)
meteor add iron:router
참고: https://atmospherejs.com/iron/router
iron:router package | Atmosphere
History Top 10Week Feb 18, 2017 Top 10Week Jan 21, 2017 Top 10Week Jan 14, 2017 500k Apr 7, 2016 Top 10Week Oct 10, 2015 200k Jun 10, 2015 Top 10Week Jun 6, 2015 100k Apr 9, 2015 50k Jan 25, 2015 Top 10Week Jan 17, 2015 Top 10Week Dec 20, 2014 20k Nov 11,
atmospherejs.com
iron router와 kadira flow router의 차이는 다음과 같다네요.
참고 : https://atmospherejs.com/kadira/flow-router#difference-with-iron-router
kadira:flow-router package | Atmosphere
History 100k Jan 17, 2018 50k Sep 8, 2016 Top 10Week Apr 23, 2016 Top 10Week Mar 19, 2016 20k Mar 2, 2016 Top 10Week Feb 6, 2016 Top 10Week Nov 28, 2015 Top 10Week Nov 7, 2015 10k Oct 25, 2015 5k Sep 14, 2015 Top 10Week Sep 12, 2015 2k Aug 15, 2015 1k Aug
atmospherejs.com
3. 마지막으로, meteor에서 깔라는 accounts 계정 기능 설치 (로그인 기능)
meteor add accounts-base
meteor add accounts-ui
meteor add service-configuration
meteor add accounts-facebook
meteor add accounts-google
meteor add spectrum:accounts-kakao
참고 : https://docs.meteor.com/api/accounts.html
Meteor API Docs | Meteor API Docs
docs.meteor.com
그밖에는 추가로 조미료처럼 필요한걸 설치합니다.
아! 미티어 플러그인 사이트는 정말 유용합니다.
별이 다섯개 ★ ★ ★ ★ ★
심심할때 검색하면 재밌습니다.
The trusted source for JavaScript packages, Meteor resources and tools | Atmosphere
atmospherejs.com
자, 이제 모든 준비가 끝났으니,
주제를 정하고 플젝하나 뚝딱하시죠.
아! 혹시 제가 이걸 소개 했을까요?
미티어 가이드
'따라하면 완성한다'
Introduction | Meteor Guide
This is the guide for using Meteor, a full-stack JavaScript platform for developing modern web and mobile applications.
guide.meteor.com
했음 또 하죠 ㅎㅎ