froom api/backend
Find a file
2026-08-24 17:41:12 -06:00
.config initi identity db 2026-07-31 11:32:34 -06:00
.vscode init 2026-07-31 10:37:34 -06:00
src check blocks exist before updating room 2026-08-24 17:41:12 -06:00
.editorconfig init 2026-07-31 10:37:34 -06:00
.gitignore init 2026-07-31 10:37:34 -06:00
docker-compose.yml init 2026-07-31 10:37:34 -06:00
openapi-client-config.json open api 2026-08-01 15:35:48 -06:00
README.md open api 2026-08-01 15:35:48 -06:00

Froom

Setup

Ensure you have the following installed:

Local dev

  1. Clone this repo to your local machine and cd src

  2. Copy the appsettings.Template.json to development file:

    cp appsettings.Template.json appsettings.Development.json
    
  3. Install local dotnet tools (e.g. dotnet ef):

    dotnet tool restore
    
  4. Next, run any necessary migrations:

    dotnet ef database update
    

    Note

    If this is an initial setup, the first time you run migrations you may see an error logged regarding the "EFMigrationsHistory" table. This is because it attempted to read from that table but it doesn't exist yet. This is expected, and the migrations should still proceed and complete successfully.

  5. Start the API server in watch mode:

    dotnet watch run
    
    • This will restart the web server whenever file changes are detected. Certain changes, like modifying server config, will require a full rebuild which you can run without interrupting watch by pressing Ctrl+R.
  6. After the API is running, you should be able to access local swagger API explorer: http://localhost:5125/swagger/index.html

Migrations

Running migrations

To apply migrations, make sure your local postgres instance is running and run the following command:

dotnet ef database update 
```****

### Rollback migrations

To rollback migrations, target the migration you wish to rollback to as the latest:

```bash
dotnet ef database update {nameOfMigrationToRollbackTo}

This next command will remove all migrations that are pending:

dotnet ef migrations remove 

Creating a migration

When you add or modify entity properties, names, etc. you can generate a migration by running the following from the src directory:

dotnet ef migrations add NameOfTheMigration 

The migration files will be generated in the Migrations folder, where you should inspect the generated code to ensure the migration was created as expected.

Client SDK

Working with the SDK locally

  1. Make sure the API project is running, and from the project root pull the latest swagger.json:

    wget -O openapi.json http://localhost:5125/openapi/froom.json
    
  2. Run the openapitools cli to generate the sdk, and then install dependencies and build:

    rm -r sdk || true && docker run --user 1000:1000 -v "$PWD:/app" -w /app openapitools/openapi-generator-cli:latest-release /usr/local/bin/docker-entrypoint.sh generate -i openapi.json -g typescript-fetch -o sdk -c openapi-client-config.json && cd ./sdk && npm install && npm link && cd ../
    
  3. Consume the linked package in the frontend project.

    npm link @unfrl/froom-sdk