Skip to content

marcflohrer/AspNetOnSqlServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


SQL Server on Linux + ASP.NET 5.0 my-demo-app demo


Explore the docs »

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started

About The Project

This project is intended to be the starting point when implementing a demo ASP.NET application with a local database on a mac. I am not sure if it all works on different operating systems as I did not test it.

When starting a new side project this boiler plate code takes unnecessarily a lot of time. Not any more with this template project.

Built With

This section lists major frameworks and projects that were used:

Getting Started

First thing should be to change the default database password in the .env file:

DatabasePassword="YourStr0ngP@ssword!"
DatabaseConnectionString="Server=db;Database=master;User=sa;Password=YourStr0ngP@ssword!;"

To start up the app run

startup-app.sh

To adjust the database structure to the database description in the project:

start-dbmigrating.sh

To reverse engineer the database structure run

start-dbscaffolding.sh

Prerequisites

You need docker and docker-compose on the machine where you want to run the application:

Installation

  1. Clone the repo:

    git clone https://github.com/your_username_/Project-Name.git
  2. Put a .env file in the src folder with the data that match your environment:

    cd /my-demo-app/src
    touch .env
    echo 'DatabasePassword="YourStr0ngP@ssword!"' >> .env
    echo 'DatabaseConnectionString="Server=db;Database=master;User=sa;Password=YourStr0ngP@ssword!;"'  >> .env
  3. Install docker:

    brew install docker docker-compose docker-machine xhyve docker-machine-driver-xhyve

    or on linux

    curl -fsSL https://get.docker.com -o get-docker.sh
    sh get-docker.sh
    sudo usermod -aG docker $USER
    sudo reboot
    ssh user@191.XXX.XXX.YY
    sudo chown root:docker /var/run/docker.sock
    sudo apt-get install libffi-dev libssl-dev
    sudo apt install python3-dev
    sudo apt-get install -y python3 python3-pip
    sudo pip3 install docker-compose 
    
  4. To install dotnet on linux run execute the following commands from the $HOME directory of the user you are logged in with. Check https://dotnet.microsoft.com/download/dotnet/5.0 for more recent versions of the dotnet sdk for the arm64 architecture.

    wget https://download.visualstudio.microsoft.com/download/pr/af5f1e5b-d544-47af-b730-038e4258641b/bccb3982f5690134ab66748a5afc36c7/dotnet-sdk-5.0.203-linux-arm64.tar.gz
    mkdir dotnet-64
    tar zxf dotnet-sdk-5.0.203-linux-arm64.tar.gz -C $HOME/dotnet-64
    export DOTNET_ROOT=$HOME/dotnet-64
    export PATH=$HOME/dotnet-64:$PATH
    echo  'export DOTNET_ROOT=$HOME/dotnet-64' >> ~/.bashrc 
    echo  'export PATH=$HOME/dotnet-64:$PATH' >> ~/.bashrc 
    sudo reboot
    ssh user@191.XXX.XXX
    dotnet --info
  5. Before starting the app for the first time on a specific machine go to the src folder and run:

    ./start-dbmigrating.sh
  6. Start the app:

    ./startup-app.sh &
  7. Wait 1 or 2 minutes and then open http://localhost in any browser to see the website.

About

Project template for non-production Asp.net projects.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published