ChangeAhead are an organisation that connects people in a vulnerable state with opportunities to get help and be empowered. One of the ways they do this is matching landlords with empty properties with people in need of housing assistance. The Bricks & Hearts project is a web platform to facilitate this. It currently consists of a landlord portal and an admin portal.
A landlord is able to:
- sign up for an account, providing some basic information and answering questions about their properties
- log in and view a dashboard
- view and edit their personal information
- view their properties and add, edit, and remove them
A system admin can:
- log in and view a dashboard
- view all properties for all landlords and add/edit/remove them
- view all landlords and their information and add/edit/remove them
- view all admins and approve/reject requests for admin rights
- import tenant data from a CSV file
- suggest suitable applicants for a given property
- C# on .NET Core 6 with the ASP.NET Core MVC framework
- MSSQL database and Entity Framework Core 6
We also use the following APIs:
The staging and production sites are hosted on Microsoft Azure, and GitHub Actions is used for CI/CD.
- .NET 6 SDK
- SQL Server (Developer version)
- Download and install the requirements above.
- Clone the repository into a sensible location on your machine, and check out the
main
branch.git clone [email protected]:Change-Ahead/bricks-and-hearts.git git checkout main
- You should have access to a collection of 'secrets' (login details, API keys, etc.) for the Bricks & Hearts project.
Find the
appsettings.Development.json
file and put it into theweb
folder. - Edit the file and change the
ToAddress
in theEmail
section to your email address. This means any notification emails sent by your local environment will be sent to you. - Install the EF Core CLI tools.
dotnet tool install --global dotnet-ef
- Build the project.
dotnet build
- Apply the database migrations. This will create a
BricksAndHearts
database in your local SQL Server if it doesn't exist already.dotnet ef database update --project web
dotnet run --project web
or launch from your IDE (e.g. Rider).
Unit tests can be run from your IDE or from the terminal:
dotnet test
or to filter to just controller/service tests:
dotnet test --filter "FullyQualifiedName~BricksAndHearts.UnitTests.ControllerTests"
dotnet test --filter "FullyQualifiedName~BricksAndHearts.UnitTests.ServiceTests"
Running the tests should create a BricksAndHeartsTest
database in SQL Server which is used by the service tests.
Unit tests can be found in the BricksAndHearts.UnitTests
project and use the following frameworks:
There are currently two categories of unit tests:
- Controller tests – These test the correct behaviour of the controller actions in terms of routing, validation, redirects, etc. Real service objects should generally not be used here, and instead mocks should be used to fake their behaviour to check the controller method responds correctly.
- Service tests – These test the functionality of the methods in the service classes, which usually perform database or API operations. They should not test any controller functionality.
Some service tests check whether database operations are executed correctly. Database unit tests work slightly differently to normal tests – see the guide for how to use them.
Copyright © 2022 Change Ahead, the trading name of Homeless To Wellness Ltd.