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/07/19 12:44] – [Database Setup] ghachey | sis_developer_manual [2025/07/10 01:00] (current) – [Frontend Setup] ghachey | ||
---|---|---|---|
Line 139: | Line 139: | ||
==== 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. |
+ | |||
+ | <code csharp> | ||
+ | using System; | ||
+ | using System.Collections.Generic; | ||
+ | using System.Text; | ||
+ | using Microsoft.EntityFrameworkCore; | ||
+ | |||
+ | namespace opensis.data.Models | ||
+ | { | ||
+ | public class CRMContextMySQL : CRMContext | ||
+ | { | ||
+ | private readonly DbContextOptions? | ||
+ | public CRMContextMySQL() { } | ||
+ | public CRMContextMySQL(DbContextOptions options) : base(options) | ||
+ | { | ||
+ | this.contextOptions = options; | ||
+ | } | ||
+ | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | ||
+ | { | ||
+ | if (!optionsBuilder.IsConfigured) | ||
+ | { | ||
+ | //var tenant = " | ||
+ | |||
+ | //string connectionString = $" | ||
+ | // | ||
+ | } | ||
+ | |||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | With the above configured the upgrade will run automatically by loading the application. Another | ||
< | < | ||
Line 195: | Line 228: | ||
</ | </ | ||
+ | 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 208: | Line 264: | ||
+ | ===== 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.1689770662.txt.gz · Last modified: 2023/07/19 12:44 by ghachey