Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

azure-mud

> 编程语言
Open source

Yet Another Browser Mud [](https://portal.azure.com#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FRoguelike-Celeb…

197 stars0 likes0 views
WebsiteGitHub

About

Yet Another Browser Mud [](https://portal.azure.com#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FRoguelike-Celeb…

Yet Another Browser Mud

This is a playful text-based online social chat space. You can think of it as a hybrid between communication apps like Slack and Discord and traditional text-based online game spaces such as MUDs and MOOs.

It was primarily built for Roguelike Celebration 2020, but can hopefully be repurposed for other events or communities.

On the backend, it's powered by a serverless system made up of Azure Functions, Azure SignalR Service, and a Redis instance (currently provided by Azure Cache for Redis), plus Google Firebase for authentication.

On the frontend, it's a rich single-page webapp built in TypeScript and React, using the Flux architecture via the useContext React hook.

This article provides some insight into the design principles underlying this project.

Setting up a development environment

In context of Roguelike Celebration, we think of this project as being composed of three different parts: the frontend, the backend, and the content.

  • To contribute to the frontend, you can just follow the "frontend dev" instructions.
  • To contribute to the backend, you will need to set up your own backend dev instance (the full set of instructions below).
  • To contribute to content, you do not need to do local developer setup. Ask a friendly volunteer how to get you set up with the browser-based CMS.

Content Dev

There is a browser-based "level editor" / CMS located at /admin/index.html for a valid instance (e.g. https://chat.roguelike.club/admin/index.html). To access the CMS, you will need to be an admin in that instance. Ask an existing admin, or see instructions at the end of this README if you're setting up your own instance.

There's no public docs yet for this editor tool, but hopefully it should be relatively self-explanatory given an understanding of our room format (which I think also sadly isn't documented, but will look familiar to those who have used Twine).

Frontend Dev

  1. Clone this repo.

  2. Run npm install.

  3. npm run dev will start a local development environment (at http://localhost:1234/index.html by default). It auto-watches changes to HTML, CSS, and JS/TS code, and attempts to live-reload any connected browser instances.

  4. npm run build will generate a bundled version of the webapp for distribution.

  5. Do note that your frontend installation will not work until you have properly set up Firebase authentication and pointed it at a valid server backend (all via a .env file locally, or via GitHub repository secrets if you're deploying via our GH Actions workflows). If you are on the Roguelike Celebration organizing team, get in touch with us and we can give you credentials for an existing server instance (either staging/prod or dev, as appropriate). Otherwise, you will need a valid backend as well as API keys for a valid Firebase authentication account (see next section for setup).

This repo is set up to automatically deploy to Azure Static Web Apps when code is merged into main. (See "Deploying New Changes via GitHub Actions" below for how to finish configuring that for your fork.) If you want to host your frontend elsewhere, that's totally fine too! You can serve the asset bundle generated by npm run build anywhere, although it will need the correct secrets injected and also must be served over SSL/HTTPS.

Backend Dev

After cloning this repo, the server directory contains all of the backend code. You may want to run npm install within the server directory to pull in dependencies for IDE autocompletion and such.

However, you cannot actually run the backend locally. You'll need to deploy your own server instance of the backend to test changes.

Deploying This Project

Currently, this project only runs on Azure. This requires your own Azure subscription.

If you don't already have an Azure account/subscription, you'll get a few hundred bucks of credits to use your first month, but if that's not the case you will want to keep an eye on the fact that running this backend will cost you actual money.

If you are a Roguelike Celebration volunteer: I apologize if this looks extremely daunting! I promise it's not a lot of work – it 90% consists of "click a link to automatically deploy a bunch of Azure stuff, then shuffle around some secret keys into GitHub Actions and a local .env file, then make a single Firebase config change".

Deploying via ARM Template

The easiest way to deploy a backend is to use the template we have prepared. Going to this link will allow you to deploy a server backend to an Azure resource group you specify that will have everything configured, but won't actually contain code yet.

As a prerequisite, you will need the resource provider for Application Insights registered for your Azure subscription. The ARM template does not do this part for you. To register it, in the Azure Portal, go to Subscriptions and select your subscription. Then select Settings > Resource providers, find Microsoft.OperationalInsights in the provider list, select it, and click the Register button at the top of the list. You may also need to do the same for Microsoft.AlertsManagement, or you may have deployment failures for "failure anomalies smart detector alert rule" resources.

This ARM template asks you to plug in a GitHub Personal Access Token (PAT), which you can generate by going to while logged into GitHub. You want to create a "classic" token, with access to all "repo" and "workflow" permissions. I recommend making it short-lived (e.g., only valid for 7 days), as you will not need it after initial deployment.

Note: You must use a resource group that is in a region that supports Azure Static Web Apps, and most regions don't. This ARM template deploys things to the region that your selected resource group is in, and ignores the Region field. Only a few Azure regions support ASWA. Currently, those are Central US, East Asia, East US 2, West Europe, and West US 2. If your resource group isn't in one of those regions, you'll get a validation failure when trying to deploy from the ARM template.

After completing ARM template deployment, there are still a few things you need to manually configure before the app will function.

Adding WebPubSub

You need to add the proper connection string to your functions app. This should probably be in the template, but for now, follow these steps:

  1. Go into your WebPubSub resource in the Azure portal and get the connection string from WebPubSub service "Keys" on the left.
  2. Go to your functions app in the Azure portal and hit "Settings" -> "Environment variables" -> "App settings".
  3. Add a new key with name "WebPubSubConnectionString" and the string from step 1 as its value.
  4. Hit Apply and Confirm.

Deployment: If you're a Roguelike Celebration volunteer

If you are a volunteer working on the core Roguelike Celebration space, you can use our development Firebase account. If you do not plan to deploy your frontend anywhere (i.e., you will just access it at localhost), you do not need to do steps beyond 2.

  1. In the shared password manager, find the entry for "Dev Firebase".
  2. In your GitHub repo, add Repository Secrets (Settings -> Security -> Secrets and variables -> Actions -> New repository secret) containing each field from the password manager entry. You should name these Secrets FIREBASE_API_KEY, FIREBASE_AUTH_DOMAIN, FIREBASE_PROJECT_ID, FIREBASE_STORAGE_BUCKET, FIREBASE_MESSAGING_SENDER_ID, FIREBASE_APP_ID, and FIREBASE_SERVER_JSON, the latter of which should contain the entire text of the attached JSON file.
  3. If you'd like to test your frontend locally via localhost, you need to add this locally via a .env file. In a local copy of the repo, copy .env.sample to .env and replace the dummy values with the appropriate real data.
  4. Go to the Firebase Console (), logging in as the shared account.
  5. Create one more GitHub Actions repository secret, called SERVER_HOSTNAME, containing the URL to your own Function App instance (the Azure URL for your backend – typically https://your-project.azurewebsite.net, where your-project is the project name you entered when deploying the Azure ARM template). Do the same thing to your local .env file as appropriate.
  6. Since you're using the shared dev Firebase account, you'll need to tell Firebase to allow your publicly-hosted dev frontend. Log into Firebase as the shared account, and select the "Roguelike Celebration dev" project.
  7. Select "Build" and then "Authentication" from the left-side menu, then "Settings" and "Authorized domains" from the main pane.
  8. Click "Add domain", enter the domain where your deployed dev frontend will live, and click "Add". If you set up a custom domain, use that. If you don't know what this URL is, go to the Azure Portal, find the Static Web Apps instance in your project's resource group, and enter the URL it gives you. It's usually something along the lines of https://[adjective]-[noun]-[hexadecimal numbers].azurestaticapps.net.

From here, you will still need to deploy your backend server code, and likely deploy your frontend to the public web as well. Jump down to "Deploying New Changes via GitHub Actions" to continue setting up automatic deployments on git push.

Deployment: Setting up your own non-Roguelike Celebration instance

  1. You will need to set up Firebase. This is a bit annoying.
    1. Create a new Firebase project.
      1. To do this, follow steps 1, 3, and 5 in the setup guide here: . Make sure the title is appropriate for display, since by default that's what will go in the confirmation emails.
    2. Register your app with the Firebase project you just created.
      1. To do this, follow steps 1-3 here: .
    3. Set up the client.
      1. Go to the General tab in the Settings section for your new project.
      2. In your GitHub repo, add repository Secrets (Settings -> Secrets -> New Repository Secret) for all of the values set in the firebaseConfig object of the JS config snippet. You should have Secrets titled FIREBASE_API_KEY, FIREBASE_AUTH_DOMAIN, FIREBASE_PROJECT_ID, FIREBASE_STORAGE_BUCKET, FIREBASE_MESSAGING_SENDER_ID, and FIREBASE_APP_ID.
      3. By default, these secrets will be injected into your webapp when GitHub Actions builds and deploys your frontend, but that means they won't work if you're running a local dev server. To enable Firebase login on your local dev server, copy the .env.sample file to one named .env, and then replace the fake sample values for each key with the appropriate actual values you also stored as GitHub Secrets.
    4. Set up the server.
      1. Generate and download a private key file for your new project as instructed here:
      2. Create a new GitHub repository Secret (Settings -> Secrets -> New Repository Secret) whose key is FIREBASE_SERVER_JSON and whose value is the entire text of the downloaded JSON private key file.
      3. You may also want to move the downloaded JSON file to server/firebase-admin.json. This file will by default not be tracked by git (and we don't recommend you commit it), but you will need this file to be present if you wish to deploy the backend via CLI or VS Code instead of GitHub Actions. (See "Deploying new Changes" sections below.)
    5. Enable authentication providers.
      1. Go to the Firebase console -> Authentication -> Sign-in method and enable the providers as desired (we currently support email a

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言