/Threads

System Design Capstone Project for Hack Reactor

Primary LanguageJavaScript

Threads

A System Design creation and a recreation of a existing API.

Features

An entire front-end built by a fantastic team of developers. The meat of this repository is the restructuring of the back-end to be able to create queries to the database in a time efficient manner while also being able to handle a large load of requests from many clients. What we can see included in this repository is some schemas for Postgresql in order to have tables to store seeded data. As well as scripts made to query said data. And also RESTful API practices.

Motivation and Story

After using the previous api which had query times of 1000ms+ per request it was clear that long term it was not a viable solution. So I built upon the existing architecture to refactor it in a way that would lower the query times substantially. I taught myself new ways to optimize queries and some RESTful practices to add to my coding arsenal. And used my skills to create a System design that would allow this to be possible by creating schemas in Postgresql and playing around with the design visually in external programs such as excalidraw. I also used json functions in postgres and table manipulation to lower query times.

The end result was an API I created with average query speeds of ~10ms - 15ms per query at all endpoints.

Code Styles

This project follows the Airbnb JavaScript Style Guide.

Tech Stack

Built with

Repository Installation (ssh)

$ git clone git@github.com:ec-rilo/FEC-Web-App.git

Once in the repository make sure to install the required packages.

$ npm install

Some global credentials are also needed, so make sure to create a .env file.

$ touch .env

Within the .env file the following is needed: Github API key, postgres user, postgres user's password.

GIT_TOKEN=<Github Token>
pg_user=<Postgres User with appropriate privileges>
pg_pass=<The Postgres User Password>

Tests

All tests are run using Jest.

To install Jest please follow the Getting Started Page on the Jest website.

In order to run tests, run the following command within terminal.

$ npm run test

Credits

I'd like to thank the team I worked with on this project, Daniel Esquivel-Reynoso and Danny Wong. Both have helped me with all questions I had throughout the lifespan of this project.

Project extended by Edgar Carrillo