Giter VIP home page Giter VIP logo

proavalon's Introduction

ProAvalon

Online platform for The Resistance! Play the game.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Pre-requisites

  • Node.js v12.0.0+
  • Yarn
  • Git
  • Docker - Used to install MongoDB. If you prefer, you may skip Docker and install MongoDB directly.

Other useful resources:

Installing

  1. If you intend on contributing, make a fork of ProAvalon.

  2. Git clone a copy of the code:

$ cd path/to/your/folder

# Replace with your fork if applicable
$ git clone https://github.com/vck3000/ProAvalon.git
  1. Make a copy of .env.example and name it .env.
$ cp .env.example .env
  1. Install dependencies.
$ yarn

Running

  1. Start the database with: docker-compose up. Ensure Docker is running.
  2. Start the server with: yarn dev.

Stopping

  1. Stop the server with Ctrl+C.
  2. Stop the docker-compose stack with Ctrl+C.
  3. Remove the containers from the docker-compose stack with docker-compose down.

Misc

  • To run local tests run yarn test.
  • To run local tests in watch mode run yarn test:watch.
  • To run local tests with coverage report run yarn test:coverage.

Optional: Create an admin account

On the registration page, create an account ProNub with any password.

Alternatively, you can edit the admins file under /src/modsadmins/admins.tsand not stage it in your future commits.

Overview

This is a Node.js express application that is currently deployed on Digital Ocean. There are three stages: Production (live server), Development/staging (master branch of this repo) and other Heroku servers for each pull request.

When a pull request is merged to master, GitHub Actions will trigger and produce docker containers. When approved, an admin will promote it to the production server.


User authentication is handled by Passport.js and client-server communication is handled by Socket.io. They are combined by passport.socketio.

The server is run from app.js.

Routes are all under the routes folder. index.js is the upper most layer (most broad).

After users log in, they are redirected to the lobby page where sockets/sockets.js handles socket communication.

All scripts and stylesheets are under the assets folder.lobby.ejs is perhaps the most complicated. I have broken the file down into smaller pieces and required them at the bottom of lobby.ejs.

There is a server-wide cache of 30 minutes for all files. This helps cut down on data usage, while also solving the issue of certain iPhone devices "flashing" every game iteration (the browser would re-download each image every time before caching was introduced).

There is also a middleware folder which contains useful functions mainly for authentication purposes on forums and profiles.

Other useful global functions can be found under the myFunctions folder.

Contributing

When contributing, please make a new branch and then make pull request. If you require any help, feel free to make an issue, or contact an admin through Discord or through the server.

Acknowledgments

  • Ref-rain and Hakha3 for their immense suppport and continuous user feedback for the site.

proavalon's People

Contributors

vck3000 avatar vkuo3446 avatar ishanzuaim avatar bocaben avatar adzcai avatar tyrrox avatar dependabot[bot] avatar dravyanshsharma avatar cin333 avatar yellowtrafficlight avatar jezztify avatar skiesss avatar frankanthony11 avatar ayush314 avatar 5oph1a avatar nihars avatar ayad318 avatar mysticsquire avatar nyanisres avatar seagullible avatar pkvk9122 avatar sleepyfoxen avatar aanguyen avatar mybaldbird avatar kojeff avatar hapr05 avatar detry322 avatar rtkimz avatar rpadaki avatar sidewalkill 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.