Giter Site home page Giter Site logo

cash_free_user_comment's Introduction

This app is bootstrapped with razzle.

The code is avaliable on github

Database

Nano-sql is used as the data to store the comments and users. There are two tables:

  • Users: (name, color, user_id {pk} )
  • Comments: (comment, timestamp, comment_id {pk} , user_id {fk}, reply_to_comment_id {self fk}, reply_to_user {fk} )

These table are joined to display the comments and the users table is queries for the initial user list The users data along with some comments are loaded at the start, comments are added with submitted or replies to other comments are done

Api Layer

The api layer consists of:

  • Repository Layer: This handles the db operations (in this case it sets up nano-sql tables and pre-populates data)\
  • Service Layer: This layer performs logical operations over the repository
  • Router Layer: This layer interacts with the service and network

UI Layer

The UI is build with react. The entry point is App.js, while a majority of the logic resides in Comments.js

How to Use

  • yarn install and yarn start to start the app
  • runs on http://localhost:3000/
  • Users can add comments via the text area in the bottom of the screen
  • Users can reply to comments, these comments appear nested
  • Users can reply to nested comments, these comments reference the user they are replying to
  • The replying user can be changed by changing the dropdown value
  • As nano-sql is an inmemory db, new comments are presistant till the app is stopped and restarted. The data persists during a reqular restart

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.