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
This project uses the pnpm package manager, to install dependencies use the command pnpm install
Some configuration values may need to be updated to your development environment, please refer to the Configuration section.
When running on a development server database migrations are not automatically applied. You have 2 choices on how to apply them.
pnpm run db:pushto apply current schema from the code directly to the database. This is the intended development flow.pnpm run db:migrateto apply current migration from migration files to the database. This is the same way that production servers will apply migrations.
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.
After updating the configuration, use docker compose up -d --build to start the application using docker. Database migrations are automatically applied.
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.
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.