diff --git a/README.md b/README.md new file mode 100644 index 0000000..9f70840 --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +# Portfolio Backend + +This is the backend for the portfolio project, built with .NET 8.0. + +## Project Structure + +``` +backend/ +├── src/ +│ └── PortfolioBackend/ +│ ├── Controllers/ +│ ├── Models/ +│ ├── Repositories/ +│ ├── Services/ +│ ├── Migrations/ +│ ├── Program.cs +│ ├── appsettings.json +│ ├── appsettings.Development.json +│ └── PortfolioBackend.csproj +├── tests/ +│ └── PortfolioBackend.Tests/ +│ ├── Controllers/ +│ ├── Models/ +│ ├── Repositories/ +│ ├── Services/ +│ └── PortfolioBackend.Tests.csproj +├── docker/ +│ ├── Dockerfile +│ └── docker-compose.yml +├── .gitignore +└── README.md +``` + +## Setup + +1. Ensure you have .NET 8.0 SDK installed. +2. Clone this repository. +3. Navigate to the `src/PortfolioBackend` directory. +4. Run `dotnet restore` to restore the NuGet packages. +5. Run `dotnet run` to start the application. + +## Running with Docker + +1. Ensure you have Docker and Docker Compose installed. +2. Navigate to the `docker` directory. +3. Run `docker-compose up --build` to build and start the containers. + +## Running Tests + +1. Navigate to the `tests/PortfolioBackend.Tests` directory. +2. Run `dotnet test` to run the unit tests. diff --git a/backend.csproj b/backend.csproj deleted file mode 100644 index 72a664f..0000000 --- a/backend.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - net8.0 - enable - enable - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - - - diff --git a/backend.http b/backend.http deleted file mode 100644 index 2f9a5e1..0000000 --- a/backend.http +++ /dev/null @@ -1,6 +0,0 @@ -@backend_HostAddress = http://localhost:5001 - -GET {{backend_HostAddress}}/weatherforecast/ -Accept: application/json - -### diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..e69de29 diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000..e69de29 diff --git a/src/PortfolioBackend/PortfolioBackend.csproj b/src/PortfolioBackend/PortfolioBackend.csproj new file mode 100644 index 0000000..14e5bf3 --- /dev/null +++ b/src/PortfolioBackend/PortfolioBackend.csproj @@ -0,0 +1,14 @@ + + + + net8.0 + enable + enable + + + + + + + + diff --git a/src/PortfolioBackend/PortfolioBackend.http b/src/PortfolioBackend/PortfolioBackend.http new file mode 100644 index 0000000..ceb45ca --- /dev/null +++ b/src/PortfolioBackend/PortfolioBackend.http @@ -0,0 +1,6 @@ +@PortfolioBackend_HostAddress = http://localhost:5231 + +GET {{PortfolioBackend_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/Program.cs b/src/PortfolioBackend/Program.cs similarity index 100% rename from Program.cs rename to src/PortfolioBackend/Program.cs diff --git a/Properties/launchSettings.json b/src/PortfolioBackend/Properties/launchSettings.json similarity index 79% rename from Properties/launchSettings.json rename to src/PortfolioBackend/Properties/launchSettings.json index e2b6b57..b09f16a 100644 --- a/Properties/launchSettings.json +++ b/src/PortfolioBackend/Properties/launchSettings.json @@ -4,8 +4,8 @@ "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { - "applicationUrl": "http://localhost:65439", - "sslPort": 44367 + "applicationUrl": "http://localhost:39132", + "sslPort": 44397 } }, "profiles": { @@ -14,7 +14,7 @@ "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "swagger", - "applicationUrl": "http://localhost:5001", + "applicationUrl": "http://localhost:5231", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } @@ -24,7 +24,7 @@ "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "swagger", - "applicationUrl": "https://localhost:7195;http://localhost:5001", + "applicationUrl": "https://localhost:7162;http://localhost:5231", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/appsettings.json b/src/PortfolioBackend/appsettings.json similarity index 100% rename from appsettings.json rename to src/PortfolioBackend/appsettings.json diff --git a/tests/PortfolioBackend.Tests/PortfolioBackend.Tests.csproj b/tests/PortfolioBackend.Tests/PortfolioBackend.Tests.csproj new file mode 100644 index 0000000..9422ebd --- /dev/null +++ b/tests/PortfolioBackend.Tests/PortfolioBackend.Tests.csproj @@ -0,0 +1,27 @@ + + + + net8.0 + enable + enable + + false + true + + + + + + + + + + + + + + + + + +