Skip to content

KaiFujimoto/ArchaicTome

Repository files navigation

alt text

Archaic Tome

About

Archaic Tome is a clone of Facebook that was started on March 6, 2018. It employs the following main features of Facebook: login/signup, main feed, profile page, posts, comments, friending, profile images, profile details, edit/delete, friend search bar. (more features are pending)

Link To Live Site

Link To Facebook Site


About The Set Up

Archaic Tome (AT) is a rails backend, react-redux frontend structure utilizing speed of react and redux instead of rails html erb to quickly update different aspects of the webpages without having to re-render the whole page or constantly hit the database.

All features of the app were made from backend to frontend, starting from generating the models, controllers, and database in Rails and then moving the rendering to the frontend through actions.

All in all, it was a lot of fun to make!


Main Features:


Landing Page:

The landing page has a form for new users as well as current users.


alt text



Main Feed:

The main feed page has a nice gif on the right that will be replaced with a news feed as well as a list of recommended friends.

The main features of this feed are: creating posts, navigating to profile (top right), commenting on posts, editing both posts and comments, adding friends (top right people button creates a dropdown to add friends), user search, button to log out


Main Feed

alt text

Friend Notification

alt text

Friend Dropdown Menu

alt text

User Search Dropdown Menu

alt text

Live Examples:

Confirming a Friend

alt text

Finding Friends

alt text

Commenting and Editing

alt text

Editing a Post

alt text



My Top Features

Posting (adding timestamps)

alt text

and they update if you update!

alt text


Used Moment from react and created a util file

import moment from "moment";

// https://momentjs.com/

export function timeUtil(time) {
  if (moment(time).isAfter(moment().subtract(24,'hours'))) {
    return moment(time).startOf(time).fromNow();
  } else if (moment(time).isAfter(moment().subtract(24,'hours').startOf('day'))) {
    return moment(time).format('[Yesterday] [at] h:mma' );
  } else {
    return moment(time).format('MMMM D [at] h:mma');
  }
}

The Challenge: Figuring out a way to efficiently convert timestamps into actual dates and then knowing how to organize the date information in a way to reflect facebook's timestamps

The Solution: Employed simple logic to figure out how facebook does their timestamps and attempted to mimick them.


Changed Modal Structure to display per Post ( for editing posts )

// ./components/main_page/posts_index/edit_posts/modal.jsx

function Modal({modal, props, closeModal}) {
  if (!modal) {
    return null;
  }
  let component = null;
  if (modal.type === 'edit' && modal.postId === props.post.id) {
      component = <EditPostContainer post={props.post}/>;
      return (
        <div className="modal-background" onClick={closeModal}>
          <div className="modal-child" onClick={e => e.stopPropagation()}>
            { component }
          </div>
        </div>
      );
  } else {
    return null;
  }
}

The Challenge: A normal modal would render for the buttons that pertain to opening it. But what if you had multiple buttons of the same type? Then, what happens is that the button would render the modal for every instance of that button (in my case, it would render the post of every post that has a button next to it). It creates an overlapping effect on the modal render.

The Solution: Implemented logic to check if the modal's postId was equal to the props post's id and put a conditional render so I can filter out the postIds of the modals that don't match the post that I want the modal to appear on.



Features in progress:

Main features:

  1. Likes (for posts and comments)
  2. Photo viewing modals for cover photos, normal photos, and profile photos

Smaller features:

  1. Making the description box editable via a click
  2. Rending profiles based on if they are public or private.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published