{Detailed description TBD}
Copyright (c) 2020 Ed-Fi Alliance, LLC and contributors.
Licensed under the Apache License, Version 2.0 (the "License").
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
See NOTICES for additional copyright and license notifications.
- .net 5 sdk (https://dotnet.microsoft.com/download/dotnet/5.0)
- SQL Server 2019 (https://www.microsoft.com/en-us/sql-server/sql-server-downloads)
- node.js (https://nodejs.org/)
- docker
- powershell
- Papercut for local email testing (https://github.com/ChangemakerStudios/Papercut-SMTP)
- Run the
setup.ps1
powershell script to install the required powershell modules and tools needed to build the application. - Run
Invoke-Psake DownloadDbTestData
in powershell from the project root folder. - Unzip and restore the backup in
testdata/EdFi_TPDM_v08_20201109.zip
to your local SQL Server instance. - Run the database migrations by running this powershell command from the project root folder:
Invoke-Psake UpdateLocalDatabase
From the project root directory, run this powershell command: Invoke-Psake Publish
.
This command will create two zip files in the artifacts
folder:
- LeadershipProfile-API
- LeadershipProfile-Frontend
These are the available powershell commands to test the application (run them from the projec root directory):
Invoke-Psake TestAPI
: Runs the API related tests. It runs a docker container with a test database and then runs the API test suite.Invoke-Psake TestFrontend
: Runs the frontend tests.Invoke-Psake Test
: Runs all the tests.
Take a look at Microsoft's recommended way managing secret storage here and follow the steps below:
- Navigate to directory where CSPROJ exists and run
dotnet user-secrets init
-
After running the command above, you should see
UserSecretId
in csproj file: -
To set the Client Id run
dotnet user-secrets set "ODS-API:Client-Id" "{ClientId from Swagger}"
- To set the Client Secret run
dotnet user-secrets set "ODS-API:Client-Secret" "{ClientSecret from Swagger}"
In the Web project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Note: this is a one-way operation. Once you eject
, you can’t go back!
If you aren’t satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use eject
. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
The application is preconfigured to send emails to localhost. The recommended tool to test the email sending functionality is Papercut SMTP.
For production, change the EmailSettings configuration block in appsettings.json
:
"EmailSettings": {
"Server": "127.0.0.1",
"Port": 25,
"Sender": "\"Leadership Portal\" <noreply@test.com>",
"Username": "",
"Password": ""
}
Alternatively, you can create a class that implements the IEmailSender
interface
in src/API/LeadershipProfileAPI/Infrastructure/Email/IEmailSender.cs
and register it
on the Startup
class instead of the SmtpSender
class:
// Replace SmtpSender with your own implementation
services.AddTransient<IEmailSender, SmtpSender>();