Code Monkey home page Code Monkey logo

yasp's Introduction

YASP (Yet Another Stats Page)

Build Status Code Climate Coverage Status Dependency Status devDependency Status Discord

Overview

  • This project aims to provide free, open source, highly detailed match and player statistics for the Dota 2 community.
  • Data comes from the WebAPI provided by Valve and fully automated parsing of match replays (.dem files).
  • See here for an example of our match analysis (this match may not have the latest features as we're constantly adding new things).

Tech Stack

  • Web/Microservices: Node.js
  • Storage: PostgreSQL/Redis/Cassandra
  • Parser: Java (powered by clarity)

Quickstart

  • Using Docker will let you run the code in a container with all dependencies properly installed.
  • Install Docker: curl -sSL https://get.docker.com/ | sh
  • Clone the repo: git clone https://github.com/yasp-dota/yasp
  • Go into the directory: cd yasp
  • Create .env file with required config values in KEY=VALUE format (see config.js for a full listing of options) cp .env_example .env
    • STEAM_API_KEY You need this in order to access the Steam Web API.
    • STEAM_USER, STEAM_PASS The retriever requires a Steam account in order to fetch replay salts. We recommend creating a new account for this purpose (you won't be able to log into the account while the retriever is using it). If you don't care about getting replay salts/downloading replays then you can skip this step.
  • Start a new container running the image, and map your local directory into the container: sudo docker run -v $(pwd):/usr/src/yasp -di --name yasp --net=host yasp/yasp:latest
  • Start the external dependencies in separate containers.
    • sudo docker run -d --name postgres --net=host postgres:9.5
    • sudo docker run -d --name redis --net=host redis:3
    • (optional) sudo docker run -d --name cassandra --net=host cassandra:3
  • Initialize Postgres: sudo docker exec -i postgres psql -U postgres < sql/init.sql
  • Create tables: sudo docker exec -i postgres psql -U postgres yasp < sql/create_tables.sql
  • Set up Cassandra (optional): sudo docker exec -i cassandra cqlsh < sql/cassandra.cql
  • Get a terminal into the running container: sudo docker exec -it yasp bash
  • Build inside the container: npm run build
  • Start the services you want to run:
    • pm2 start profiles/basic.json This starts all the basic services to be able to open the site in a browser and request parses by ID (which is a useful end-to-end test). Use profiles/everything.json to start everything.
    • pm2 start svc/web.js --watch This starts a specific service and watches it for changes.
    • pm2 logs web You can use this command to inspect the output of a service.
    • pm2 delete all Stop and remove all the services.
  • Alternatively, if you have Docker Compose installed you can just run docker-compose up.
  • 3 containers will be built and launched - one with postgres database, one with redis and one with web service.
  • Database is inited and tables are created automatically.
  • By default, minimal configuration necessairy to open the site in a browser and request parses by ID is started. This can be overridden via docker-compose.override.yml.
  • sudo docker exec -it yasp_web_1 bash will give you a terminal into the running web container.
  • Useful commands
    • npm run watch: If you want to make changes to client side JS, you will want to run the watch script in order to automatically rebuild after making changes.
    • npm test runs the full test suite. Use mocha for more fine-grained control over the tests you want to run.
    • node tasks/updateconstants pulls latest constants data and saves to json directory.
  • Get some starter data
    • You can request some parses by ID to get some parsed data.
    • You can also run scanner with ENABLE_INSERT_ALL_MATCHES=1 in your .env to get some matches from the API.
  • File changes you make outside the container should be automatically mirrored to the container.
  • Make some changes and commit them: git add --all; git commit -m "My first commit!"
  • Submit a pull request. Wait for it to be reviewed and merged.
  • Congratulations! You're a contributor.

Getting Help

  • Feel free to open a new issue to ask questions/get help!
  • You can also find us on Discord if you'd like real-time help.

Help Wanted

History

yasp's People

Contributors

howardchung avatar albertcui avatar paralin avatar wtfkr0 avatar nicholashh avatar mvthen avatar rjackson avatar daerdemandt avatar vramana avatar mbax avatar aehrraid avatar coreymaher avatar ahockersten avatar mysrt avatar lemongod avatar fhoffa avatar teuneboon avatar onelivesleft avatar promisedlandt avatar michael-the1 avatar mchearty avatar mhartkorn avatar dancek avatar likered avatar jfo84 avatar jazzyjosh avatar jwgoh avatar lamroger avatar gitter-badger avatar crisbal avatar

Watchers

John Capodilupo 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.