COOKKING์ node.js ๊ธฐ๋ฐ์ full-stack framework์ธ Meteor.js๋ก ๋ง๋ค์ด์ง mobile hybrid app์ ๋๋ค.
์์ apk ํ์ผ์ ๋ค์ด๋ก๋ ๋ฐ์, ์๋๋ก์ด๋ ๋ชจ๋ฐ์ผ๊ธฐ๊ธฐ์ ์ง์ ํ์ผ copyํ ํ ์๋ ์ค์นํ์๋ฉด ๋ฉ๋๋ค.
- ํผ ๋ก๊ทธ์ธ/๊ฐ์
- TWITTER ๋ก๊ทธ์ธ
- ๋ ์ํผ ์กฐํ. (์๊ฐ์/์ข์์์/๋ถ๋งํฌ์ ์ ๋ ฌ)
- ๋ ์ํผ ์ข ๋ฅ๋ณ ํํฐ๋ง
- ๋ ์ํผ ์์ฑ/์์ /์ญ์
- ๊ณต๊ฐ/๋น๊ณต๊ฐ ๋ ์ํผ
- ์ค๋์ ์ถ์ฒ๋ฉ๋ด
- ์ฌ๋ฃ ์ถ๊ฐ
- ์กฐ๋ฆฌ๊ณผ์ ๋ฐ ์ฌ์ง ์ถ๊ฐ
- ์๋ฃ์ฌ์ง ์ถ๊ฐ
- ๋๊ธ
- ์ข์์
- ๋ถ๋งํฌ
- ๋ ์ํผ๋ณ ํผ๋๋ฐฑ ์์ฑ
- ๋ถ๋งํฌ ๋ชฉ๋ก
- ํผ๋๋ฐฑ ๋ชฉ๋ก
- ํ๋กํ
git clone git@github.com:caribjin/cookking.git
+-- cookking application root
+-- app meteor root
+-- .hooks git commit hook
+-- both
| +-- collections collections
| +-- controllers iron-router controllers
| +-- lib global helper utility
| router.js router
+-- client
| +-- collections client collections
| +-- lib client library
| +-- stylesheets stylesheet
| +-- views view template
| app.html
| app.js global helper utility for client
+-- packages
+-- private
+-- public public resources
+-- resources resources for mobile env
+-- server
| +-- bootup bootup actions
| +-- collections
| +-- handler handlers
| +-- methods server mothods
| +-- publish publish
| mobile-config.js mobile config setting
+-- assets sample pictures for initial data
+-- build build output root
+-- config
+-- development
| +-- env.sh env shell script
| +-- settings.json for meteor.settings
+-- production
| +-- env.sh env shell script
| +-- settings.json for meteor.settings
| +-- mup.json settings for mup
start utility for running meteor
| Directory | Description |
|---|---|
| app | Meteor์ root directory. ์ด ๋๋ ํ ๋ฆฌ์์ meteor ๋ช ๋ น์ ํตํด ์ง์ ๊ตฌ๋ํ ๋ ์์ผ๋, application root(cookking)์ start shell์ ํตํด ๊ตฌ๋ํ๋ ๊ฒ์ ๊ถ์ฅ. |
| .hooks | git commit handler๋ฅผ ํฌํจํ ๋๋ ํ ๋ฆฌ. application root์์ git init ํ ๋ค .hooks ํด๋์ post-commit ํ์ผ์ .git ํด๋ ํ์์ hooks ํด๋์ copyํ๋ฉด ์ดํ commit ํ ๋๋ง๋ค ์ต์ข tag๋ฅผ cookking์ ๋ฒ์ ๋ฒํธ๋ก ์ฌ์ฉ. |
| assets | ์ค์ ์ฑ ๊ตฌ๋๊ณผ๋ ๋ฌด๊ดํ ํด๋. ์ต์ด ๊ตฌ๋ ์ ์ํ๋ฐ์ดํฐ๋ฅผ ์์ฑํ ๊ฒฝ์ฐ ์ํ ์ฌ์ง์ด๋ฏธ์ง๋ค์ด ์์น. settings.json ํ์ผ์ app.generateFixtureData ์ค์ ๊ฐ์ด true์ผ ๊ฒฝ์ฐ์๋ ํด๋น ์์น์ ์ด๋ฏธ์งํ์ผ์ด ์์ด์ผ ํจ. |
| build | app์ buildํ ๊ฒฝ์ฐ ์ฌ์ฉ๋๋ root ํด๋ application root์ start shell script๋ฅผ build ์ต์ ์ผ๋ก ๊ตฌ๋ํ ๊ฒฝ์ฐ, ๊ธฐ๋ณธ์ ์ผ๋ก ์ด ์์น์ android, bundle ๋ ๊ฐ์ ํด๋๊ฐ ์์ฑ๋จ. |
| config | app ๊ตฌ๋ ํ๊ฒฝ์ค์ root. developmentํ๊ฒฝ๊ณผ production ํ๊ฒฝ ๋ ๊ฒฝ์ฐ์ ๋ฐ๋ผ ๊ฐ๊ฐ ์คํํ๊ฒฝ ๋ณ์์ ์ดํ๋ฆฌ์ผ์ด์ ์ค์ ๊ฐ์ ๋ค๋ฅด๊ฒ ์ ์ฉ. application root์ start shell script๋ฅผ dev option ๋๋ prod option์ผ๋ก ๊ตฌ๋ํ์ฌ ๊ฐ๊ฐ ์ ์ฉ. |
{
// client/server ๊ณตํต ์ค์
"public": {
"menuOpenWipeDistance": 130, // ๋ฉ๋ด ์ด๋ฆผ์ ์ํ ์๊ฐ๋ฝ ์ธ๊ธฐ ๊ฑฐ๋ฆฌ
"shortDateDisplayDiff": 7, // ๋ ์ง ํ์๋ฅผ ์งง๊ฒ(๋ช์ ์ ์ผ์ ) ํ์ํ ์ฐจ์ด์ ๋ฒ์
"locale": "kr", // ๊ธฐ๋ณธ ์ง์ญ์ฝ๋
"ingredientsCountLimit": 20, // ์ฌ๋ฃ ์ถ๊ฐ๊ฐ๋ฅ ์ต๋๊ฐ์ (ํ์/์ ํ ๊ฐ๊ฐ)
"directionsCountLimit": 20, // ์กฐ๋ฆฌ๋ฒ ์ถ๊ฐ๊ฐ๋ฅ ์ต๋๊ฐ์
"emptyAvatarImage": "/img/profile/profile-empty.png", // ๋น ํ๋กํ ์ด๋ฏธ์ง
"defaultCameraImageWidth": 1024, // ์ฌ์ง์ดฌ์ ์ด๋ฏธ์ง ๊ธฐ๋ณธ ์ฌ์ด์ฆ
"defaultCameraImageHeight": 1024,
"defaultCameraImageQuality": 90,
"thumbnailImageWidth": 320, // ํผ๋ ์ธ๋ค์ผ ์ด๋ฏธ์ง ํฌ๊ธฐ
"thumbnailImageHeight": 320,
"thumbnailImageQuality": 80,
"uploadMaxLimitSize": 10485760, // ์
๋ก๋ ์ต๋ ์ ํ ์ฉ๋
"uploadLimitExtensions": { // ์
๋ก๋ ์ด๋ฏธ์ง ํ์ฉ ํ์ฅ์
"images": ["jpg", "jpeg", "png", "gif"]
},
"defaultAnimationDurationFast": 100, // ๊ธฐ๋ณธ ์ ๋๋ฉ์ด์
์๋ (ms)
"defaultAnimationDuration": 200,
"defaultAnimationDurationSlow": 500,
"defaultAnimationDurationVerySlow": 800,
"defaultNotificationTime": 5000, // ๊ธฐ๋ณธ ์๋ฆผ๋ฉ์์ง ์ถ๋ ฅ ์๊ฐ
"defaultRecipesListLimit": 10, // ๋ ์ํผ ๋ชฉ๋ก ์ต์ด ๊ธฐ๋ณธ ๊ฐ์
"recipesLimitIncrementCount": 20, // ๋ ์ํผ ๋ชฉ๋ก ๋ ๋ณด๊ธฐ ์ ์ฆ๊ฐ ๊ฐ์
// ๋ ์ํผ ์์ฑ ์ ๊ธฐ๋ณธ ์๋ฃ์ด๋ฏธ์ง
"defaultRecipeWriteCompleteImage": "/img/app/bg-recipe-write.jpg",
// ๋ ์ํผ ๋ฆฌ์คํธ ๊ธฐ๋ณธ ์ ๋ ฌ ๊ธฐ์ค (created, favorited, bookmarked)
"defaultRecipesSort": "created",
"defaultRecipesListFilter": "all", // ๋ ์ํผ ๋ฆฌ์คํธ ๊ธฐ๋ณธ ํํฐ
"defaultStoreType": "filesystem", // ๊ธฐ๋ณธ ์ ์ฅ์ ์ ํ (filesystem / s3)
// s3์ผ ๊ฒฝ์ฐ s3 setting ์ ์ ํ์
"ga": { // google analystics ์ค์
"id": "UA-XXXXX-Y",
"create": {
"cookieDomain": "--cookie_domain--",
"cookieName": "--cookie_name--",
"cookieExpires": 3600
}
}
},
// server ์ ์ฉ ์ค์
"app": {
// application root ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก (meteor app ๊ฒฝ๋ก)
"applicationRootDirectory": "/home/caribjin/meteor/cookking/app/",
"sendSignupWelcomeEmail": false, // ๊ฐ์
์ ํ์๋ฉ์ผ ๋ฐ์ก ์ฌ๋ถ
// true์ผ ๊ฒฝ์ฐ mailgun ์ค์ ์ ์ ํ์
"validateEmailAddress": false, // ๊ฐ์
์ ์ด๋ฉ์ผ์ฃผ์ ์ ํจ์ฑ ๊ฒ์ฆ
// true์ผ ๊ฒฝ์ฐ mailgun ์ค์ ์ ์ ํ์
"generateFixtureData": false, // ์ต์ด๊ตฌ๋ ์ ์ํ๋ฐ์ดํฐ ์์ฑ ์ฌ๋ถ
// ๊ธฐ๋ณธ ์ด๋ฏธ์งํ์ผ ์ ์ฅ ๊ฒฝ๋ก (ec2๋ฅผ ์ฌ์ฉํ ๊ฒฝ์ฐ ๊ธฐ๋ณธ์ ์ผ๋ก /home/ubuntu/app-files)
"defaultFileStoragePath": "/home/caribjin/app-files/"
},
// kadira ์ธ์ฆ ์ค์
"kadira": {
"appId": "--appId--",
"appSecret": "--appSecret--"
},
// mailgun ์ค์ .
// ๊ฐ์
ํ์๋ฉ์ผ ๋ฐ์ก ๋ฐ ๊ณ์ (๋ฉ์ผ์ฃผ์) ์ ํจ์ฑ ์ฒดํฌ์ ์ฌ์ฉ
"mailgun": {
"uri": "--uri--",
"apikey": "--apikey--",
"pubkey": "--pubkey--",
"smtp_host": "--smtp_host--",
"default_smtp_login": "--default_smtp_login--",
"default_password": "--default_password--"
},
// ์ธ์ฆ ์ธ๋ถ์๋น์ค ์ค์ . ํ์ฌ๋ twitter๋ง ์ฌ์ฉ ๊ฐ๋ฅ.
"authServices": {
"facebook": {
"service": "facebook",
"appId": "--appId--",
"secret": "--secret--"
},
"twitter": {
"service": "twitter",
"consumerKey": "NFDQXe7P29etHwMGtJgbbEk8T",
"secret": "49InZjniVGm04A81A2XqlzJb4OcXjALfmzAArBsRXkzOn6FEXT"
},
"github": {
"service": "github",
"clientId": "--clientId--",
"secret": "--secret--"
},
"google": {
"service": "google",
"clientId": "--clientId--",
"secret": "--secret--"
}
},
// s3 ์ธ์ฆ ์ค์ .
"s3": {
"accessKeyId": "--accessKeyId--",
"secretAccessKey": "--secretAccessKey--"
}
}
application root ์์ start shell script๋ฅผ ์คํ
./start
-h ์ต์ ์ ํตํด ์์ธํ ์ธ๋ถ ์ต์ ์ ํ์ธํ ์ ์์ต๋๋ค. ./start -h
| Option | Description |
|---|---|
| dev | ๊ฐ๋ฐํ๊ฒฝ์ผ๋ก ๊ตฌ๋./config/development ํด๋์ ํ๊ฒฝ๋ณ์๋ก ์์๋๋ฉฐ, ๊ธฐ๋ณธ์ ์ผ๋ก http://localhost:3000์ผ๋ก ๊ตฌ๋๋จ../start์ ๊ฐ์ด ์ต์
์์ด ์คํํ ๊ฒฝ์ฐ ๊ธฐ๋ณธ์ ์ผ๋ก dev ์ต์
์ผ๋ก ์คํ๋จ. env.sh์ PORT๊ฐ์ด 3000์ผ๋ก ์ค์ ๋์ด ์์ผ๋, ๊ฐ๋ฐํ๊ฒฝ์์๋ PORT ์ค์ ์ ๋ฌด์๋จ. |
| prod | ์ด์ํ๊ฒฝ์ผ๋ก ๊ตฌ๋./config/production ํด๋์ ํ๊ฒฝ๋ณ์๋ก ์์๋๋ฉฐ, ๋ณ๋ ๋๋ฉ์ธ์ผ๋ก ํธ์คํ
์ค์ผ ๊ฒฝ์ฐ env.sh์ ROOT_URL์ ๊ทธ์ ๋ง๊ฒ ๋ณ๊ฒฝ. PORT ๋ฒํธ๋ ์ด์ํ๊ฒฝ์ ๋ง๊ฒ ๋ณ๊ฒฝ. |
mobile <mobile-server> |
android-device ์ต์
์ผ๋ก ๊ตฌ๋. ์๋๋ก์ด๋ ๋๋ฐ์ด์ค๊ฐ usb ์ฐ๊ฒฐ๋ก ์์ด์ผ ํจ. ๊ธฐ๋ณธ์ ์ผ๋ก development ํ๊ฒฝ์ผ๋ก ๊ตฌ๋๋๋ฉฐ, ๋ฐ๋ผ์ /config/development/ ํ๊ฒฝ๋ณ์๋ค์ด ์ ์ฉ๋จ. mobile-server๊ฐ ์ ๋ ฅ๋์ง ์์ ๊ฒฝ์ฐ ๊ธฐ๋ณธ์ ์ผ๋ก http://localhost:3000 ๋ก ์ฐ๊ฒฐ๋๋๋ก ๊ตฌ๋๋๋ฉฐ, ์ธ๋ถ ํธ์คํ ๋ฑ์ ํตํ ์ด์์ํ๋ก ์ฐ๊ฒฐํ์ฌ ํ ์คํ ์ด ํ์ํ ๊ฒฝ์ฐ mobile-server์ ํด๋น URL์ ์
๋ ฅํด์ผ ํจ.Ex) ./start mobile cookking.mydomain.com |
build <server-url> <platform> |
์ดํ๋ฆฌ์ผ์ด์
์ ๋ชจ๋ ํ๋ซํผ์ ๋น๋ํจ.server-url์ ์
๋ ฅํ์ง ์์ ๊ฒฝ์ฐ ๊ธฐ๋ณธ์ ์ผ๋ก http://localhost:3000์ผ๋ก ๊ตฌ๋๋จ.mup์ ํตํด aws์ ec2๋ก ๋ฐฐํฌํ๊ธฐ ์์๋ ๋ฐ๋์ ์ค์ ec2์ public-DNS ํน์ Route 53์์ ์ฐ๊ฒฐํ Record name์ ์
๋ ฅํด ์ค์ผํจ.platform ์ ๋ ฅ๊ฐ์ ์๋ตํ๋ฉด ๊ธฐ๋ณธ์ ์ผ๋ก web ํ๋ซํผ์ ๊ธฐ์ค์ผ๋ก ๋น๋ํ๋ฉฐ, mobile ํ๋ซํผ์ผ๋ก ๋น๋ํ ๊ฒฝ์ฐ platform ์ต์
์ mobile์ ์
๋ ฅ.Ex) ./start build cookking.mydomain.com mobile |
genkey <app-name> |
keytool๋ก ์๋๋ก์ด๋ apk ๋ฐฐํฌ๋ฅผ ์ํ private key๋ฅผ ์์ฑ. ์์ฑํ๊ณ ์ ํ๋ apk์ app ์ด๋ฆ์ <app-name>์ ์
๋ ฅ. Ex) ./start genkey cookking๋์ผํ app-name์ผ๋ก ์ด๋ฏธ private key๋ฅผ ์์ฑํ ์ ์ด ์๋ค๋ฉด ์์ฑํ ํ์ ์์. |
apk <app-name> |
์๋๋ก์ด๋ ๋ฐฐํฌ๋ฅผ ์ํ apk ํ์ผ์ ์์ฑ. ๋ฏธ๋ฆฌ build ์ต์
์ ํตํด /app/build/android ํด๋์ unaligned.apk ํ์ผ์ด ์์ฑ๋์ด ์์ด์ผ ํจ. ์ด ์ต์
์ ํตํด ๋์ผ ์์น์ sign๋ production.apk๊ฐ ์์ฑ๋จ. |
mup <option> |
mup์ ์คํํจ. /config/production ํด๋๋ด์์ mup์ ์คํํด๋ ๋๋, ๋๋ ํ ๋ฆฌ ์ด๋์ ๋ฒ๊ฑฐ๋ก์ ํด์๋ฅผ ์ํด start shell ๋ด์์ mup์ ๊ทธ๋๋ก ์คํ์ํฌ ์ ์๋๋ก ์ต์
ํ๋จ. build๋ฅผ ๋ง์ณค๋ค๋ฉด mup deploy ๋ช
๋ น์ผ๋ก aws ec2๋ก ๋ฐฐํฌํ๋ค. ์ด ๋, /config/production/ ๋ด์ mup.json ์ค์ ์ด ์ฌ๋ฐ๋ฅด๊ฒ ๋์ด ์์ด์ผ ํ๋ฉฐ, settings.json์ production ํด๋์ settings.json ํ์ผ์ ๊ณต์ ํจ. ์์ธํ mup ์ค์ ์ meteor-up์ ์ฐธ๊ณ . |
The MIT License (MIT)
Copyright (c) 2015 Youngjin Lim
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.