- Install ionic
$ npm install -g ionic - Start ionic tabs template
$ ionic start whatsapp tabs
- Apply John Papa coding style
- Seperate components to their own files:
config.jsroutes.jscontrollers/chats.controller.jscontrollers/chat-detail.controller.js
- Seperate components to their own files:
- Mock Whatsapp tabs
- Mock Whatsapp chats view
- Add
timestampto lastMessage - Add
filters/calendar.filter.js - Add moment.js -
$ bower install moment --save
- Add
- Setup sass:
$ npm install$ ionic setup sass
- Add
chats.scss - Change data scheme:
id->_idface->picturelastText->lastMessage { text, timestamp }
- Create server:
$ meteor create server$ rm server.*$ mkdir lib && touch lib/collection.js- Define
Chats,Messagescollections $ touch bootstrap.js- Move the bootstrap data from
Chatsservice to initiate theChatscollection. $ meteor add momentjs:moment
$ bower install meteor-client-side angular-meteor --save- Define collections at the client in
collections.js - Change the controllers to work with the Meteor Collection and Object:
- Use
$scope.$meteorCollection - Use
$scope.$meteorObject - Remove
Chatsservice
- Use
- Imitate Whatsapp's chat ui:
- Add
chat-detils.html - Add
chat-detils.scss - Add pictures:
chat-background.png,message-other.png,message-mine.png - Add angular-moment
$ bower install angular-moment --save
- Add
input.directive.jsto better mobile experience - Server: Add
'newMessage'method$ meteor add check- Add
methods.js
- Client: Add
'newMessage'stub- Add
stubs.js
- Add
- Add accounts-phone
- Server:
$ meteor add okland:accounts-phone- Add
sms.jsandsettings.json
- Client:
-
$ bower install accounts-phone --save -
Require the scripts in
index.html<script src="lib/accounts-base-client-side/dist/accounts-base-client-side.bundle.min.js"></script> <script src="lib/accounts-phone/dist/accounts-phone.bundle.min.js"></script>
-
- Server:
- Add login flow:
- Add
'login','confirmation','profile'states - Server: Add
'updateName'method - Add 'login', 'profile' style files
- Add
- Ensure that user is logged in:
- Ensure user before 'tab', 'profile' states - resolve
$meteor.requireUser() - Redirect to login route -
auth.js - Server: Ensure that user logged in before preform methods
- Ensure user before 'tab', 'profile' states - resolve
- Server: Add
userIdto message - Add
'settings'tab with logout button
- Add new chat modal view - add controller and template
- Add
newChatmethod and stub - Add
chatNameandchatPicturefilters to get data by user _id $ meteor remove insecure- Add
'removeChat'method and change inChatsCtrl
$ meteor remove autopublish- Add
'chats'publish$ meteor add reywood:publish-composite$ touch publications.js- Subscribe at the 'tab' state - resolve
$meteor.subscribe('chats');
- Add
'users'publish- Subscribe at new chat controller