User Tools

Site Tools


sis_developer_manual

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
sis_developer_manual [2023/07/19 12:44] – [Database Setup] ghacheysis_developer_manual [2024/03/11 01:52] (current) – [Packaging the Frontend] ghachey
Line 150: Line 150:
  
 A developer also suggested another by "hitting the API from postman or swagger" the URL https://localhost:port/{databaseName}/Common/getAllLanguageForLogin (replace the {databaseName} with the local databaseName) to automatically trigger the migration.  A developer also suggested another by "hitting the API from postman or swagger" the URL https://localhost:port/{databaseName}/Common/getAllLanguageForLogin (replace the {databaseName} with the local databaseName) to automatically trigger the migration. 
 +
 +<note important>At the time of this writing I had to enabled (uncomment) the commented lines below in the file **opensis.data/Models/CRMContextMySQL.cs** to run the upgrade.
 +
 +<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? contextOptions;
 +        public CRMContextMySQL() { }
 +        public CRMContextMySQL(DbContextOptions options) : base(options)
 +        {
 +            this.contextOptions = options;
 +        }
 +        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
 +        {
 +            if (!optionsBuilder.IsConfigured)
 +            {
 +                //var tenant = "opensisv2_ef6";
 +
 +                //string connectionString = $"server=localhost;database={tenant};user=theuser;password=thepassword";
 +                //optionsBuilder.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString));
 +            }
 +
 +        }
 +    }
 +}
 +</code>
 +
 +</note>
  
 ==== Building and Running Backend ==== ==== Building and Running Backend ====
Line 208: Line 243:
  
  
 +===== 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's publish feature. There is a publish "profile" in there that can be use as example. Two  apps need to be deployed on the backend.
 +
 +  * opensisAPI
 +  * opensis.backgroundjob
 +
 +This should look something like this.
 +
 +{{ :sis-developer-manual:pacific-sis-deploy-1.png |}}
 +
 +This will put the packaged files in specific directories on your development computer based on your publish profile.
 +
 +==== Packaging the Frontend ====
 +
 +Navigate to the ''Pacific-SIS/UI'' directory and execute the following command.
 +
 +<code>
 +> ng build
 +</code>
  
 +This should package all the frontend files in ''Pacific-SIS/UI/dist/vex/''
  
 +==== 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