-
Notifications
You must be signed in to change notification settings - Fork 625
Running on Mac OS X
This installation guide was built and tested for Mac OS X Sierra with the latest updates as of March 20th 2017 and should work with future version of Mac OS X.
- XCode with Developer Tools
- Homebrew
- .NET Core SDK
- Microsoft SQL Server*
- Docker*
- Git
- NodeJS/NPM
* - Microsoft SQL Server and its dependencies are optional if you choose to use a database hosted using Microsoft Azure or alternatively you can run SQL Server in a linux docker container.
Install XCode from the OSx App Store. Ensure you select Developer Tools when installing.
To determine if Homebrew is already installed, check in the /usr/local directory for a folder called 'Homebrew'
For instructions on how to install Homebrew see their website here
With Homebrew already installed execute the following command to install NodeJS and NPM:
brew install node
Instructions to install the .NET Cored SDK on Mac OS X can be found here
Follow all instructions including the steps to compile some test code to verify everything is configured correctly.
To install Microsoft SQL Server locally your machine must have at least 3.25 gigabytes of RAM. If your machine has <= 3.25 GB of RAM you will not be able to install Microsoft SQL Server using this guide.
In order to run an instance of MS SQL Server locally on Mac OS X, you will have to install the Docker platform. Note docker requires CPU Hyper Threading, so your Mac hardware and/or VM must support this to proceed. Install the Kitematic tool to be able to view your Docker containers and then finally create an MS SQL Server instance.
-
Via Docker Website Launch the disk image and follow the instructions
-
Launch the Docker application after installed (if needed)
-
Click Docker menu on top right dock and choose “Kitematic”
-
Follow instructions to install Kitematic (if needed)
-
Configure the docker preferences so that the memory for new docker containers is at least 3.2GB. This is required for SQL Server to run: https://docs.docker.com/docker-for-mac/#advanced Go to the SQL Server for Linux image page for more details: https://store.docker.com/community/images/microsoft/mssql-server-linux
-
Download the SQL Server Linux docker image:
docker pull microsoft/mssql-server-linux
- Create a container named allready_sqlserver:
docker run --name allReady_sqlserver -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=yourStrong(!)Password' -p 1433:1433 -d microsoft/mssql-server-linux:latest
- Run SQLCMD to create the database:
docker exec -it allReady_sqlserver /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P yourStrong(!)Password
>create database allreadydb
>GO
>
-
Update the connection strings in appsettings.json in the source code of the web application:
"ConnectionString": "Server=tcp:localhost,1433;Initial Catalog=allreadydb;Persist Security Info=False;User ID=sa;Password=yourStrong(!)Password;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=True;Connection Timeout=30;"
Note that you need to make sure you set TrustServerCertificate=True
For more detailed information go to this site and follow the instructions under the section "Get the Docker Image". This site has some good information and some Docker configuration you may want to take advantage of as well.
See this link for a similar link to the one above, however this one is an official link from Microsoft. The above link has a lot more information but this is good to have in your back pocket.
Create a free trial Microsoft Azure account at https://azure.microsoft.com/en-us/free/
After creating an account and subscribing to the free trial service navigate to the Microsoft Azure portal.
From the portal you can click on New(green plus sign) > Databases > SQL Database and begin to create the allReady database.
You can name your database whatever you'd like however for this guide we will be calling it 'AllReady'. When creating the database you will create a server for the database as well. Be sure to remember what your server name is as well as the admin account username and password.
After creating the database and server it will be deployed. To access it from your machine select the database server in the Azure portal, click on overview and then click Set Server Firewall. Then click Add Client IP to add a firewall rule to allow your IP to access the database. Click save and wait for up to 5 minutes for the changes to take effect. You will then be able to access the database.
Using NPM, run the following command to install the sql-cli command line tool:
npm install -g sql-cli
To set up the allReady development environment you will need to retrieve the code from the allReady repository on GitHub. If you plan to contribute to allReady you can fork the repository so that you have your own personal copy of the codebase to work with. You can either choose to download your fork or a branch from the main repository.
If you do not have Git installed, you can download and install from here
To download the source code, clone the repo with the following command:
git clone <repo URL>
After downloading a copy of the code you can begin by restoring the dependent packages for the project.
Navigate into the top-level directory of the repo and complete a restore with the following command:
cd AllReadyApp
dotnet restore AllReadyWebOnly.sln
Now build the webapp:
cd ../Web-App/AllReady
dotnet build
The connection string within the software to the database must be modified in order to point at and connect to our MS SQL Server.
It does not matter which user connection account is used with the database. If you create one on your own, assure that it has 'create database' permissions.
While in allready/AllReadyApp/Web-App/Allready:
Update the file config.json with replacing the default text with the following:
{
"Data": {
"DefaultConnection": {
"ConnectionString": "Server=<localhost or URL of database>;Database=AllReady;User ID=<user id>;Password=<password>;MultipleActiveResultsets=true;"
},
"HangfireConnection": {
"ConnectionString": "Server=<localhost or URL of database>;Database=AllReady;User ID=<user id>;Password=<password>;MultipleActiveResultsets=true;"
}
}
}
From within ./AllReadyApp/Web-App/AllReady/
run:
npm install
From within allready/AllReadyApp/Web-App/Allready run the app with:
ASPNETCORE_ENVIRONMENT=Development dotnet run
Setting the environment variable ASPNETCORE_ENVIRONMENT=Development
gives us more useful error messages in the app for diagnosis during development.
To access the web app, navigate to the following URL via your browser: http://localhost:5000
Please fill this in as trouble arises