pREST is a production-grade Go HTTP server that automatically exposes PostgreSQL databases as RESTful and MCP (Model Context Protocol) APIs without requiring hand-written backend code. It provides instant CRUD endpoints for any table, custom SQL template execution with parameterized queries, and a built-in Studio web UI for exploring and managing APIs. The system is architected around a hexagonal pattern with a clean adapter interface supporting multiple databases (PostgreSQL, TimescaleDB), dependency injection for controllers, and a layered middleware stack for authentication (JWT), authorization (table/field-level ACL), caching, and CORS. Security is a primary concern: SQL injection is mitigated through strict identifier validation, template parameter screening, and bound parameter binding, while credential leakage in logs is prevented by a dedicated redaction package. The codebase is well-tested with both unit tests (using sqlmock) and integration tests (against real PostgreSQL in Docker), and includes OpenTelemetry integration for observability. It is not a data research or analytics project; it is a pure application for building low-code database APIs.
ListenBrainz Server is the backend and frontend for ListenBrainz, an open-source music listening history platform operated by the MetaBrainz Foundation. In production it ingests listening events from multiple sources (Spotify, Last.fm, Libre.fm, Maloja, file uploads, and direct API submissions), stores them in TimescaleDB, enriches them with MusicBrainz identifiers via an MBID mapping pipeline, and exposes them through a public REST API, a Last.fm-compatible API, WebSocket streams, and a React single-page application. The system also computes per-user and site-wide statistics, artist/recording/user similarity, collaborative-filtering recommendations, and annual 'Year in Music' summaries using Apache Spark batch jobs orchestrated through RabbitMQ and HDFS. The architecture is a hybrid of a traditional Flask web application and a set of background data-processing services. The main web server handles user authentication, API endpoints, playlist management, social features, and page rendering, while separate workers consume RabbitMQ queues for timescale writes, Spark job requests, metadata cache crawling (Spotify, Apple Music, SoundCloud, Internet Archive), and background imports/exports. The frontend is a large TypeScript/React application with React Router, TanStack Query, Jotai state, and a custom multi-source audio player called BrainzPlayer. Although the repository is primarily an application, it contains substantial data-engineering machinery—Spark incremental stats engines, dump generation/import, MBID canonicalization, and similarity algorithms—making it a genuinely hybrid codebase with the application character dominant. The codebase is well-structured for its size: it has clear module boundaries, abstract base classes for importers and OAuth services, a reusable incremental stats query-provider pattern, and extensive unit and integration tests. However, it also carries significant complexity and technical debt: multiple database backends, duplicated SQL across Spark entity stats, legacy compatibility endpoints, hardcoded external URLs, and some skipped or heavily mocked tests. The project is actively maintained, with a steady stream of schema migrations and feature additions through 2026.