The web interface for creating and administering polis conversations. It is built with React.js.
- Node
>= 16
We recommend installing nvm so that you can easily switch between your favorite flavors of node. - NPM
>= 8
If using nvm, run the commands below to install node and the application dependencies.
nvm install 18
nvm use 18
npm install
If you prefer to run the Polis application using docker compose
, see the top-level README document. This component
will be built and served as part of the file-server
container.
If you are building this container on its own, outside of the docker compose
context, simply use the Dockerfile
located in this directory. Optionally provide a "tag" for the image that is created:
docker build -t polis-client-admin:local .
docker run -p 8080:8080 --name polis-client-admin polis-client-admin:local npm start
Now you can see the web interface at [http://localhost:8080], but if it is not connected to the Server API you won't get very far. Still it can be useful for developing and debugging builds.
Optionally, you can register with Facebook and get a Facebook App ID to use the Facebook auth features.
If you do so, set the FB_APP_ID environment variable in the top level .env
file, or manually pass it in
when building and running this application.
To enable twitter widgets for user authentication, set the ENABLE_TWITTER_WIDGETS environment variable to true
in the
top level .env
file, or manually pass it in when building and running this application.
If you having troubles with npm dependencies try run the commands below:
rm -rf node_modules
npm install
This will run the webpack dev server which will rebuild as you make changes.
npm start
Now you can see the web interface at [http://localhost:8080]. You will still need to run the rest of the Polis application components (via docker compose or otherwise) to have a functional interface.
The client-admin will look for an API server at whatever domain and port it is itself running on, e.g. localhost
.
In the future this should become more customizable.
To build static assets into build/
for a production deployment, run
npm run build:prod
The polis file-server process builds and serves these assets when docker compose is used.
See the "scripts" section of the package.json file for other run and build options.