Skip to content

ISAG-Lab/Secure-First-Infinity-Unified

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Secure First Infinity Unified

A web application and discord bot to facilitate in hosting of the Secure First yearly event.

This is a SvelteKit project, for project structure refer to SvelteKit project structure

Running the Development Server

Installing Dependencies

This project uses the pnpm package manager, to install dependencies use the command pnpm install

Configuration

Some configuration values may need to be updated to your development environment, please refer to the Configuration section.

Applying Database Migration

When running on a development server database migrations are not automatically applied. You have 2 choices on how to apply them.

  1. pnpm run db:push to apply current schema from the code directly to the database. This is the intended development flow.
  2. pnpm run db:migrate to apply current migration from migration files to the database. This is the same way that production servers will apply migrations.

Starting the Development Server

Use the command pnpm run dev to start the development server which will reload automatically when a file change is detected.

You can also use pnpm run build and then pnpm run preview commands to start the development server using production code.

Deployment

After updating the configuration, use docker compose up -d --build to start the application using docker. Database migrations are automatically applied.

Generating Database Migration

After changes to the schema during development, new database migration needs to be generated using the pnpm run db:generate command. This will read previous migrations and current schema and generate appropriate migration files that will be applied to production servers.

Configuration

.env

File location: <project>/.env

This file contains most of the configuration that may need to be changed from year to year. For configurable values and their example refer to .env.example

You can also set the environment variables directly instead of using .env file by modifying docker-compose.yml

Note: This application be deployed to both TCP and unix socket. If using unix socket, you'll have to remove HOST and PORT variables from the environment. SvelteKit node adapter should prioritize SOCKET_PATH but this doesn't seem to be true in practice.

File location: <project>/src/lib/config.ts

This file mostly loads the configuration values from .env file and parses them but static values here are also configurable.

File location: <project>/docker-compose.yml

This file contains instruction for the docker compose deployment command. Refer to compose file reference for more information.

File location: <project>/nginx.conf

This file is not part of the project configuration but is an example configuration for nginx reverse proxy which is how this application is intended to be deployed behind.

About

Web and Discord utility for secure first event. All in one repository and easily reused.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published