YumSpot is an app that allows users can search good places to eat, upload and share photos of food, and make appointments to eat out.
Required Must-have Stories
Optional Nice-to-have Stories
Tab Navigation (Tab to Screen)
Flow Navigation (Screen to Screen)
Property | Type | Description |
---|---|---|
image | File | image that user posts |
userId | String | unique id for the user post (default field) |
user | Pointer to User | image user |
commentsCount | Number | number of comments that has been posted to an image |
likesCount | Number | number of likes for the post |
createdAt | DateTime | date when post is created (default field) |
updatedAt | DateTime | date when post is last updated (default field) |
userEmail | String | user's email |
userPassword | String | user's password |
// Create the ParseUser
ParseUser user = new ParseUser();
// Set core properties
user.setUserId("joestevens");
user.setUserPassword("secret123");
user.setUserEmail("email@example.com");
// Invoke signUpInBackground
user.signUpInBackground(new SignUpCallback() {
public void done(ParseException e) {
if (e == null) {
// Hooray! Let them use the app now.
} else {
// Sign up didn't succeed. Look at the ParseException
// to figure out what went wrong
}
}
});
Feed Screen
(Create/POST) Create a new comment on a post
@ParseClassName("Post")
public class Post extends ParseObject {
// ...
}
@ParseClassName("Comment")
public class Comment extends ParseObject {
// ...
// Associate each comment with a user
public void setOwner(ParseUser user) {
put("owner", user);
}
// Get the user for this comment
public ParseUser getOwner() {
return getParseUser("owner");
}
// Associate each comment with a post
public void setPost(Post post) {
put("post", post);
}
// Get the post for this item
public Post getPost() {
return (Post) getParseObject("post");
}
}
// Create the post
Post post = new Post("Welcome Spring!");
// Get the user
ParseUser currentUser = ParseUser.getCurrentUser();
// Create the comment
Comment comment = new Comment("Get milk and eggs");
comment.setPost(post);
comment.setOwner(currentUser);
comment.saveInBackground();
myComment.deleteInBackground();
// After this, the playerName field will be empty
myComment.remove("comment");
// Saves the field deletion to your Parse Server
myComment.saveInBackground();
let query = PFQuery(className:"Post")
query.include(Post.USER);
query.setLimit(30);
query.order(byDescending: "createdAt")
query.findObjectsInBackground { (posts: [PFObject]?, error: Error?) in
if let error = error {
print(error.localizedDescription)
} else if let posts = posts {
print("Successfully retrieved \(posts.count) posts.")
//
allpost.addAll(posts)
adapter.notifyDatasetChanged();
}
}
Post Screen
(Create/POST) Create a new post object
private void savePost(String description, ParseUser currentUser, File photoFile) {
Post post = new Post();
post.setDescription(description);
post.setImage(new ParseFile(photoFile));
post.setUser(currentUser);
post.saveInBackground(new SaveCallback() {
@Override
public void done(ParseException e) {
if (e != null){
Log.e(TAG, "Error while saving", e);
Toast.makeText(MainActivity.this, "Error while saving", Toast.LENGTH_SHORT).show();
}
Log.i(TAG, "Post save was successful!!");
etDescription.setText("");
ivPostImage.setImageResource(0);
}
});
}
Profile Screen
ParseQuery<ParseUser> query = ParseUser.getQuery();
query.whereKey("user", equalTo: currentUser);
query.findInBackground(new FindCallback<ParseUser>() {
public void done(List<ParseUser> objects, ParseException e) {
if (e == null) {
print("Successfully retrieved user.")
} else {
print(error.localizedDescription)
}
String userId = item.getUserId();
String userEmail = item.getUserEmail();
}
});
let query = PFQuery(className:"Post")
query.whereKey("user", equalTo: currentUser);
query.order(byDescending: "createdAt")
query.findObjectsInBackground { (posts: [PFObject]?, error: Error?) in
if let error = error {
print(error.localizedDescription)
} else if let posts = posts {
print("Successfully retrieved \(posts.count) posts.")
//
allpost.addAll(posts)
adapter.notifyDatasetChanged();
}
}
myPost.deleteInBackground();
// After this, the playerName field will be empty
myPost.remove("post");
// Saves the field deletion to your Parse Server
myPost.saveInBackground();
ParseUser.logOut();
ParseUser currentUser = ParseUser.getCurrentUser(); // this will now be null
HTTP Verb | Endpoint | Description |
---|---|---|
GET |
/search | returns up to 1000 businesses based on the provided search criteria |
GET |
/{id} | returns detailed business content |
GET |
/{id}/reviews | returns up to three review excerpts for a given business |