Git Product home page Git Product logo

mlb-db's Introduction

##mlb-db mlb-db is a web app for accessing Major League Baseball (MLB) team and player profiles and statistics.
Uses Sean Lahman Baseball Database. The latest version of this database has stats from 1871 - 2013.

##Design Architecture

###Front End

  1. UI - Bootstrap 3

  2. Namespacing - Single global: spa

  3. Modules

  • spa.shell.js - controller/router , initializes all modules
  • spa.player.js - model and view for player list, player profiles and player stats
  • spa.team.js - model and view for team list, team profiles and team stats
  • spa.autoc_search.js - model and view for auto-complete search (for desktop)
  • spa.search.js - model and view for search feature (for phones & tablets)
  • spa.pagination.js - pagination for player and team list views

Templates

  • Handlebars.js is used for templating. Templates are in separate files
    loaded at startup, compiled and stored and cached.

####MVC architecture
This design doesn't implement separate model/view functionality but does feature
a controller/router module.(spa.shell.js)

  • Initializes all modules Handles URI hashchange events triggered by model/view modules to
    trigger DB requests

  • All views (player list, team list etc.) are bookmarkable.

####Other Features:

  • auto-complete search
  • pagination support using jquery.jqpagination jQuery plugin

###Back End

Node 0.10.x/Express 3.2.x MongoDB 2.6.x/mongodb Native driver 1.3.x

  • mongoimport used to import csv database files to collections
  • Uses mongodb aggregation framework for some queries (ex. player career stats)

Performance Tuning

  1. Indexes are created on several mongoDB collections (db-config.js)
  2. Use res.setHeader('Cache-Control', 'public, max-age=xxxx');
    to cache static files and database responses.

###Cloud Hosting

Heroku & mongolab

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.