Giter Club home page Giter Club logo

pingpong-api's Introduction

Bytecode PingPong Api Project maintainers

Build Status codecov Known Vulnerabilities NodeJS Version AGPLv3 license

Requirements

This application is built to support NodeJS v8 LTS and later.

It is advised to use Yarn as a package manager.

Any database supported by KnexJS can be used.

Installation

After cloning the repository, run yarn to install all dependencies.

Configuration

Before running the application, run the following commands:

cp knexfile.js.example knexfile.js
cp .env.example .env

Now set your configs in the knexfile.js and .env files.

Running the application

For starting the application, run yarn run start, with the NODE_ENV environment variable set matching the environment you want to use in your knexfile.js file.

The NODE_ENVs available by default (package.json) are:

  • development, for yarn run dev
  • production, for yarn run start
  • test, for yarn run test, yarn run test:watch and yarn run coverage

Development

For development and running the integration tests, PostgreSQL should be used.

To use Nodemon (auto restart on save), run yarn run dev.

If you want to run the tests while developing, run yarn run test:watch.

Testing

Tests should be present where possible. Jest is used as testing framework.

For any pull-requests to be accepted, the following commands should pass:

  • yarn run lint
  • yarn run test
  • yarn run build

For checking the code coverage, run yarn run coverage.

Routes

TODO: Add Swaggerhub

All routes are based on /api/v1

GET /status

Returns http code 200

POST /team/create

name: string

POST /team/get-members

Requires auth, add an Authentication header with value Bearer [token].

teamid: number

POST /team/get-all-data

Requires auth, add an Authentication header with value Bearer [token].

teamid: number

POST /player/register

username: string
email: string
teamid: number
password: string

POST /player/auth

Return includes a JWT

username: string
password: string

POST /game/create

Requires auth, add an Authentication header with value Bearer [token].

teamid: number
player1id: number
player1score: number
player2id: number
player2score: number
winner: number
addedby: number

License and maintainers

This project is AGPL-3.0 licensed.

This project is maintained by Bytecode Digital Agency.

Currently, this project is maintained by Bytecode team-members:

For questions regarding this project, please send an email to [email protected].

pingpong-api's People

Contributors

jeroenvansteijn avatar

Stargazers

 avatar

Watchers

 avatar  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.