Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Eggrror404/tnfshcec-web

 
 

Repository files navigation

tnfshcec-web

Demo prerendered site running at https://eggrror404.github.io/tnfshcec-web

How to build

Using Docker Compose

Using docker-compose will be the easier way to build the web server.

  1. git clone this repository, then cd into it.
  2. Copy .env.example to .env and follow the instructions. This sets up all the necessary settings for the app.
  3. Run docker compose up and Docker should take care of the rest.

The default SvelteKit server is only http, which means authentication would not work as it needs https. Using a reverse proxy can probably be the fix for now.

Manually building

  1. Make sure Node.js and npm are installed.
  2. git clone this repository, then cd into it.
  3. Run npm install to install dependencies.
  4. Create file .env from .env.example and follow the instructions.
  5. npm run build to build the server.
  6. npm run preview to run the server you just built.
    • npm run dev to run the development server.
    • node build will start a NodeJS server built, currently unable to handle https.

Usage

The post system

Posts are stored in the cec/ folder, as markdown files. The server reads the file everytime it's requested, and offers adding, editing, and deleting posts for admin users.

Post route in the url is directly mapped to the filesystem, eg:

https://<domain>/post/path/to/post -> cec/path/to/post.md

Prerender

Prerendering is enabled through the PRERENDER environment variable.

Note that AUTH_SECRET and AUTH_TRUST_HOST variables needs to be set for Auth.js to load correctly. (Even though auth doesn't work with prerendering.)

Currently prerender is set up with Github Actions, to build on push events.

Releases

No releases published

Packages

No packages published

Languages

  • Svelte 47.7%
  • TypeScript 27.0%
  • CSS 17.7%
  • JavaScript 6.4%
  • Other 1.2%