Skip to content

Sub-project serving up the backend of the application under spaceships web edition: https://github.com/tjtanjin/spaceships_web

Notifications You must be signed in to change notification settings

tjtanjin/spaceships_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpaceShips API

Table of Contents

Introduction

SpaceShips API supports the SpaceShips Web project by providing the functionality of maintaining a leaderboard. For work pertaining to the SpaceShips game itself, please refer to the repository here:

https://github.com/tjtanjin/spaceships_web

Currently, the game is live on the following website:

https://spaceships.tjtanjin.com/

Features

The API currently supports 2 endpoints, one for each type of leaderboard as shown below:

1) Single player
2) Two player

GET and POST requests are supported on both endpoints for the updating and retrieving of listings on the leaderboards.

Technologies

Technologies used by SpaceShips Web are as below:

Done with:

JavaScript

Deployed on:

OVHcloud

Project Repository
https://github.com/tjtanjin/spaceships_api

Setup

The following section will guide you through setting up your own SpaceShips Web edition!

  • First, cd to the directory of where you wish to store the project and clone this repository. An example is provided below:
$ cd /home/user/exampleuser/projects/
$ git clone https://github.com/tjtanjin/spaceships_api.git
  • Following which, execute the following commands to install nodejs and npm:
$ sudo apt-get update
$ sudo apt-get install nodejs
$ sudo apt-get install npm
  • Then, install mongodb as well following the guide from their official website.
  • Next, create a .env file at the base directory of the project with variable name DATABASE_URL as shown below (assumes localhost):
DATABASE_URL=mongodb://localhost/leaderboard
  • Finally, run the following command to start the API:
$ sudo npm run start
  • If you wish to host this API 24/7, you may refer to a similar guide here that uses telegram bot hosting as a demonstration.
  • Reminder to update the API endpoint on the frontend of the project here!

Team

Contributing

If you have code to contribute to the project, open a pull request and describe clearly the changes and what they are intended to do (enhancement, bug fixes etc). Alternatively, you may simply raise bugs or suggestions by opening an issue.

Others

For any questions regarding the implementation of the project, please drop an email to: cjtanjin@gmail.com.

About

Sub-project serving up the backend of the application under spaceships web edition: https://github.com/tjtanjin/spaceships_web

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published