Skip to content

evansloan/collection-log-api

Repository files navigation

collection-log-api

Serverless API for collectionlog.net and the collection log Runelite plugin

Getting started

Clone the respository and install dependiencies

$ git clone https://github.com/evansloan/collection-log-api && cd collection-log-api
$ yarn install

Docker setup

  1. Create .env file

Rename .env.docker to .env. The variables in this file can be modified to your liking

  1. Build and start the Docker container
$ docker-compose up
  1. Apply database migrations
$ docker-compose exec api yarn run migrate:latest
  1. Run database seeders (optional)
$ docker-compose exec api yarn run seed
  1. Connect to the database and API

Database connection string: postgres://postgres:postgres@localhost:5433/collection_log

API base URL: http://localhost:3001/

Manual setup

  1. Install PostgreSQL

  2. Set up collection_log database and user

$ createuser <username>
$ createdb collection_log
$ psql
$ ALTER USER <username> WITH encrypted password '<password>'
$ GRANT ALL PRIVILEGES ON DATABASE collection_log TO <username>
  1. Create .env file

Rename .env.sample to .env and set the following variables

DB_USER=<username>
DB_PASS=<password>
  1. Apply database migrations
$ yarn run migrate:latest
  1. Run database seeders (optional)
$ yarn run seed
  1. Run the API
yarn run dev
  1. Connect to the database and API

Database connection string: postgres://postgres:postgres@localhost:5433/collection_log

API base URL: http://localhost:3001/

Documentation