Skip to main content

First Run

Clone Repo

git clone https://github.com/webinex/starter-kit

First Run

  1. Ask Azure administrator for Service Bus connection string and topic name
    Set them in: src/StarterKit/StarterKit.App.Api/appsettings.Personal.json
    src/StarterKit/StarterKit.Identity/appsettings.Personal.json

    {
    "ConnectionStrings": {
    "ServiceBus": "<your-service-bus-connection-string>"
    },
    "Cap": {
    "TopicPath": "<your cap topic name>"
    }
    }
  2. Ask team lead for SendGrid access key
    Set it in: src/StarterKit/StarterKit.Identity/appsettings.Personal.json

    {
    "SendGrid": {
    "Key": "<your-sendgrid-key>"
    }
    }
  3. Create attachments folder
    Create D://starter-kit-attachments folder or override attachments folder with src/StarterKit/StarterKit.App.Api/appsettings.Personal.json

    {
    "Attachments": {
    "BasePath": "<your-fully-qualified-path-to-attachments-folder>"
    }
    }
  4. Create starter-kit database
    If you'd like to use another database, you need to add appsettings.Personal.json files in:

    src/StarterKit/StarterKit.App.Api src/StarterKit/StarterKit.App.Migrations src/StarterKit/StarterKit.Identity src/StarterKit/StarterKit.Identity.Migrations

    with:

    {
    "ConnectionStrings": {
    "Default": "<your-connection-string>"
    }
    }
  5. Apply migrations
    Go to src/StarterKit/StarterKit.App.Migrations and run dotnet run -- migrate
    Go to src/StarterKit/StarterKit.Identity.Migrations and run dotnet run -- migrate

  6. Setup SQL Server distributed cache
    dotnet tool install --global dotnet-sql-cache
    dotnet sql-cache create "Data Source=localhost;Initial Catalog=starter-kit;Integrated Security=True;" dbo DistributedCache

  7. Run projects
    Open src/StarterKit/StarterKit.sln and run projects StarterKit.Identity and StarterKit.App.Api Open src/StarterKit/StarterKit.App.Api/ClientApp and run yarn install && yarn start

  8. Sign Up
    Open http://localhost:3000/sign-up and finish registration. Follow instructions in email

  9. Give existing users admin permissions

    declare @roleId uniqueidentifier = NEWID();

    insert into Roles
    values (@roleId, 'Admin');

    insert into RolePermissions
    values (@roleId, 'users.read'),
    (@roleId, 'users.write'),
    (@roleId, 'roles.read'),
    (@roleId, 'roles.update'),
    (@roleId, 'roles.create'),
    (@roleId, 'roles.delete');

    insert into RoleUsers (RoleId, UserId)
    select @roleId, Id
    from Users