Skip to content
This repository was archived by the owner on Aug 25, 2019. It is now read-only.

Installation Instructions

Azzeh edited this page Aug 2, 2017 · 3 revisions

Okay Yeah but.. How do I install this?

NOTICE: This does not tell you every command. If you are going to go ahead and install this to make a service. You should have the knowledge needed to make it without being tutored with commands

First and foremost, you must have a MACHINE (VPS or Dedicated). Shared hosting. WILL. NOT. WORK.

Now, with that out of the way, let's begin with the calm explanation!

You'll need the following:

  • Git (Duh)
  • A bit of knowledge about Git
  • PostgreSQL and knowledge of the SQL language
  • Node (NodeJS)
  • Minio
  • Knowledge of environment variables
  • And a lot of patience

Now, To set up the API, clone the repository by doing

git clone https://github.com/RatelimitedME/API

Once that's done, Download Minio from minio.io and set it up so it runs correctly and web access to it is enabled.

Proceed by installing Postgres and setting up a user and database on it!

Once you're done, import the database given with the API (Should be named example.pgsql) (Sidenote: You should view the example.pgsql file and edit it to your liking BEFORE importing it. There are TWO tables. users and tokens. If you don't edit it and you keep the default token on a production environment [A service which is used by friends even] CAN and will most likely BE destructive)

Now, on to the last parts of a basic installation!

Go to the directory that the API is in (If you're not already in) and run npm install

Once that is done, You're left with configuring the environment variables.

An environment variable can be configured with the export command and/or set in some distributions. I can verify that it is export for Ubuntu.

You need to set the following variables:

DATABASE_URL S3_FILES_ACCESS_KEY_ID S3_FILES_SECRET_KEY S3_FILES_BUCKET PORT

Now, what do these do you may ask? Well let's take them one by one

DATABASE_URL Is the postgres URI of your database, which would go something along the lines of postgres://user:password@host/database,

S3_FILES_ACCESS_KEY_ID Is something that you can retreive from your S3 API (In our case, Minio) In Minio it is logged at each startup.

S3_FILES_SECRET_KEY Is the password to what we just spoke about and you can retreive from your S3 API (In our case, Minio). In Minio It's logged at each startup.

S3_FILES_BUCKET Is your S3 API (In our case, Minio) bucket.

PORT Is the port that the API will run on.


Now just do node app.js and it should start!

There is still a lot of configuration to go regarding your webserver but the basis of the API configuration is done!

Clone this wiki locally