Skip to content

Revature-GoGato/GoGatoUsers

Repository files navigation

GoGato

A Social Media Application

What is GoGato?

GoGato is a social media site where users can share stories that interest them.

Users can comment on posts and discover new trending topics.

Read something cool? Leave a like to give the author GoGato points!

What is the GoGato application composed of?

The GoGato backend was built using Java Spring Boot.

The Posts and Users API currently function independently. However, there is

potential for the application to transition to a microservices architecture in the future.

GoGato's frontend was built with the React.js library.

Site Design and Functionality

Live demo (requires Posts and Users API to be running locally):

https://gogatotest.vercel.app/

Visitors to the GoGato site can do the following:

  • Register
  • Login
  • View and update their profile
  • Create and delete posts
  • Comment on posts and reply to comments
  • View the amount of likes on a post
  • View their timeline
  • View trends

When users log into the application, their userId is saved as a Local Storage entry. This information is kept until the user logs out. The Navigation.js component checks the currentUser to ensure that logged out users are unable to view pages other than login or registration.

When a user checks the timeline, the program retrieves a list of posts that will be looped through to create a list of renderable posts. During this loop a recursive function is called on every post to find comments correlated to that post. Using a combination of looping and recursion we create the timeline seen on the site. This allows users to comment on comments and posts alike.

Profile pages are generated by sending a GET request for the userId matching the ID in the URL (e.g. …/profiles/1). If the profile userId matches the currentUser, edit options will be available.

Posts API

The GoGato Posts API provides the following functionalities:

  • Create/Update/Delete Posts
  • Retrieve a Post by userId
  • Retrieve all Posts
  • Create a Like
  • Retrieve a Like by userId
  • Retrieve all Likes
  • Update/Delete Like by userId

The Posts API is used to update, create, and retrieve Posts and Likes. Its methods, classes, and interfaces are documented via JavaDocs. Post and Likes data is persisted to a PostgreSQL database hosted on AWS. The tables for the RDMS were created manually using SQL. Lombok was used to cut down on getter, setter, and constructor boilerplate code.

Users API

The GoGato Users API provides the following functionalities:

  • Create/Register a User
  • Login/Validate a User
  • Find a User by userId or username
  • Update a User's firstName, lastName and aboutMe
  • Update a User's points

The Users API is used to update, create, and retrieve Users. Its methods, classes, and interfaces are documented via Swagger OpenAPI and JavaDocs. For encryption, the Users API utilizes a static BCrypt hash. User data is persisted to a PostgreSQL database hosted on AWS. The tables for the RDMS are created programmatically via Spring JPA with Hibernate. Lombok was also used to cut down on getter, setter, and constructor boilerplate code.

Although the Users API does include the Eureka client dependency, the application as a whole does not support a microservices architecture at this time.

Users API Endpoints

Please see Swagger documentation for a full description of requests.

USERS Description
/users POST: Create a new User
GET: All Users
/users/{identifier}/ GET: User by userId or Username
/users/{identifier}/ PUT: Update a User's points
LOGIN Description
/login POST: Verify a User's credentials
PROFILES Description
/profiles/{identifier}/about PUT: Update a User's points
/profiles/{identifier}/name PUT: Update a User's name

Posts API Endpoints

POSTS Description
/post
/post/userid/:userid GET: Post by userid
/post/userid/:parentid GET: Post by parentid
/post/create POST: Create a new post
LIKES Description
/likes GET: Return list of Likes
POST: Create a Like
/likes/{userId} GET: Return list of Likes by userId
PUT: Update a Like for {userId}
DELETE: Delete a like for {userId}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published