Giter Site home page Giter Site logo

trellixvulnteam / pennclubreview_j490 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mureytasroc/penn-club-review

0.0 0.0 0.0 7.51 MB

JavaScript 0.04% C++ 1.11% Python 79.51% C 5.33% Tcl 13.73% PowerShell 0.02% CSS 0.01% HTML 0.23% Batchfile 0.01% Xonsh 0.01%

pennclubreview_j490's Introduction

Organization and Data Storage

For this project, I went with a Flaskified MVC architecture (models-static-templates, with all controlling done within index.py). To save time, I used a data directory with json files to store club and user data. The clubs file holds an array of objects, with each object representing a club. Each club object has the keys 'name', 'description', 'tags', 'likes', and 'tagColors'. Name and description are strings, tags is an array of tag name strings, likes is an int (representing the number of likes the club has), and tagColors is an array of the same size as tags (with strings of the css color for corresponding tag). The users file holds an array of objects, with each object representing a user. Each user object has the keys 'username', 'name', 'year', 'school', and 'favclubs'. Username, name, and school (college within Penn) are strings, year is an int (graduation year), and favclubs is a list of strings (each being the name of a club that user has liked). The tags file holds an array of all of the string tag names.

Scraping

I completed scraper.py and you can rescrape ocwp.pennlabs.org by uncommenting the denoted lines (15-17 inclusive) within index.py. I added some code to color-coordinate equivalent tags for all of the clubs so it is more logically colored on the clubs page.

Routes (Tested on browser and in Postman)

Method Route Behavior Parameters Returns
GET /static/<path:path> Returns any file Path variable (to get your file in static) js or css
GET /clubs Returns the clubs page, with jen automatically logged in (didn't have time to fully flesh out log in / sign up structure) html
GET /account Returns the account page html
GET /reviews/<cname> Returns the reviews page for the given club (where the user can see more info about the club and all of the reviews) cname: the desired club html
GET /review/<cname> Returns the review page (where the user writes a review for the club) cname: the desired club html
GET /api Returns a welcome message text
GET, POST, PUT /api/clubs GET: serves a list of clubs in jsonified format. POST: adds a club to the directory. PUT: updates a club in the directory request.form["name"] (a string of the club name), request.form["description"] (a string of the club description), request.form["tags"] (a json-stringified array of the tags) GET: clubs json; POST: success(The club "'+name+'" was added to our database successfuly.), failure(The club "'+name+'" already exists in our database (add failed).
GET /api/user/<username> Returns a json with non-private user data (right now this includes everything in the user objects within users.json) username: the user's username (not their name) json
POST, PUT /api/favorite POST: adds tags to the user's liked clubs list; PUT: updates the user's liked clubs list with a new list POST: request.form["username"] (string username) and request.form["likes"] (list with the clubs to be added to liked); PUT: request.form["username"] (string username) and request.form["likes"] (list of new liked clubs). The server updates the likes for each club while processing these routes. success({"success": true})

My Own Features

Main features:

  • Club listings and search (by keyword, liked, or tag)
  • Likeable club listings (with ajax database update for club and user)
  • Club tags are color coded for your convenience
  • Framework for reviews / review list system
  • Framework for account system

Potential next features:

  • Sort clubs by likes, ratings, etc.
  • More club info (website link, photo, calendar)
  • Serve user analytics to clubs, and to other users (popularity based on views)
  • Allow for liking and commenting on ratings
  • Switch to cloud database, cloud host, and launch to domain

pennclubreview_j490's People

Contributors

mureytasroc avatar patchtester avatar trellixvulnteam 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.