Skip to content

Latest commit

 

History

History
88 lines (56 loc) · 3.26 KB

getting-started.md

File metadata and controls

88 lines (56 loc) · 3.26 KB

Quarter is built using .NET Core as backend and a Gleam based front-end using Gleam.

Prerequisites

Make sure you have the following tools installed:

Getting started with development

  1. Clone this repository:

git clone https://github.com/eliasson/quarter.git

  1. Create a copy of the settings for you to customize:

cp service/src/Quarter/appsettings.json service/src/Quarter/appsettings.Development.json

By default Quarter will run in local mode, which is useful for development. See authentication.md for details on how to setup external Identity Providers.

  1. Start a PostgreSQL database

Start an instance of the PostgreSQL database using Docker Compose.

Run docker compose -f tools/docker/docker-compose.yaml up -d

The first time this is run it will execute the tools/docker/init.sql script to setup the local database and privileges. All tables are created using Fluent Migrations at service/src/Quarter.Core/Migrations.

  1. Build the frontend

The backend serves static files from a dist/ directory at the repository root. You need to build the frontend before starting the backend.

The frontend consists of two Lustre applications, the time tracking app (served on /ui) and the admin app (served on /admin), plus a shared package. See webapp/README.md for details.

From the webapp/ directory:

npm ci
make build

This compiles the Gleam code, bundles it with Vite, and outputs the result to dist/ui/ and dist/admin/ in the repository root. Run make test to run the Gleam tests for all projects.

During development you can use npm run watch (app) or npm run watch:admin (admin) from webapp/ to automatically rebundle on changes. Note that the Gleam code still needs to be compiled with gleam build in the changed project.

  1. Symlink the dist directory

The backend is configured to serve static files from ./dist relative to where it runs (service/src/Quarter/), but the frontend build outputs to dist/ at the repository root. You need to create a symlink so the backend can find the built frontend assets:

From the repository root:

ln -s ../../dist service/src/Quarter/dist
  1. Build and run the backend

From the service/ directory:

  • dotnet build - download all libraries needed and build the solution
  • dotnet test - runs unit tests for all projects
  • dotnet run --project src/Quarter - starts the service at localhost
  1. Open the application

Run open https://localhost:5001/, go to Manage section and create your first project and some activities. Then head to Timesheet and start registering time!

Configuration

By default Quarter will run in local mode, which is useful for development. The configuration is located at service/src/Quarter/appsettings.json with development overrides in service/src/Quarter/appsettings.Development.json.

See authentication.md for details on how to setup external Identity Providers.