Explore the docs »
Report Bug
·
Request Feature
Table of Contents
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.
This section lists major frameworks and projects that were used:
- Best-README-Template
- docker-compose
- docker
- Asp.net
- SQL Server on Linux
- aspnetcore/src/Identity/samples/IdentitySample.Mvc/ that is licensed under Apache 2.0 (Notice: Some files are changed.)
- EntityFramework Core
- xunit/xunit
- aspnet/Identity
- dotnet/efcore
- AutoFixture/AutoFixture
- microsoft/vstest
- xunit/visualstudio.xunit
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
You need docker and docker-compose on the machine where you want to run the application:
- git
- docker
- docker-compose
- dotnet 7.0
- either armv7+ && ubuntu 20.04
- or x64 && (mac || linux)
- 1 GB of RAM
-
Clone the repo:
git clone https://github.com/your_username_/Project-Name.git
-
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
-
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
-
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
-
Before starting the app for the first time on a specific machine go to the src folder and run:
./start-dbmigrating.sh
-
Start the app:
./startup-app.sh &
-
Wait 1 or 2 minutes and then open http://localhost in any browser to see the website.