# vbytes-lan-registration Micro Service For Registering For An Event ## TECH STACK ### FrontEnd - React - ShadCN ### BackEnd - .NET API Controllers - Dapper #### Design - GET Is Already Registered -- Local Database - GET Is Member -- Auth API - POST Register Member For Event -- Main Database ### Database - Postgres ## Configuration Sensitive values are never stored in source control. Configure them via [user secrets](https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets) (development) or environment variables (production). Key-only examples are available here: - `src/Registration/Registration.API/appsettings.example.json` - `src/Auth/AuthAPI/appsettings.example.json` - `src/Web/lan-frontend/.env.example` ### Frontend (Next.js) Run from `src/Web/lan-frontend`: ```bash cp .env.example .env.local ``` Set the backend API base URL in `.env.local`: ```env REGISTRATION_API_URL=http://localhost:5063 ``` ### Registration.API Run from `src/Registration/Registration.API`: ```bash dotnet user-secrets set "VbytesRelay:ApiKey" "" dotnet user-secrets set "VbytesRelay:ClientCertificatePfxPath" ".pfx" dotnet user-secrets set "VbytesRelay:ParticipantRegisterPath" "/api/participant" dotnet user-secrets set "Security:SsnPepper" "" ``` | Key | Description | | -------------------------------------- | ------------------------------------------------------------------------------------- | | `VbytesRelay:ApiKey` | API key for the Vbytes relay service | | `VbytesRelay:ClientCertificatePfxPath` | Absolute path to the client certificate `.pfx` file | | `VbytesRelay:ParticipantRegisterPath` | Path for the participant registration endpoint on the relay (e.g. `/api/participant`) | | `Security:SsnPepper` | Pepper value used when hashing SSNs | For non-development environments, ensure these environment variables are set: ```bash ConnectionStrings__DefaultConnection= Security__SsnPepper= VbytesRelay__BaseUrl=https://api.lan.vbytes.se VbytesRelay__ParticipantRegisterPath=/api/participant VbytesRelay__VolunteerRegisterPath=/api/volunteer VbytesRelay__ApiKeyHeaderName=X-Api-Key VbytesRelay__ApiKey= VbytesRelay__ClientCertificatePfxPath=.pfx AuthApi__BaseUrl= AuthApi__ValidatePath=/validate ``` > **Note:** ASP.NET Core's configuration priority is `appsettings.json` → `appsettings.Development.json` → **user secrets** → **environment variables**. Environment variables always win, so any value set in `launchSettings.json` will override user secrets. Secret values (`ApiKey`, cert paths, relay paths) are intentionally absent from `launchSettings.json` to ensure user secrets are respected. ### AuthAPI Run from `src/Auth/AuthAPI`: ```bash dotnet user-secrets set "EnvironmentVariables:ApiUrl" "" dotnet user-secrets set "EnvironmentVariables:ApiKey" "" dotnet user-secrets set "EnvironmentVariables:AssociationNumber" "" ``` | Key | Description | | ---------------------------------------- | ------------------------------------------ | | `EnvironmentVariables:ApiUrl` | Base URL of the member validation API | | `EnvironmentVariables:ApiKey` | API key for the member validation API | | `EnvironmentVariables:AssociationNumber` | Association number used for member lookups | For non-development environments, ensure these environment variables are set: ```bash EnvironmentVariables__ApiUrl= EnvironmentVariables__ApiKey= EnvironmentVariables__AssociationNumber= ``` For frontend production configuration, set: ```bash REGISTRATION_API_URL= ```