Skip to content

Eisvana/Eisvana-Census

Repository files navigation

Eisvana-Census

Web app for all census-related things in Eisvana.

Project Setup

npm install

Compile and Hot-Reload for Development

npm run dev

Type-Check, Compile and Minify for Production

npm run build

How to Adapt for Other Civs

Note

If you want to use this for your own civ, you should be somewhat familiar with coding. You don't need to understand a lot, but you should be comfortable with Git and GitHub to some degree.

You should also have a Discord server in order to receive the census submissions and renewal requests.

Important

You should not do any of this on mobile. Use a computer of some kind.

First, you should fork the repo into your own account.

Things to Change

Site-Breaking Changes

In GitHub, open the repository settings, go to Secrets and variables -> Actions. You need to set 3 secrets:

  1. DISCORD_ANNOUNCEMENT_WEBHOOK: This should be a Discord webhook URL to the channel where an announcement will be posted on January 1st that the census has reset.
  2. DISCORD_FORM_WEBHOOK: This should be a Discord webhook URL to the channel where census form submissions will be sent to. Ideally, this should not be a public channel.
  3. DISCORD_RENEW_WEBHOOK: This should be a Discord webhook URL to the channel where census renewal requests will be sent to. Ideally, this should not be a public channel.

The first webhook is optional if you don't want any announcement, but the site won't function properly without the other two!

You can edit the code directly on GitHub by hitting . on your keyboard while on the main page of the repo.

Open the vite.config.ts file at the root of the project. Uncomment the base property, and set it to the name of your repo (should still be Eisvana-Census if you didn't change it when you forked it).

Go to the .github/workflows/announcements.yml file. You can adjust the sentences after the message=' to fit your liking. Your site will be deployed under <your-username>.github.io/<repo-name>.

Go into the public directory and delete the CNAME file. Otherwise the site cannot be deployed.

Go to src/variables/civilized.ts and set the variable to the name of your civ.

Go to src/variables/regiont.ts and change the keys (the left-hand side of the object) to the region glyphs of your civs, and the values (right-hand side) to the corresponding name of the region.

That should cover the inital setup.

Misc Changes

Use the search tab in the editor to search for Eisvana. Replace all ocurrences with your civ's name.

Use the search tab again to search for Lenni. Don't change the name in the .yml files, that will break the build process! Change the name in all other files to the one of your civ's census manager.

Open the .html files at the root of the project. Search for keywords. Edit the individual keywords accordingly to fit your civ.

Replace the favicon icons in the public directory. You can search online for "favicon generator" for tools for generating them.

Deploying the Page

Commit and push your changes to GitHub by clicking on the "Source Control" tab in the editor, specifying a commit message and then clicking "Commit and Push".

Go back to the GitHub repo itself (not the code editor).

Go to the repository settings and navigate to the Pages tab.

Under Branch, select gh-pages and click Save.

If you click on the Actions tab, you should be able to see your site being built and deployed.

It should now be available under <your-username>.github.io/<repo-name>.

When Problems Arise

You can find me (Lenni) in the Eisvana Discord server. Just send me a message and I'll take a look :)