In this document, we will describe the basic setup and installation of the platform. You can setup and try out the platform using a single machine and a smartphone.
Karya uses the following apps for things for operating. Most of the requirements will be handled by the setup script except for Azure blob store and Google OpenID.
- Postgresql Server (version 12 or above) - Postgres drives our main database. (Done by setup script)
- Redis Server - Needed for bull library. (Done by setup script)
- Azure blob store - You need to provide the account name and key as part of the configuration
- Google OpenID Client ID - This is needed for authenticating work providers and admins with the server.
- Keycloak - Karya uses Keycloak for role management on the server side. (Done by the setup script)
- Specify the database name, user name and password.
- Uncomment the SQL queries.
- Specify the SERVER_DOMAIN and ADMIN_EMAIL in the
setup.sh
file. - Run the script
bash setup.sh
.
Note: The setup script handles the following things:
- Install all the requirements like PostgreSQL, Redis, and Keycloak.
- Setup nginx as a reverse proxy and add SSL
- Build the NodeJS app.
# keycloak-16.1.0> ./bin/standalone.sh
- Before you can use Keycloak, you need to create an admin account, which will be used to log in to the Keycloak admin console.
- Open
http://localhost:8080/auth
or<SERVER_URL>/keycloak/auth
in your web browser. The welcome page opens, confirming that the server is running. - Enter a username and password to create an initial admin user.
Note: The keycloak username and password are required in the following steps.
# server/backend> node dist/scripts/ResetDB.js
This command resets the database and bootstraps authentication. Anyone who wants to sign up on the platform (admin/work provider) needs an access code. This script sets up an admin record and spits out the access code for the admin to sign up.
# server/backend> node dist/Server.js
Copy the .sample.env
file to .env
and fill out the fields.
# server/frontend> npm start
Open the frontend server URL on a browser. Sign up using the admin access code
that you received from the backend ResetDB.js
script.
Click on the "Box" tab and generate an access code for a new box.
Copy the .sample.env
file to .env
and fill out the fields.
Copy the .sample.box
file to another file (say .box.1
) and fill out the
details of the box.
# server/box> node dist/Server.js