Install OpenPlatform with Node.js and PostgreSQL, Docker or Docker Compose
OpenPlatform needs the latest Node.js and a PostgreSQL database. There are three ways to start it, all from the README of the repository. Do not run database.sql yourself: OpenPlatform uses that script internally on the first start.
By hand
- Install Node.js and PostgreSQL and create an empty database for OpenPlatform.
- Download the source code.
- Install the dependencies in the root of the application:
npm install- Put the connection string in the file
config(the file has the linedatabase : postgresql://user:pass@localhost:5432/databaseas a model, and a linedatabase (env) : DATABASEthat reads it from the environment variableDATABASE). - Start it (the
startscript ofpackage.jsonrunsnode index.js 8000):
node index.js- Open
http://127.0.0.1:8000and, before anything else, open the settings and configure the platform (the README marks this step as important; the settings are in settings and database).
Docker Hub
docker pull totalplatform/openplatform
docker run --env DATABASE='postgresql://user:pass@hostname/database' -p 8000:8000 totalplatform/openplatformDocker Compose
git clone https://github.com/totaljs/openplatform.git
cd openplatform
docker compose upWhat the first start does
When the database has no OpenPlatform tables yet (it looks for the table cl_config in the schema op), the application loads database.sql, replacing its placeholders with values it generates: the identifier of the installation, the cookie name, the secrets and salts, the tokens, and the first user and group. It then loads the configuration and starts the authentication (definitions/init.js). With the environment variable DATABASE (Docker) it waits three seconds before this, so that the database can be up. In both cases the server is paused (PAUSESERVER('Database')) until the database is ready.
The first sign-in
The README gives the default account:
login : info@totaljs.com
password : adminSign in, change that password (the portal has the account action for it) and configure the settings. Remember the rule of the README: every application that you add must be assigned to a group, or nobody sees it (groups and permissions).