Eshop backend with MySQL DB connector - C# .NET project. Project version A.
Team: Negotiators
Team members | Main focus | |
---|---|---|
Vojtěch Trunda | vojta478@gmail.com | Data Application Layer |
Filip Žádník | 246976@vutbr.cz | Application Programming Interface |
You can build and run docker image using the following commands.
- Clone the repository using GIT
- Create MySQL database and apply migrations using the command below
- Copy /eshopBackend.API/appsettings.json to downloaded binary folder and add your DB connection string
- Run following commands to build and run the container
docker build -t eshopbackend .
docker run --rm -p <external port>:80 -v <config location>:/app/appsettings.json eshopbackend
Should be uploaded by CI to every release tab.
- Download binaries from release tab, current supported platforms are 64-bit Windows and Linux
- Clone the repository using GIT
- Create MySQL database and apply migrations using the command below
- Copy /eshopBackend.API/appsettings.json to downloaded binary folder and add your DB connection string
You can build the project from source by cloning the repo or downloading the packed sources from release tab.
- Clone the repository using GIT
- Create MySQL database and apply migrations using the command below
- Configure user secrets (DB connection string)
- execute in API folder
dotnet user-secrets set "ConnectionStrings:DefaultConnection" "Server=localhost;Database=eshopBackend;User Id=eshopBackend;Password=secret;"
You can configure this application in appsettings.json file located in eshopBackend.API folder.
{
"Logging": {
"LogLevel": { //log levels for classes
"Default": "Debug",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*", //hosts allowed to connect
"ConnectionStrings": {
"DefaultConnection": "" //MySQL DB connection string
},
"Cart": {
"RemovalInterval": 5, //how often are carts removed [minutes]
"MaxAge": 24 //how long can carts last before deletion [hours]
},
"Seeds": {
"SeedMockData": true, //enable seeding (when migrating)
"DataAmount": 5 //how much records to seed
}
}
Execute in DAL folder
dotnet ef migrations add "<name>"
dotnet ef database update