Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: node server.js
20 changes: 20 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Application name:
Post Map
https://www.youtube.com/watch?v=jgfxFXXYhN4

Description :
it is a mobile app that let the user post image in his location witch will appear to all whom use the app ,also he can find friends like and comment their posts�

Pages:
it has 10 pages the user can see (signup , login , reset password , home , friends ,comment , add friend , add post , profile , friends request )�

Technics :
we use ionic2 for frontend and firebase as backend , karma & jasmine for the test�
Future work: In future some of added can make it Awesome like make the posts even text or video also add the property add friend also to map posts�

Team work:
Abdul-Azeez Naji (https://github.com/abdulazeeznaji) ,
Waleed khaled (https://github.com/waleedkhaled) ,
Rwaida Almehanni (https://github.com/rwaidaAlmehanni).

Thanks...
Binary file removed logo.jpg
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"start": "node server.js",
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"ionic:build": "ionic-app-scripts build",
Expand Down
1 change: 1 addition & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export class MyApp {
const unsubscribe = firebase.auth().onAuthStateChanged((user) => {
this.zone.run( () => {
if (!user) {

this.rootPage = LoginPage;
unsubscribe();
} else {
Expand Down
3 changes: 0 additions & 3 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { InfoModalPage } from '../pages/info-modal/info-modal' ;
import { UploadPage } from '../pages/upload/upload';
import { ItemComponent } from './../pages/upload/upload';
import { AuthData } from '../providers/auth-data';
import { FriendsPage } from '../pages/friends/friends';
import { ProfilePage } from '../pages/profile/profile';
import { CommentsPage } from '../pages/comments/comments';
import { FindFriendsPage } from '../pages/fiend-friends/fiend-friends';
Expand All @@ -33,7 +32,6 @@ import { FindFriendsPage } from '../pages/fiend-friends/fiend-friends';
ItemComponent,
ResetPasswordPage,
SignupPage,
FriendsPage,
ProfilePage,
CommentsPage,
FindFriendsPage,
Expand All @@ -56,7 +54,6 @@ import { FindFriendsPage } from '../pages/fiend-friends/fiend-friends';
ItemComponent,
ResetPasswordPage,
SignupPage,
FriendsPage,
ProfilePage,
CommentsPage,
FriendRequestPage,
Expand Down
19 changes: 13 additions & 6 deletions src/pages/fiend-friends/fiend-friends.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,20 @@
</ion-header>
<ion-content padding>
<ion-searchbar (ionInput)="getItems($event)"></ion-searchbar>
<ion-list>
<ion-item *ngFor="let item of assetCollection1">
<div>
{{ item.email }}
<button ion-button round (click)="addFriend(item.uid)">+ add</button>
</div>
<ion-list>
<div *ngFor="let item of assetCollection1">
<ion-item>

<ion-avatar item-left>
<img src={{item.src}} />
</ion-avatar>
<h2 style="position: absolute; left: 70px; top:27px;">{{ item.email }}</h2>
<ion-buttons end>
<button ion-button round (click)="addFriend(item.uid)">+ add</button>
</ion-buttons>

</ion-item>
</div>
</ion-list>

</ion-content>
Expand Down
29 changes: 14 additions & 15 deletions src/pages/fiend-friends/fiend-friends.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,27 @@ firebase.database().ref("/userProfile").child(firebase.auth().currentUser.uid).c
_snapshot.forEach((_childSnapshot) => {
friends.push(_childSnapshot.val())
})
this.friendsArr=friends;
});
this.friendsArr=friends;
});
console.log(this.friendsArr)
firebase.database().ref("/userProfile").once('value', (_snapshot: any) => {
let arr=[];
_snapshot.forEach((_childSnapshot) => {
// get the key/id and the data for display
var element = _childSnapshot.val();
element.id = _childSnapshot.key;
console.log(element)
var element = _childSnapshot.val();
element.id = _childSnapshot.key;
console.log(element)
if(element.email!==firebase.auth().currentUser.email&&this.friendsArr.indexOf(element.uid)===-1){
element.email=element.email.slice(0,element.email.indexOf('@'));

arr.push(element);
arr.push(element);
}
});
this.assetCollection1=arr;
this.assetCollection2=arr;
});
this.assetCollection1=arr;
this.assetCollection2=arr;
});
}
initializeItems() {
this.assetCollection1=this.assetCollection2;
this.assetCollection1=this.assetCollection2;

}
getItems(ev) {
Expand Down Expand Up @@ -72,13 +71,13 @@ firebase.database().ref("/userProfile").child(firebase.auth().currentUser.uid).c
addFriend(x){
var userName;
firebase.database().ref("/userProfile").child(firebase.auth().currentUser.uid).child('user').on("value", function(snapshot) {
userName=snapshot.val();
console.log(userName)
})
userName=snapshot.val();
console.log(userName)
})

if(userName){
var database=firebase.database().ref("/userProfile").child(x).child("friendRequests").child(firebase.auth().currentUser.uid).set(userName);
}
}
else{
alert("error friend hasn't been added please try again")
}
Expand Down
14 changes: 10 additions & 4 deletions src/pages/friend-request/friend-request.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,17 @@
<ion-content padding>

<ion-list>
<ion-item *ngFor="let friend of arr">

<p>{{friend.user}}</p>
<div *ngFor="let friend of arr">
<ion-item>
<ion-avatar item-left>
<img src="http://www.hbc333.com/data/out/190/47199326-profile-pictures.png" />
</ion-avatar>
<h2 style="position: absolute; left: 70px; top:27px;">{{friend.user}}</h2>
<ion-buttons end>
<button ion-button round outline (click)="accept(friend.uid,$key)">accept</button>
</ion-item>
</ion-buttons>
</ion-item>
</div>
</ion-list>
</ion-content>

Expand Down
18 changes: 0 additions & 18 deletions src/pages/friends/friends.html

This file was deleted.

3 changes: 0 additions & 3 deletions src/pages/friends/friends.scss

This file was deleted.

71 changes: 0 additions & 71 deletions src/pages/friends/friends.ts

This file was deleted.

26 changes: 13 additions & 13 deletions src/pages/home/home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { InfoModalPage } from '../info-modal/info-modal';
import { AuthData } from '../../providers/auth-data';
import {LoginPage} from '../login/login';
import {SignupPage} from '../signup/signup';
import {App} from 'ionic-angular';
import * as firebase from 'firebase';

@Component({
Expand All @@ -20,7 +21,8 @@ export class HomePage {
arr;
likes;
waleed=0;
constructor(public navCtrl: NavController , public modalCtrl: ModalController , public authData:AuthData) {
public local : Storage;
constructor(private _app: App ,public navCtrl: NavController , public modalCtrl: ModalController , public authData:AuthData) {
}
ionViewDidLoad(){
this.loadMap()
Expand Down Expand Up @@ -96,20 +98,18 @@ export class HomePage {
})

}
// goToCreate(){
// let arr=[];
// let database=firebase.database().ref();
// database.child("userProfile").child(firebase.auth().currentUser.uid).child("friends").push({"a":"azoz"})
// let users=firebase.database().ref().child("userProfile");
// users.on("child_added",snap=>{
// arr.push(snap.val());
// });
// console.log(arr);
// }

logOut(){
this.authData.logoutUser().then(() => {
this.navCtrl.setRoot(LoginPage);
});
// const root = this._app.getRootNav();
// root.popToRoot();
this.navCtrl.parent.parent.setRoot(LoginPage);


});


// });
}

}
Expand Down
33 changes: 0 additions & 33 deletions src/pages/profile/find-friends/comments.html

This file was deleted.

3 changes: 0 additions & 3 deletions src/pages/profile/find-friends/comments.scss

This file was deleted.

41 changes: 0 additions & 41 deletions src/pages/profile/find-friends/comments.ts

This file was deleted.

Loading