Mods Space Server
Mods Space is Alia's package distribution center; clients publish and install packages through the alia command.
Client Workflow
alia space http://your-space-host/ # set the space address
alia login # register, then log in
alia publish # publish the current project
alia install foo@1.2.0 # install a package
alia add foo@latest # add a project dependency
Published projects are packaged as ZIP files named <name>@<version>.aliam, and clients download them via GET /api/mods/<name>@<version>.aliam.
Self-Hosted Deployment
The server (ModServer) is a standalone project (https://git.0832.ink/Alia/ModSpace.git); see the repository's README.md for deployment instructions:
git clone https://git.0832.ink/Alia/ModSpace.git
cd ModSpace/server
npm install
npm start
Environment Variables
| Variable | Default | Description |
|---|---|---|
PORT | 3000 | Listening port |
ALIA_SPACE_DATA | server/data | Data directory (users.json, registry.json, mods/, secret, extracted/) |
ALIA_SPACE_SECRET | auto-generated | JWT signing key |
API Endpoints
| Method | Path | Description |
|---|---|---|
POST | /api/register | Register a user ({ username, password }) |
POST | /api/login | Log in, returns a JWT |
POST | /api/logout | Log out |
POST | /api/publish | Publish a package (multipart file, requires Authorization: Bearer <token>) |
GET | /api/mods/:name/latest | Query the latest version number |
GET | /api/mods/:name@:version.aliam | Download a specific version |
GET | /api/mods | Mod list, with optional ?q=<keyword> (matches name/description/tags) and `?sort=updated |
GET | /api/mods/:name | Single mod details (all versions and metadata) |
GET | /api/mods/:name/versions | Version list |
GET | /api/mods/:name/readme?version= | README content (defaults to the latest version) |
GET | /api/mods/:name/files?version= | In-package file tree [{ path, type, size }] |
GET | /api/mods/:name/file?version=&path= | Single file content (path supports dot-prefixed relative paths) |
GET | /api/mods/:name/dependencies?version= | Dependency table for a given version { name: version } |
User data is persisted in <data>/users.json, published packages are stored in <data>/mods/, and unpacked contents are stored in <data>/extracted/<name>@<version>/ (read by the README/docs/file browsing endpoints).
Metadata Registry
At publish time the server unpacks the .aliam, reads config.json (name/version/dependencies plus optional author/description/tags/homepage), and generates the mod metadata:
{
"name": "demo-lib",
"version": "1.0.0",
"author": "alice",
"description": "Mod description",
"tags": ["http", "tools"],
"homepage": "https://example.com",
"dependencies": {
"base-lib": "2.0.0"
}
}
The metadata (including author, publishedAt, each version, and download statistics) is persisted in <data>/registry.json and used by the /api/mods endpoints and the web portal. The README.md and docs/ directory inside the package are displayed on the portal's detail page under the "Description" and "Docs" tabs.