Skip to content

timemates/backend

Repository files navigation

Platform Latest GitHub release GitHub GitHub issues

TimeMates Backend

The repository with source code of TimeMates server on Kotlin.

Warning
The current backend version may lack stability in the API and migration support. It's not production ready.

Setup

If you want to host the application yourself, follow the instructions below:

  1. Obtain the latest release by either building the artifact with ShadowJar or downloading it from the releases page.
  2. Install Java on your system.
  3. Set up the environment variables as described in the Environment section (optional).
  4. Run the application using the following command: java -jar <path-to-jar-file>

Environment

To run this application on your own host, you need to provide the following environment variables:

  • TIMEMATES_RSOCKET_PORT – The port on which rsocket instance will run (default: 8080)
  • TIMEMATES_DATABASE_URL – The URL to the PostgreSQL database
  • TIMEMATES_DATABASE_USER – The username for the PostgreSQL database
  • TIMEMATES_DATABASE_USER_PASSWORD – The password for the PostgreSQL user
  • TIMEMATES_FILES_PATH – The path to the directory where uploaded files will be stored
  • TIMEMATES_SMTP_HOST – The SMTP host of the mailer
  • TIMEMATES_SMTP_PORT – The SMTP port of the mailer
  • TIMEMATES_SMTP_USER – The SMTP user of the mailer
  • TIMEMATES_SMTP_USER_PASSWORD – The password for the SMTP user
  • TIMEMATES_SMTP_SENDER – The email address of the SMTP mailer

Note
There are two mailer implementations available: SMTP and MailerSend. Depending on your choice, you need to provide the corresponding environment variables.

If using the SMTP mailer implementation, make sure to set the TIMEMATES_SMTP_HOST, TIMEMATES_SMTP_PORT, TIMEMATES_SMTP_USER, TIMEMATES_SMTP_USER_PASSWORD and TIMEMATES_SMTP_SENDER variables.

If using the MailerSend implementation, you should set the MAILERSEND_API_KEY, MAILERSEND_SENDER, MAILERSEND_CONFIRMATION_TEMPLATE and MAILERSEND_SUPPORT_EMAIL variables.

Refer to the code documentation for more details on configuring the mailer implementation.

Note
You can also use Java arguments to set up the application. Refer to the source code for more information.

Docker image

The Timemates Backend Docker image is available on Docker Hub. You can pull the image and run it locally or deploy it to your server.

To pull the Docker image from Docker Hub, use the following command:

docker pull y9vad9/timemates-backend:$version
docker run --env-file .env y9vad9/timemates-backend:$version

Replace $version with the specific version or tag you want to use.

For example, to pull the latest version, use:

docker pull y9vad9/timemates-backend:latest
docker run --env-file .env y9vad9/timemates-backend:$version

You should also provide DOCKER_IMAGE_PORT environment variable for docker port. Also, you should add all environment variables from Environment.

Database

Backend creates and migrates Postgresql database by itself (if it's release version), so that no need in your own setup or migration.