Skip to content

mittelman29/ClientServerExercise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Client Server Exercise

The purpose of this exercise is to demonstrate expertise with several technologies and across the web development stack.

Description

In python, create a script that exposes 2 ports, 11211 and 8000. On the first port, expose a subset of memcached functionality, set, get and delete. On the second port, serve a basic web site that displays the current list of key/value pairs maintained by memcached.

Requirements

Backend

  1. The Python program must be able to accept multiple connections at once.
  2. The data must be persistent, i.e. stored in a database.

Frontend

  1. The web site can be simple, but should use a modern framework.
  2. Values should be hidden with JS and only exposed when a user clicks to view.
  3. User should be able to add/update/delete key/value pairs.

Quick Start

  1. Clone the repo
$ git clone https://github.com/mittelman29/ClientServerExercise.git
  1. Install Memcached If you're on Mac, run:
$ brew install memcached
  1. Run memcached on port 11311 (default is 11211)
$ memcached -p 11311 &
  1. Install prerequisites for data tier
$ sudo pip install python-binary-memcached
  1. Install prerequisites for web tier
$ cd ClientServerExercise/monitoring-site
$ npm i
  1. Build the React site
$ npm run build
  1. Run the service
  • You may choose any database name you'd like, but to see sample data populated, use 'database.sqlite'
$ cd ..
$ python main.py <db_name>
  1. Happy hacking!
  1. base url + / => list all key/value pairs
  2. base url + /key => view single key/value pair
  3. base url + /set?key=value => create/update a key/value pair
  4. base url + /del/key => delete a key/value pair

License

This was written for demonstration and educational purposes only and is freely shared with the public. Please feel free to clone, fork or spoon this code as you see fit.

Disclaimer

This is a work of fiction. Names, characters, businesses, places, events, locales, and incidents are either the products of the author's imagination or used in a fictitious manner. Any resemblance to actual persons, living or dead, or actual events is purely coincidental.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published