Licensed under the MIT license
QnA API | |
Info | A Web API service which allows question sets to be organised and presented and their answers collected by exposing HTTP REST end points. |
Build | |
Web | https://localhost:5555/swagger/index.html |
QnA API Client | |
Info | A .Net Core client library for QnA API HTTP REST end points |
Build |
QnA API Types | |
Info | Common types to interact with the QnA Api |
Build |
QnA API Views | |
Info | Asp.Net Core Views using GOV UK Design System |
Build |
See Support Site for EFSA developer details.
- Install .NET Core 2.2 SDK
- Install Visual Studio 2019 with these workloads:
- ASP.NET and web development
- Install SQL Server 2017 Developer Edition
- Install SQL Management Studio
- Install Azure Storage Emulator (Make sure you are on atleast v5.3)
- Install Azure Storage Explorer
- Administrator Access
- Clone this repository
- Open Visual Studio as an administrator
- Build the solution SFA.DAS.QnA.sln
- Either use Visual Studio's
Publish Database
tool to publish the database project SFA.DAS.QnA.Database to name {{database name}} on {{local instance name}} - To include the latest question sets when publishing a database to your local SQL Server, you need to ensure that
ProjectPath
variable contains the full path in the format{{drive}}:\{{project-folders}}\das-qna-api\src\SFA.DAS.QnA.Database\
-
eg.
C:\Source\Repos\SFA\das-qna-api\src\SFA.DAS.QnA.Database\
Note: The required trailing backslash on the path in the example above.
-
or
- Create a database manually named {{database name}} on {{local instance name}} and run each of the
.sql
scripts in the SFA.DAS.QnA.Database project.
- Get the das-qna-api configuration json file from das-employer-config; which is a non-public repository.
- Create a Configuration table in your (Development) local Azure Storage account.
- Add a row to the Configuration table with fields: PartitionKey: LOCAL, RowKey: SFA.DAS.QnA.Api_1.0, Data: {{The contents of the local config json file}}.
- Update Configuration SFA.DAS.QnA.API_1.0, Data { "SqlConnectionstring":"Server={{local instance name}};Initial Catalog={{database name}};Trusted_Connection=True;" }
JSON configuration was created to work with dotnet run.
- Navigate to src/SFA.DAS.QnA.API/
- run
dotnet restore
- run
dotnet run
or
- Set SFA.DAS.QnA.API as the startup project
- Running the solution will launch the API in your browser
To create a JSON structure required to author updates and create new question sets:
To view how the question sets will be presented when integrated into a client application using GOV UK Design System:
Contains all of the application logic to handle requests
-
All requests are handled via MediatR
-
Requests are either:
- Queries, which will perform Read action on data
- Commands, which perform Create / Update / Delete action on data
-
Validators
- A library of validators that may be used to validate Question input
ValidatorFactory
will load the validators for each Question in the Page- Each validator should implement
IValidator
AnswerValidator
will execute each validator and return any validation errors
Enables functionality to store and read configuration from Microsoft Azure storage
-
AuthenticationConfig
- JWT authentication
-
FileStorageConfig
- Information relating to storage of files
-
QnAConfig
- Connection string for the QnA Database
Database project containing setup in order to the create the QnA Database
-
projects
- A subfolder should be created per Project
-
projects/{subfolder}/project.json
- Contains information on how to setup the Workflow information
-
projects/{subfolder}/ApplicationDataSchema.json
- Contains JSON schema to validate ApplicationData
-
projects/{subfolder}/sections
- Holds QnAData for each WorkflowSection