Git Product home page Git Product logo

unplatforms-screener's Introduction

unPlatforms - Screener

This repository contains the submission for unPlatforms screener round.

Table of Contents

Requirements

To run the solution/application, the following softwares are required:

Installing Dependencies

For installing dependencies in the frontend (React, React Redux, ...):

  • In the terminal, change directory to user-feed-frontend folder
  • Run npm install

For installing dependencies in the backend (Express, Sequelize, ...):

  • In the terminal, change directory to user-feed-backend folder
  • Run npm install

Running the Solution

Configuring Sequelize

The contents of user-feed-backend/config/config.json file would be something like this:

{
	"development": {
		"username": "...",
		"password": "...",
		"database": "...",
		"host": "127.0.0.1",
		"dialect": "mysql"
	},
	"test": { ... },
	"production": { ... }
}

Since we would be running the server in development mode; in the development object, set the properties:

  • username to the username of your MySQL instance
  • password to the password of your MySQL instance
  • database to the name of your database in the MySQL instance

In the database, there is NO need to either create any new table or add entries to it, since Sequelize would take care of creating the table if it doesn't exists, on the first run of the Express server.

However, if you already have a table named stats in your database even before you run this application, make sure you drop the table to prevent conflicts due to different table structure.

Starting the Express Server

Note: Express server must be run before running the React application

  • Open a new terminal, and then change the directory to user-feed-backend.
  • Run npm run dev to start the Express server.

Starting the React Application

  • Open another terminal, and then change the directory to user-feed-frontend.
  • Run npm start to start the React application.

Bonus Features

Comments

The solution/application also features the ability to post comments, which are then stored as JSON in the entry/row of the respective post in the database.

The following GIF demonstrates comments in action:

comments-gif

Multiple Posts

For generating multiple posts, Modify posts.json in user-feed-frontend/src.

For example, Adding the following object to the array in posts.json would automatically create a new post with the respective attributes: (Feel free to change the values in the below object, but make sure that the postID is unique for each post)

{
	"postID": "2",
	"userPic": "profiles/profile-2.png",
	"userName": "Christopher Jonas",
	"userDetails": [
		"MS, Software Engineering",
		"2018",
		"Software Engineer at IBM"
	],
	"postDetails": [
		"3d",
		"Washington"
	],
	"postTitle": "A new journey awaits...",
	"postContent": "I'm excited to announce that I have taken a new role as 'Senior Advisory Technical Services Specialist' within IBM. I am looking forward to furthering my skills and exploring new opportunities in IBM"
}

For each object in posts.json, a <Post /> child component inside <Feed /> component is generated in the React app using map() , and an entry/row is created in the stats table of the database, if it does not exists already. The entries in the table are then updated accordingly.

The following GIF demonstrates multiple posts in action:

multiple-posts-gif

unplatforms-screener's People

Contributors

roshankumar2303 avatar

Watchers

 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.