This project is a .NET Razor application designed to assist in managing school improvement initiatives within the RISE policy. It integrates a Node.js-based build pipeline to handle frontend CSS, utilizing modern tools like Webpack and Sass for building and optimizing CSS assets used by the Razor views.
- .NET Razor Application: Leverages the power of Razor for dynamic web content rendering.
- Node.js Build Pipeline: Employs Node.js tools to manage and optimize frontend assets.
- Webpack & Sass Integration: Utilizes Webpack and Sass for efficient and maintainable CSS development.
Before getting started, ensure the following tools are installed on your system:
- .NET SDK (version 8.0 or higher)
- Node.js (version 16 or higher)
- NPM (comes with Node.js installation)
Run the following command to install ef tools:
dotnet tool install --global dotnet-ef
Make sure you have docker running and run the following command to pull the latest version mssql
docker pull mcr.microsoft.com/azure-sql-edge:latest
Now start the container and set the required settings
docker run --cap-add SYS_PTRACE -e 'ACCEPT_EULA=1' -e 'MSSQL_SA_PASSWORD=StrongPassword905' -p 1433:1433 --name azuresqledge -d mcr.microsoft.com/azure-sql-edge
This project requires packages from the RSD DfE nuget repository, go here for more information on how to det that up.
Follow these steps to set up the project locally:
-
Clone the Repository:
git clone https://github.com/DFE-Digital/manage-school-improvement.git
-
Navigate to the Project Directory:
cd manage-school-improvement
-
Restore .NET Dependencies:
dotnet restore
-
Navigate to the wwwroot Directory:
cd .\src\Dfe.ManageSchoolImprovement\wwwroot
-
Install Node.js Dependencies:
npm install
-
Build Frontend Assets:
npm run build
-
Navigate back to the Project Directory:
cd manage-school-improvement
-
Update the database to the latest migration by running this command:
dotnet ef database update --connection "Server=localhost,1433;Database=sip;User=sa;Password=StrongPassword905;TrustServerCertificate=True" --startup-project .\src\Dfe.ManageSchoolImprovement\ --project .\src\Dfe.ManageSchoolImprovement.Infrastructure\ --context RegionalImprovementForStandardsAndExcellenceContext
-
Update your secrets: Ask for help from another dev on the project to get the right values for this file
{ "AcademiesApi": { "ApiKey": "API-KEY-HERE", "Url": "https://api.dev.academies.education.gov.uk/" }, "ConnectionStrings": { "DefaultConnection": "Server=localhost;Database=sip;User ID=sa;Password=StrongPassword905;TrustServerCertificate=True" }, "AzureAd": { "ClientId": "CLIENT-ID-HERE", "ClientSecret": "CLIENT-SECRET-HERE", "TenantId": "TENANT-ID-HERE", "AllowedRoles": "msi.edit", "GroupId": "GROUP-ID-HERE" } }
-
Run the Application:
dotnet run
The application should now be running at http://localhost:7088
.
-
npm run build:watch
Watches CSS files, rebuilds on changes, and copies the output to thewwwroot/css
directory. -
npm run build
Builds and optimizes CSS for production. -
npm run clean
Cleans thedist
folder and resets build files.
--
-
CSS not updating:
Runnpm run build
icommand in thewwwroot
directory and check that the output files are being copied to/wwwroot/src
. -
Dependency issues:
Check your Node.js or .NET SDK versions and ensure they match the prerequisites.
Include the following extension in your IDE installation: SonarQube for IDE
Update your settings.json file to include the following
"sonarlint.connectedMode.connections.sonarcloud": [
{
"connectionId": "DfE",
"organizationKey": "dfe-digital",
"disableNotifications": false
}
]
Then follow these steps to connect to the SonarCloud instance.
Feel free to submit issues or pull requests to improve this project.
This project is licensed under the MIT License.