Skip to content

Defacto2/server

Repository files navigation

Defacto2, website software

Go Reference License Go Report Card

      ·      ▒██▀ ▀       ▒██▀ ▀              ▀ ▀▒██             ▀ ▀███ ·
      : ▒██▀ ▓██ ▒██▀▀██▓ ▓██▀▀▒██▀▀███ ▒██▀▀██▓ ▓██▀ ▒██▀▀███ ▒██▀▀▀▀▀ :
 · ··─┼─▓██──███─▓██─▄███─███──▓██──███─▓██──────███──▓██──███─▓██──███─┼─·· ·
      │ ███▄▄██▓ ███▄▄▄▄▄▄██▓  ███▄ ███▄███▄▄███ ███▄▄███▄ ███▄███▄▄███ │
· ··──┼─────────··                defacto2.net               ··─────────┼──·· ·
      │                                                                 :

The Defacto2 website is a self-contained application first devised in 2023. It is built with the Go language and can be easily compiled for many platforms and operating systems.

All configurations are optional and any changes to the defaults are made through system environment variables.

About

Defacto2 is a digital archive of online history and artifacts from the Scene—a once global community of programmers, artists, and others who create releases. The platform preserves and showcases:

  • Demos and intros - Real-time computer graphics and music productions from the 1980s onward
  • Software artifacts - Utilities, and applications from various computer platforms
  • Artist profiles - Pages for individual sceners and groups (releasers) with their complete releases
  • File metadata - Searchable database of thousands of artifacts with credits, descriptions, and external links
  • Historical preservation - Links to related databases (Demozoo, Pouet, 16colors, expired websites, etc.)
  • Emulation support - Play period-accurate DOS intros and demos via DOSBox emulation
  • Media previews - View screenshots and download original files (when configured)

Note

The application uses an optional PostgreSQL database connection for data queries. While optional, you'll need this database running and configured if you wish to browse the artifacts, releasers, and sceners.

Architecture

Defacto2 is built as a full-stack application:

  • Backend: Go web server using the Echo framework
  • Database: PostgreSQL with type-safe queries via SQLBoiler ORM
  • Frontend: Server-rendered HTML templates with HTMX for interactivity
  • Assets: Node.js-based CSS/JS compilation and minification pipeline
  • Configuration: Entirely environment variable-based—no config files needed

The server is a single self-contained binary that embeds all static files, templates, and assets. It can optionally serve file downloads, image previews, and software emulation (DOS intros via DOSBox).

See the Location Guide for the project structure and the Source Setup guide for detailed architecture information.

Download

There are downloads available for Linux, macOS and Windows.

Installation

No installation is required to play around with the web server.

Note

The Defacto2.net service does not currently share artifact files, screenshots, and thumbnails due to hosting costs. When self-hosted with asset directories configured (via D2_DIR_DOWNLOAD, D2_DIR_PREVIEW, D2_DIR_THUMBNAIL environment variables), these features are fully functional.

Installation for the Debian Package

# download the latest release
$ wget https://github.com/Defacto2/server/releases/latest/download/defacto2-server_linux.deb

# install (or update) the package
$ sudo dpkg -i defacto2-server_linux.deb

# confirm the binary is executable
$ defacto2-server --version

Usage

The web server will run without any arguments and will be available on the localhost over port 1323.

$ defacto2-server

> ⇨ http server started on [::]:1323

To stop the server, press CTRL+C.

> Detected Ctrl + C, server will shutdown now

Development Setup

To build and develop the Defacto2 server locally, you'll need:

  • Go 1.25.5 or later
  • Task - Task runner for building and testing
  • Node.js / pnpm - For managing frontend dependencies

Quick start

# Clone the repository
$ git clone https://github.com/Defacto2/server.git
$ cd server

# Install development dependencies (one-time setup)
$ task _init

# Run the development server with live reload
$ task serve

Common development commands

task test       # Run all tests
task testr      # Run tests with race detection
task lint       # Format and lint all code
task binary     # Build a standalone binary

For more detailed development instructions, see the Source Setup guide.

Configuration

The application uses environment variables to configure the database connection and other settings. These are documented in the software package documentation.

There are examples of the environment variables in the example .env and the example .service files found in the init/ directory.

Documentation

For developers and contributors:

  • Source Setup - How to set up and build the project locally
  • Database Guide - PostgreSQL setup, troubleshooting, and schema information
  • Code Patterns - Go language patterns, SQLBoiler ORM examples, and development conventions
  • Location Guide - Project structure and file organization

About

The Defacto2 website software.

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •