Skip to content

ashToscano-hs/Leadership-Profile

 
 

Repository files navigation

Leadership-Profile

{Detailed description TBD}

Legal Information

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.

Setting up the development environment

Required software

Setup

  • 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

Building the application

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

Testing the application

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.

Running API

Setting the secrets locally for Ed-Fi ODS

Take a look at Microsoft's recommended way managing secret storage here and follow the steps below:

  1. Navigate to directory where CSPROJ exists and run

dotnet user-secrets init

  1. After running the command above, you should see UserSecretId in csproj file: screenshot

  2. To set the Client Id run

dotnet user-secrets set "ODS-API:Client-Id" "{ClientId from Swagger}"

  1. To set the Client Secret run

dotnet user-secrets set "ODS-API:Client-Secret" "{ClientSecret from Swagger}"

Available React Scripts

In the Web project directory, you can run:

npm start

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.

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

npm run build

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.

npm run eject

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.

Email

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>();

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 52.6%
  • JavaScript 37.1%
  • TSQL 4.9%
  • PowerShell 2.4%
  • CSS 2.3%
  • HTML 0.7%