This repository was archived by the owner on Sep 30, 2025. It is now read-only.
Add SQLite database backend with REST API for locations and characters#35
Closed
Add SQLite database backend with REST API for locations and characters#35
Conversation
Copilot
AI
changed the title
[WIP] Add SQLite DB with list and item queries for locations and characters
Add SQLite database backend with REST API for locations and characters
Aug 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements a complete SQLite database integration for the Armchair dialogue editor, adding persistent storage for locations and characters with a RESTful API backend.
Problem Statement
The application previously stored all data in memory using Re-frame state management with only file-based import/export capabilities. This limited data persistence and made it difficult to manage larger datasets or provide multi-user access to shared game data.
Solution Overview
Added a Node.js Express backend with SQLite database that provides REST API endpoints for locations and characters, while preserving the existing ClojureScript frontend architecture.
Backend Implementation
locations: id, display_name, bounds, sprite layers, blocked positions, placements, connection triggerscharacters: id, display_name, color, sprite file and coordinatesGET /api/locations- Retrieve all locationsGET /api/locations/:id- Retrieve specific location by IDGET /api/characters- Retrieve all charactersGET /api/characters/:id- Retrieve specific character by IDGET /api/health- Server health checkFrontend Integration
src/cljs/armchair/api.cljs) using fetch with async/await patternsKey Features
npm run devstarts both frontend and backendDatabase Schema
The SQLite schema supports the full complexity of the existing data models:
Usage
The "Database View" menu item provides access to the new interface showing real-time data from the SQLite backend.
This implementation provides a solid foundation for data persistence while maintaining the existing editor functionality and user experience.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
repo.clojars.orgIf you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.