TODO:
- Check if the project works 😅
A blueprint for a new SKO project.
Some changes are required before you can use it!
See later in the readme
The blueprint provides the following features
- A backend with the following layers
- Database
- Repository
- Service (can be merged with the repository layer depending on the project size)
- API
- Authentication
- Permissions
- Postgres DB
- Redis
- Minio
If a feature is not needed then simply remove all references to it.
- Copy the repository to your new project.
- Grep in the entire blueprint for the keyword 'blueprint'. Change every instance to your new project name.
- Install the githooks (optional) with
git config --local core.hooksPath .githooks/
. - Setup infisical.
- Install the CLI.
- Inside
~\.bashrc
(or equivalents) add the following lineexport INFISICAL_API_URL=https://secrets.it.studentkickoff.be
. - Login to infisical with
infisical login
.
- Setup your project in coolify:
- The following resources are required:
- A docker registry server that pulls from
registry.studentkickoff.be/{project_name}
- A Postgres instance
- A Redis instance
- Change every instance of
<projectId>
to your newly created project
- Setup your project in the secrets website.
- Go to the secrets website.
- Add new project (choose the prod-dev template).
- Infisical doesn't give everyone access to the project automatically. Give the rest of team software access in the access control menu.
- Set the following secrets:
- For development:
AUTH_MSENTRA_CLIENT_SECRET
&AUTH_MSENTRA_CLIENT_ID
: A rotating azure secret.AUTH_MSENTRA_TENANT_ID
: Azure tenant id.AUTH_SKO_CLIENT_SECRET
: Add your new project to the Auth seeds and set the client secret.
- For production:
AUTH_MSENTRA_CLIENT_SECRET
&AUTH_MSENTRA_CLIENT_ID
: A rotating azure secret.AUTH_MSENTRA_CALLBACK_URL
: Production callback url after logging in. Usually something likehttps://{project_name}.studentkickoff.be/api/auth/callback/azureadv2
.AUTH_MSENTRA_TENANT_ID
: Azure tenant id.APP_DSN
(only production): The sentry DNS link. You can get this by creating a new sentry project.AUTH_REDIRECT_URL
: Redirect url after a login.AUTH_SKO_CLIENT_SECRET
: Create the project in the Auth UI and set the client secret.DB_HOST
: Host of the db. Retrievable from coolify when creating a postgres instance.DB_PASSWORD
: Password of the db. Can be found inside coolify.MINIO_BUCKET
: Minio bucket. Everything minio related can be configured in the Garage uiMINIO_ENDPOINT
: Minio endpoint, usuallys3.studentkickoff.be
.MINIO_PASSWORD
: Minio password.MINIO_SECURE
: If the connection to minio is secure, usuallytrue
.MINIO_USERNAME
: Minio username.REDIS_URL
: The redis connection url. Retrievable from coolify when creating a redis instance.
- Install all the required tools. The version can be found inside the asdf file.
- Download the required tools and packages with
make setup
. - Migrate the database
make migrate
. - Run the project
make watch
. - You should be able to navigate to the frontend and log in.
- Update this readme to contain relevant information about your project!