sis_developer_manual
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
sis_developer_manual [2023/08/21 05:25] – [Database Upgrades] ghachey | sis_developer_manual [2025/07/29 05:02] (current) – [Building and Running Backend] ghachey | ||
---|---|---|---|
Line 39: | Line 39: | ||
* [[https:// | * [[https:// | ||
- | <note warning> | + | <note warning> |
===== Setting Up the Development Environment ===== | ===== Setting Up the Development Environment ===== | ||
Line 47: | Line 47: | ||
Most developers currently use Visual Studio, Visual Studio Code, dotnet 6.0, MySQL, NodeJS/NPM. And SourceTree/ | Most developers currently use Visual Studio, Visual Studio Code, dotnet 6.0, MySQL, NodeJS/NPM. And SourceTree/ | ||
- | |||
- | |||
- | <note warning> | ||
- Download and install [[https:// | - Download and install [[https:// | ||
- Download and install latest [[https:// | - Download and install latest [[https:// | ||
- Download and install [[https:// | - Download and install [[https:// | ||
- | - Download and install latest LTS [[https:// | + | - Download and install latest LTS [[https:// |
- [Optional] Download and install [[https:// | - [Optional] Download and install [[https:// | ||
Line 139: | Line 136: | ||
==== Database Upgrades ==== | ==== Database Upgrades ==== | ||
- | Database upgrades are done using the .NET EntityFrameworkCore migrations. When a new migration is made available typically in the source code you'll need to apply the migration. | + | Database upgrades are done using the .NET EntityFrameworkCore migrations. When a new migration is made available typically in the source code you'll need to apply the migration. |
- | + | ||
- | < | + | |
- | PM> Update-Database -Project opensis.data -Context CRMContextMySQL | + | |
- | Build started... | + | |
- | Build succeeded. | + | |
- | Applying migration ' | + | |
- | Done. | + | |
- | </ | + | |
- | + | ||
- | A developer also suggested another by " | + | |
- | + | ||
- | <note important> | + | |
<code csharp> | <code csharp> | ||
Line 184: | Line 169: | ||
</ | </ | ||
- | </note> | + | With the above configured the upgrade will run automatically by loading the application. Another way is to open the Package Manager Console within Visual Studio and run something like the following. |
+ | |||
+ | < | ||
+ | PM> Update-Database -Project opensis.data -Context CRMContextMySQL | ||
+ | Build started... | ||
+ | Build succeeded. | ||
+ | Applying migration ' | ||
+ | Done. | ||
+ | </code> | ||
+ | |||
+ | A developer also suggested another by " | ||
==== Building and Running Backend ==== | ==== Building and Running Backend ==== | ||
Line 192: | Line 187: | ||
{{ : | {{ : | ||
+ | ==== Initialize First User ==== | ||
+ | |||
+ | You can use the API endpoint "/ | ||
+ | |||
+ | <code javascript> | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
==== Install Frontend Dependencies ==== | ==== Install Frontend Dependencies ==== | ||
Line 230: | Line 248: | ||
</ | </ | ||
+ | Unfortunately, | ||
+ | |||
+ | <code javascript> | ||
+ | setDefaultTenant() { | ||
+ | const url = window.location.href; | ||
+ | |||
+ | let tenant = ''; | ||
+ | if (url.includes(' | ||
+ | // sessionStorage.setItem(' | ||
+ | //tenant = ' | ||
+ | sessionStorage.setItem(' | ||
+ | tenant = ' | ||
+ | } else { | ||
+ | let startIndex = url.indexOf('//' | ||
+ | let endIndex = url.indexOf(' | ||
+ | let tenantName = url.substr(startIndex + 2, endIndex - (startIndex + 2)); | ||
+ | |||
+ | sessionStorage.setItem(' | ||
+ | tenant = tenantName; | ||
+ | } | ||
+ | this.commonModel._tenantName = tenant; | ||
+ | } | ||
+ | </ | ||
==== Building and Running the Frontend ==== | ==== Building and Running the Frontend ==== | ||
Line 243: | Line 284: | ||
+ | ===== Deploying ===== | ||
+ | |||
+ | The deployment can be done in a number of ways. You can use the deployment tools in both the backend and frontend to package the files for the production server. Below explains how. | ||
+ | |||
+ | ==== Packaging the Backend ==== | ||
+ | |||
+ | Simply use the Visual Studio' | ||
+ | |||
+ | * opensisAPI | ||
+ | * opensis.backgroundjob | ||
+ | |||
+ | This should look something like this. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | This will put the packaged files in specific directories on your development computer based on your publish profile. | ||
+ | |||
+ | ==== Packaging the Frontend ==== | ||
+ | |||
+ | Navigate to the '' | ||
+ | |||
+ | < | ||
+ | > ng build | ||
+ | </ | ||
+ | This should package all the frontend files in '' | ||
+ | ==== Deploying to Production Server ==== | ||
+ | Is a matter of preference. You could simply copy the files produced in the two previous steps and configure the Apache Server to server them. The database will need to also be deployed. One of the maintainers of the system uses Ansible to automate all of these final deployment tasks. |
sis_developer_manual.1692595535.txt.gz · Last modified: 2023/08/21 05:25 by ghachey