Giter Club home page Giter Club logo

community-anagrams's Introduction

community-anagrams

Go/React/TypeScript SPA that checks if two words are anagrams. As well, provide statistics on the words requested. We store information behind a PostgreSQL database via a local server.

Technologies Used

  • Golang
  • TypeScript
  • React
  • Jest
  • MDreact
  • PostgreSQL

Go Server

The Go client has two main endpoints that the SPA will call.

GET "/top"

Upon loading, the SPA will communicate with the server to pull the the top 10 most made requests between two words (less than 10 if there has been <10 unique requests). The returned data will be in descending order based on the number of requests.

POST "/anagrams"

After a user inputs two valid words, the server will validate whether or not the two words are anagrams or not. Afterwards, the server will store the words into its database to track how many requests to the words have been made over the lifetime of the application. This provides the data that when the endpoint GET "/top" is called, it will display the top 10 requests made in order as well as the total count.

Go Setup

To run in a development environment, we can simply use the command in the main server directory:

go run main.go

To run a production executable, we build the program and then run the exe

go build ./[executable]

React Client

The client displays a form where a user will be able to check if two words are anagrams. As well, a 'leaderboard' will be displayed that showcases the top 10 requests made during the lifetime of the app.

Setup

yarn.lock has been included, but if updates are needed, run yarn. Client was created using CRA and mdreact as the layout framework.

Development

Run yarn start for development

Production

Run yarn build and then yarn serve

Assumptions

  • No user flow / authentication / authorization
  • Top 10 anagrams = Top 10 requests of the two words searched for
  • No CI/Containerization within MVP, left as a extension

Docker

You can run this entire application under one docker command.

docker-compose up --build

This will create a temporary database that will store requests. But the data may not be persisted upon container resets.

community-anagrams's People

Contributors

dong-alex avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.