This is a social media app that allows for users to posts images, reviews and descriptions of books they have read and view the posts of others. This app allows the user to login and create an account. An API will be called on and used to display book information relevant to the app. Google Books api endpoint - https://www.googleapis.com/books/v1
[Evaluation of your app across the following attributes]
Required Must-have Stories
Optional Nice-to-have Stories
Tab Navigation (Tab to Screen)
Flow Navigation (Screen to Screen)
[Add picture of your hand sketched wireframes in this section]
https://www.figma.com/file/MeFya5Xa4V1yQYh52lLreR/ALM-Book-Project?node-id=14%3A7
https://imgur.com/a/81lnKd5.gif
User
Property | Type | Description |
---|---|---|
Username | String | Unique id for user login |
password | String | Secure password for user login |
String | Email address to receive correspondence or login |
Post
Property | Type | Description |
---|---|---|
objectID | String | Unique id for user post |
image | File | image that user posts |
caption | String | caption by author |
likesCount | Number | number of likes for the post |
createdAt | DateTime | date when post is created |
author | Pointer to User | image author |
Comments | Property | Type | Description |
---|---|---|---|
objectID | String | Unique id for user post | |
author | Pointer to User | Name of author that posted comment | |
likesCount | Number | number of likes for the post | |
createdAt | DateTime | date when post is created | |
caption | String | comment made by author |
Likes | Property | Type | Description |
---|---|---|---|
author | Pointer to User | Name of author that liked post |
Follows | Property | Type | Description |
---|---|---|---|
author | Pointer to User | name of user that followed | |
image | File | image of user that followed | |
followersCount | Number | number of followers for the user |
Login
ParseUser.logInInBackground("Username", "SecurePassword", new LogInCallback() {
public void done(ParseUser user, ParseException e) {
if (user != null) {
// Hooray! The user is logged in.
} else {
// Signup failed. Look at the ParseException to see what happened.
}
}
});
Logout
ParseUser.logOut();
ParseUser currentUser = ParseUser.getCurrentUser(); // this will now be null
Register
ParseUser user = new ParseUser();
user.setUsername("my name");
user.setPassword("my pass");
user.setEmail("email@example.com");
// other fields can be set just like with ParseObject
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
}
}
});
Stream - User can scroll through important resources in a list
ParseQuery<ParseObject> query = ParseQuery.getQuery("Posts");
query.whereContainsAll(ParseUser.getCurrentUser();, isFollowing);
query.findInBackground(new FindCallback<ParseObject>() {
public void done(List<ParseObject> posts, ParseException e) {
if (e == null) {
Log.d("Posts", "Retrieved " + posts.size() + " posts");
} else {
Log.d("Posts", "Error: " + e.getMessage());
}
}
});
Creation
ParseObject myPost = new ParseObject("Post");
myPost.put("username", userID); myPost.put("description", content); myPost.put("timeStamp", currentTime); myPost.put("likes", 0);
// Adds private write access to user and read access to all other users ParseACL postACL = new ParseACL(ParseUser.getCurrentUser()); postACL.setPublicReadAccess(true); myPost.setACL(postACL); myPost.saveInBackground();
* (Create/POST) Create a new comment on a post
ParseObject myComment = new ParseObject("Comment"); myComment.put("username", userID); myComment.put("description", content); myComment.put("timeStamp", currentTime); myComment.put("likes", 0); //Create a relation between the post and the comment myComment.put("post", ParseObject.createWithoutData("Post", postObjectID)); myComment.saveInBackground();
* (Create/POST) Create a new like on a post
Parse.Cloud.define("like", async request => { var post = new Parse.Object("Post"); post.id = request.params.postId; post.increment("likes"); await post.save(null, { useMasterKey: true }) });
* (Delete) Delete existing like
Parse.Cloud.define("like", async request => { var post = new Parse.Object("Post"); post.id = request.params.postId; post.decrement("likes"); await post.save(null, { useMasterKey: true }) });
* (Delete) Delete existing post
ParseQuery
* (Delete) Delete existing comment
ParseQuery
Detail - User can view the specifics of a particular resource
ParseQuery<ParseObject> query = ParseQuery.getQuery("Posts");
query.getInBackground(postObjectID, new GetCallback<ParseObject>() {
public void done(ParseObject object, ParseException e) {
if (e == null) {
// Retrieve data using get methods of each data type
String user = object.getString("username");
String description = object.getString("description");
String timestamp = object.getString("timestamp");
int likes = object.getString("likes");
} else {
// something went wrong
}
}
});
Profile
ParseQuery<ParseObject> query = ParseQuery.getQuery("ObjectId");
query.getInBackground("xWMyZ4YEGZ", new GetCallback<ParseObject>() {
public void done(ParseObject object, ParseException e) {
if (e == null) {
// This is what we found
} else {
// something went wrong
}
}
});
ParseQuery<ParseObject> query = ParseQuery.getQuery("profileImage");
// Retrieve the object by id
query.getInBackground("ImageId", new GetCallback
[OPTIONAL: List endpoints if using existing API such as Yelp]
Google Books API
HTTP Verb | Endpoint | Description |
---|---|---|
GET | /volumes?q={search terms} | Performs a book search. |
GET | /volumes/volumeId | Retrieves a Volume resource based on ID. |
New York Times API
HTTP Verb | Endpoint | Description |
---|---|---|
GET | /lists/names.json | returns a list of all the NYT Best Sellers Lists |
GET | /reviews.json?author | get NYT book review by author |
GET | /reviews.json?title | get NYT book review by title |