Quick start
Perfice can run completely without a backend, since it's built as a local-first web application. However, you might want to run a backend if you're interested in the following:
- Sync: Synchronizing your data between devices (such as your phone)
- Integrations: Automatically fetching data from remote providers like Fitbit, Todoist, etc
Running the client
The easiest way to run the webapp is by using Docker, this will run a bundled version of Perfice with nginx.
A Docker compose file exists which you can use to get up and running quickly.
Simply download the file into your current directory and run docker compose up
Building from source
You can also build the client from source to produce static HTML/CSS/JS files.
cd client
npm install
npm run build
The built files will be placed in the dist folder, ready to be served by your favorite HTTP server.
Keep in mind that the client is expected to be ran under the /new subpath. This might require you to tweak your configuration or place all files under a dummy new directory.
Running the backend
In order to run the backend you must have a MongoDB database running.
Similar to the client I've created a Docker compose file. Here you can configure the services before running them, such as setting the MONGO_URL and ENCRYPTION_KEY environment variables.
Setting SENTRY_DSN is not necessary unless you want error reporting with Sentry.
Architecture
The backend is built with a microservice architecture, it is split into gateway, auth, sync and integration modules. The microservices communicate mainly through gRPC but also use Kafka for publishing events that multiple services might consume.