- 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.js
routes.js
controllers/chats.controller.js
controllers/chat-detail.controller.js
- Seperate components to their own files:
- Mock Whatsapp tabs
- Mock Whatsapp chats view
- Add
timestamp
to 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
->_id
face
->picture
lastText
->lastMessage { text, timestamp }
- Create server:
$ meteor create server
$ rm server.*
$ mkdir lib && touch lib/collection.js
- Define
Chats
,Messages
collections $ touch bootstrap.js
- Move the bootstrap data from
Chats
service to initiate theChats
collection. $ 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
Chats
service
- 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.js
to 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.js
andsettings.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
userId
to message - Add
'settings'
tab with logout button
- Add new chat modal view - add controller and template
- Add
newChat
method and stub - Add
chatName
andchatPicture
filters 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