Having SQL Server 2019 + visual studio 2019 + IIS installed
Create a new database on your machine using SQL Server 2019.
(In SQL Server 2019: database -> right click -> new database).
-
Open the solution in Gestionary folder.
-
Right click on 'GestionaryDatabase' project and select 'Schema Comparisons'. On the left side of the Schema Comparisons should be the 'GestionaryDatabase' project.
-
On the right side, select the database you have created.
-
Compare the project and you database then chose 'Update' to import the project tables and views to your database.
-
The website need to have some data in the database in order to work properly. In your SQL Server, open the file in 'GestionaryDatabase\dbo\Datas\AddData.sql' and execute it in your 'Gestionary' database. It will create the necessary data in your database. It will add a admin user with name: admin, and password: admin, that you will be able to change in the website.
-
In visual studio, right click the 'GestionaryWebsite' project and select 'Publish'.
-
In Publish, select 'FolderProfile' then chose the location of the folder. Usually website are deployed in the 'C:\inetpub\wwwroot\' folder. So in our case the location can be 'C:\inetpub\wwwroot\GestionaryWebsite\'.
-
Depending on your environment you will have to change the 'ConnectionString' to match your SQL Server instance and Database.
You will have to replace the 'ConnectionString' by 'Data Source={Your instance};Initial Catalog={The name of your database};Trusted_Connection=True' in the settings of the publication.
Example: "Data Source=.\MTI;Initial Catalog=Gestionary;Trusted_Connection=True"
In order to increase the security of your application, you can create a new user on your machine with standards authorisations, add this user to the 'Gestionary' database in your SQL Server and create a new application pool in IIS that is taking the identity of the new user to access the database / website.
Now that the website has been published and linked to the database, we can deploy the website with IIS.
-
In IIS, create a new website, select the name and the application pool you will use to manage the website.
-
In 'Select Physical path', enter the path where you published the Website with visual studio.
-
Chose the hostname and IP address / port as you wish.
-
Run the website, your website should now be deployed.
Have docker and docker-compose installed
Open a powershell and type:
Powershell> docker-compose -f docker-compose.yml build
When the build is finished type:
Powershell> docker-compose -f docker-compose.yml up
/!\ Be careful, the exposed port is the port 5000, you can change it in the docker-compose.yml AND in the DockerFile inside the GestionaryWebsite folder
You can connect on the website at the address: localhost:5000