Skip to content

spiko-tech/spiko-tricount

Repository files navigation

Spiko Tricount

Open in GitHub Codespaces

A fullstack expense-sharing application built as a practical case for Spiko's software engineering interviews.

Context

This project is a "Tricount" application (similar to Tricount or Splitwise) that allows users to track shared expenses and settle debts using EUTBL tokens (Spiko tokens).

Features

Authentication

  • Sign up with email/password
  • Sign in
  • Log out

Tricount Management

  • Create a new tricount instance (expense group)
  • Invite users to join a tricount

Expense Tracking

  • Add expenses to a tricount
  • Specify who paid and how the expense should be split
  • View expense history

Settlement

  • Automatic computation of refunds/balances between participants
  • Settle debts using EUTBL tokens (Spiko tokens)

Tech Stack

This is an Nx monorepo containing:

  • App (app/): React frontend application
  • Server (server/): Node.js backend API built with esbuild
  • Database: PostgreSQL 16

Getting Started

Option 1: GitHub Codespaces (Recommended)

The fastest way to get started is using GitHub Codespaces:

  1. Click the "Open in GitHub Codespaces" badge above
  2. Wait for the environment to build (2-3 minutes on first launch)
  3. Once ready, run pnpm nx run-many -t dev to start the development servers

Everything is pre-configured: Node.js, pnpm, PostgreSQL, and VS Code extensions.

Option 2: Local Development

Prerequisites

  • Node.js LTS (v24.x)
  • pnpm
  • Docker (for PostgreSQL database)

Database Setup

Start the PostgreSQL database:

docker compose up -d

This starts a PostgreSQL instance with:

  • Host: localhost
  • Port: 5432
  • Database: spiko_tricount
  • User: postgres
  • Password: postgres

To stop the database:

docker compose down

Installation

pnpm install

Development

Run all projects in watch mode:

pnpm nx run-many -t dev

This starts:

Run a specific project:

pnpm nx serve server

Build

npx nx run-many -t build

Testing

npx nx run-many -t test

Linting

npx nx run-many -t lint

Project Structure

app/          # React frontend application
server/       # Node.js backend API (DDD architecture)
  src/
    domain/         # Business entities, repository interfaces
    application/    # Use cases, application services
    infrastructure/ # Database, repositories, migrations
    presentation/   # HTTP handlers, API routes
packages/     # Shared packages
libs/         # Shared libraries

Useful Commands

Command Description
npx nx graph Visualize project dependencies
npx nx affected -t build Build only affected projects
npx nx affected -t test Test only affected projects

Interview Instructions

Please refer to the instructions provided by your interviewer for specific requirements and evaluation criteria.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors