Files
dotcom-arcade/backend
Darkraise 3e35799de8 fix: standardize imports, tighten types, and align
mock data with actual API contracts

- Normalize all `cn` imports to `@/lib/utils` across
  30+ UI and component files
- Replace relative imports with `@/` alias in auth,
  roles, users, stats, and layout components
- Remove redundant `as` type assertions in playlist
  routes (Zod parse already returns typed data)
- Replace `any` with proper types in FallbackCache,
  mock handlers, and validateIcons
- Use `type` import for type-only imports
- Add type-safe `.filter(Boolean)` with type guard
  in Sidebar nav item arrays
- Update MSW mock data to match actual API shape:
  numeric IDs, `role` field, HTTP-only cookie auth,
  paginated response format, and settings schema
- Add JSDoc to AuthTokens clarifying cookie-based
  token storage
- Replace console.* calls with logger in icon
  validation
- Ignore SQLite WAL files in .gitignore
2026-02-10 20:42:56 +07:00
..
2026-01-16 23:58:21 +07:00
2026-01-16 23:58:21 +07:00
2026-01-16 23:58:21 +07:00

Flashpoint Web Backend

Node.js/Express API server for the Flashpoint Archive web application.

Features

  • RESTful API for game metadata
  • Direct SQLite database access (read-only)
  • Integrated game content serving (proxy + ZIP)
  • Image and logo serving
  • Playlist management
  • Platform and tag endpoints

Quick Start

# Install dependencies
npm install

# Configure environment
cp .env.example .env

# Start development server
npm run dev

Server runs on http://localhost:3100

API Endpoints

See ../../api-specification.md for complete API documentation.

Core Endpoints

  • GET /health - Health check
  • GET /api/games - List games
  • GET /api/games/:id - Get game details
  • GET /api/platforms - List platforms
  • GET /api/tags - List tags
  • GET /api/playlists - List playlists

Architecture

src/
├── routes/          # Express route handlers
├── services/        # Business logic layer
├── game/            # Integrated game service (proxy, ZIP, CGI)
├── middleware/      # Express middleware
├── utils/           # Helper functions
├── config.ts        # Configuration management
└── server.ts        # Application entry point

Database

Uses sql.js (pure JavaScript SQLite) for direct read-only access to:

  • D:\Flashpoint\Data\flashpoint.sqlite

No native compilation required! sql.js is a WebAssembly-based SQLite implementation that works without Visual Studio or build tools.

Schema includes tables for games, platforms, tags, and more.

Development

npm run dev        # Start with hot reload (tsx)
npm run build      # Compile TypeScript
npm run start      # Run compiled version
npm run typecheck  # Type checking only
npm run lint       # ESLint

Environment Variables

Required:

  • FLASHPOINT_PATH - Path to Flashpoint installation
  • FLASHPOINT_DB_PATH - Path to SQLite database

Optional:

  • PORT - Server port (default: 3100)
  • NODE_ENV - Environment (development/production)
  • DOMAIN - Frontend origin (default: http://localhost:5173)

See .env.example for all options.