Artist Hub is a brand new project which is very early in development and is ready for basic testing. You can watch this repository to see the development process and you can try to use it but their are likely to be bugs and missing functionality.
You must first create a
node_app/.env file. To get started copy the sample from
cp node_app/.env.example node_app/.env
You should then customise the environment variables in the
.env file to configure authentication and set the cookie secret before you can start a server.
Supported authentication methods are currently
oidc (OpenID Connect) and
local (Hardcoded username/password). Both can be configured using environment variables (or the
If you want to use OpenID Connect you can either use a hosted service such (e.g Auth0) or run your own server (e.g. Ory Hydra).
The easiest way to get started is to use Docker and docker-compose.
We provide 3 compose files which can be used to get up and running quickly.
Base compose file. Will start a dev server on HTTP and uses an existing PostgreSQL server which you should configure in your
This compose file will create and run the required PostgreSQL server in a Docker container so you don't need to provide an existing PostgreSQL server. This file requires you to also include
This compose file will also serve the site using HTTPs and should be used with a real domain. It will use Let's Encrypt to acquire a TLS certificate.
These instructions below assume you are using the Docker provided PostgreSQL server.
On the first run or when updating run:
docker-compose -f quickstart.yml build docker-compose -f quickstart.yml -f quickstart-postgres.yml run --rm node npm run knex -- migrate:latest
Then start the server with:
DOMAIN=localhost docker-compose -f quickstart.yml -f quickstart-postgres.yml up -d
This will start the server running on port 80.
You can access this by visiting http://localhost in your browser.
You may want to use these compose files as a basis to create your own compose file for deployment.
For a production deployment you should change the
DOMAIN to the domain name you are using and also include the
quickstart-production.yml which uses Caddy and Let's Encrypt to automatically enable HTTPS.
For example when using the provided PostgresSQL docker container:
DOMAIN=example.com docker-compose -f quickstart.yml -f quickstart-postgres.yml -f quickstart-production.yml up -d
Or if you used your own PostgresSQL server:
DOMAIN=example.com docker-compose -f quickstart.yml -f quickstart-production.yml up -d
docker-compose -f quickstart.yml -f quickstart-postgres.yml down
docker-compose will create volumes to store the Artist Hub database and any uploaded images. If you no longer need the data and want to delete it then run:
docker-compose -f quickstart.yml -f quickstart-postgres.yml down -v
The code the documented using TSDoc. You can generate documentation using TypeDoc by running:
npm run typedoc
Artist Hub uses PostgreSQL as a data store. Artist Hub has been tested with PostgreSQL 12.x but should work with 10.x and later. You will need to create a database in PostgreSQL for Artist Hub and configure a database user with write access to that database.
These SQL commands would create a suitable user and database.
CREATE ROLE artisthub WITH LOGIN PASSWORD 'password'; CREATE DATABASE artisthub WITH OWNER artisthub;
To run the node app in development mode you should install the latest LTS version of Node.js.
You should then configure the
.env file as described in the configuration section above. Make sure you configure the
PGPASSWORD variables with the database settings:
PGDATABASE=artisthub PGHOST=localhost PGPORT=5432 PGUSER=artisthub PGPASSWORD=password
Then run the following commands:
npm run knex -- migrate:latest
The node app uses debug for debug logging. To enable all debug logging start the node app with
DEBUG=artisthub:* npm start.
To run the tests for the node app run
To run the web app in development mode you should install the latest LTS version of Node.js and then run the following commands:
You can now open the Artist Hub by visiting http://localhost:3000 in your browser.
Copyright (c) 2021 Creative Passport MTÜ. All rights reserved.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.
Generated using TypeDoc