Skip to content

Development

Prerequisites

Core

  • Go - for the API server
  • Node.js - for the frontend
  • Task - for running common commands (replaces just)
  • watchexec - auto-reloads the API server during development for faster iteration (required for task watch)
  • ExifTool - better metadata extraction, goexif is used otherwise
  • FFmpeg - for video thumbnail creation and extended image format support
  • djpeg (libjpeg-turbo) - optimized JPEG decoding for better performance

Installation

Core

  1. Install Go: https://go.dev/doc/install
  2. Install Node.js: https://nodejs.org/en/download/
  3. Install Task: go install github.com/go-task/task/v3/cmd/task@latest or https://taskfile.dev/installation/
  • Windows (scoop): scoop install watchexec exiftool ffmpeg libjpeg-turbo
  • macOS (brew): brew install watchexec exiftool ffmpeg libjpeg-turbo
  • Ubuntu/Debian: sudo apt install watchexec-cli exiftool ffmpeg libjpeg-turbo-progs
  • CentOS/RHEL/Fedora: sudo dnf install exiftool ffmpeg libjpeg-turbo-utils and watchexec install

Project Setup

  1. Clone the repository

    sh
    git clone https://github.com/smilyorg/photofield.git
    cd photofield
  2. Install dependencies (geo data, ui, docs)

    sh
    task deps

Running

Run both the API server and the UI server in separate terminals. They are set up to work with each other by default with the API server running at port 8080 and the UI server on port 5173.

  1. Start the API server with auto-reload

    sh
    task watch
  2. In a separate terminal, start the UI server

    sh
    task ui
  3. Open http://localhost:3000

Manual Commands

  1. Start the API server

    sh
    go run .
  2. In a separate terminal, start the UI server

    sh
    cd ui
    npm run dev
  3. Open http://localhost:5173

Migration from just

If you were previously using just, replace:

  • just watchtask watch
  • just buildtask build
  • just uitask ui

Run task to see all available commands.