Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

00060 implement backend for a to do list Pt. 1 #64

Merged
merged 15 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:7.0.10-alpine3.18 AS base
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
#Todo: clean it up for multiproject build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY src/api/api.csproj src/api/
RUN dotnet restore "src/api/api.csproj"
Expand Down
24 changes: 0 additions & 24 deletions backend/UnitTests/UnitTests.csproj

This file was deleted.

1 change: 0 additions & 1 deletion backend/UnitTests/Usings.cs

This file was deleted.

25 changes: 25 additions & 0 deletions backend/bruno/KSummarized/ToDo/List/Create.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
meta {
name: Create
type: http
seq: 2
}

post {
url: https://{{api_base_url}}/api/todo/lists
body: json
auth: bearer
}

auth:bearer {
token: {{token}}
}

body:json {
{
"name": "Demo"
}
}

vars:post-response {
listId: res.body.id
}
19 changes: 19 additions & 0 deletions backend/bruno/KSummarized/ToDo/List/Delete.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
meta {
name: Delete
type: http
seq: 4
}

delete {
url: https://{{api_base_url}}/api/todo/lists/{{listId}}
body: json
auth: bearer
}

auth:bearer {
token: {{token}}
}

body:json {
"ToDo"
}
15 changes: 15 additions & 0 deletions backend/bruno/KSummarized/ToDo/List/Get.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
meta {
name: Get
type: http
seq: 5
}

get {
url: https://{{api_base_url}}/api/todo/lists/{{listId}}
body: none
auth: bearer
}

auth:bearer {
token: {{token}}
}
15 changes: 15 additions & 0 deletions backend/bruno/KSummarized/ToDo/List/List.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
meta {
name: List
type: http
seq: 1
}

get {
url: https://{{api_base_url}}/api/todo/lists
body: none
auth: bearer
}

auth:bearer {
token: {{token}}
}
21 changes: 21 additions & 0 deletions backend/bruno/KSummarized/ToDo/List/Rename.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
meta {
name: Rename
type: http
seq: 3
}

put {
url: https://{{api_base_url}}/api/todo/lists/{{listId}}
body: json
auth: bearer
}

auth:bearer {
token: {{token}}
}

body:json {
{
"name": "Renamed"
}
}
5 changes: 5 additions & 0 deletions backend/bruno/KSummarized/bruno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"version": "1",
"name": "KSummarized",
"type": "collection"
}
12 changes: 12 additions & 0 deletions backend/bruno/KSummarized/environments/Local.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
vars {
keycloak_realm: KnowledgeSummarized
keycloak_url: http://localhost:8080
api_base_url: localhost:5000
}
vars:secret [
token,
keycloak_client_id,
keycloak_client_secret,
keycloak_username,
keycloak_password
]
23 changes: 23 additions & 0 deletions backend/bruno/KSummarized/token.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
meta {
name: Get access token
type: http
seq: 1
}

post {
url: {{keycloak_url}}/realms/{{keycloak_realm}}/protocol/openid-connect/token
body: formUrlEncoded
auth: none
}

body:form-urlencoded {
client_id: {{keycloak_client_id}}
grant_type: password
client_secret: {{keycloak_client_secret}}
username: {{keycloak_username}}
password: {{keycloak_password}}
}

vars:post-response {
token: res.body.access_token
}
107 changes: 43 additions & 64 deletions backend/ksummarized.sln
Original file line number Diff line number Diff line change
@@ -1,64 +1,43 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33213.308
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D7A1B70F-EE88-4B3C-A209-FE2517ADD026}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "api", "src\api\api.csproj", "{917A96E2-DAE3-432B-8C65-362D34194104}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{A2E313A3-EE03-4A78-ABCE-42E7A4B7029A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D12C229D-2E15-43BD-951F-EF05AE7633D9}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{D21A0FAE-B25F-4975-9EBC-76E24CDA1969}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{917A96E2-DAE3-432B-8C65-362D34194104}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{917A96E2-DAE3-432B-8C65-362D34194104}.Debug|Any CPU.Build.0 = Debug|Any CPU
{917A96E2-DAE3-432B-8C65-362D34194104}.Debug|x64.ActiveCfg = Debug|Any CPU
{917A96E2-DAE3-432B-8C65-362D34194104}.Debug|x64.Build.0 = Debug|Any CPU
{917A96E2-DAE3-432B-8C65-362D34194104}.Debug|x86.ActiveCfg = Debug|Any CPU
{917A96E2-DAE3-432B-8C65-362D34194104}.Debug|x86.Build.0 = Debug|Any CPU
{917A96E2-DAE3-432B-8C65-362D34194104}.Release|Any CPU.ActiveCfg = Release|Any CPU
{917A96E2-DAE3-432B-8C65-362D34194104}.Release|Any CPU.Build.0 = Release|Any CPU
{917A96E2-DAE3-432B-8C65-362D34194104}.Release|x64.ActiveCfg = Release|Any CPU
{917A96E2-DAE3-432B-8C65-362D34194104}.Release|x64.Build.0 = Release|Any CPU
{917A96E2-DAE3-432B-8C65-362D34194104}.Release|x86.ActiveCfg = Release|Any CPU
{917A96E2-DAE3-432B-8C65-362D34194104}.Release|x86.Build.0 = Release|Any CPU
{D21A0FAE-B25F-4975-9EBC-76E24CDA1969}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D21A0FAE-B25F-4975-9EBC-76E24CDA1969}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D21A0FAE-B25F-4975-9EBC-76E24CDA1969}.Debug|x64.ActiveCfg = Debug|Any CPU
{D21A0FAE-B25F-4975-9EBC-76E24CDA1969}.Debug|x64.Build.0 = Debug|Any CPU
{D21A0FAE-B25F-4975-9EBC-76E24CDA1969}.Debug|x86.ActiveCfg = Debug|Any CPU
{D21A0FAE-B25F-4975-9EBC-76E24CDA1969}.Debug|x86.Build.0 = Debug|Any CPU
{D21A0FAE-B25F-4975-9EBC-76E24CDA1969}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D21A0FAE-B25F-4975-9EBC-76E24CDA1969}.Release|Any CPU.Build.0 = Release|Any CPU
{D21A0FAE-B25F-4975-9EBC-76E24CDA1969}.Release|x64.ActiveCfg = Release|Any CPU
{D21A0FAE-B25F-4975-9EBC-76E24CDA1969}.Release|x64.Build.0 = Release|Any CPU
{D21A0FAE-B25F-4975-9EBC-76E24CDA1969}.Release|x86.ActiveCfg = Release|Any CPU
{D21A0FAE-B25F-4975-9EBC-76E24CDA1969}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{917A96E2-DAE3-432B-8C65-362D34194104} = {D7A1B70F-EE88-4B3C-A209-FE2517ADD026}
{D21A0FAE-B25F-4975-9EBC-76E24CDA1969} = {A2E313A3-EE03-4A78-ABCE-42E7A4B7029A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EB55458A-327D-41D5-8211-352C32273E00}
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DE2804D2-3D3D-4A41-91C7-4FEEF71A4434}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "api", "src\api\api.csproj", "{949171D5-4018-4C40-AB2B-687B39F20974}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{4CA15B69-5E75-48E2-BE26-EA818B675CFC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "unit", "test\unit\unit.csproj", "{B930D2FA-7FC6-4772-89EA-6B925EDD2EBC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "infrastructure", "src\infrastructure\infrastructure.csproj", "{9D4BB729-24FB-4B6E-9EFD-B8C2E0A2B1EB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{949171D5-4018-4C40-AB2B-687B39F20974}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{949171D5-4018-4C40-AB2B-687B39F20974}.Debug|Any CPU.Build.0 = Debug|Any CPU
{949171D5-4018-4C40-AB2B-687B39F20974}.Release|Any CPU.ActiveCfg = Release|Any CPU
{949171D5-4018-4C40-AB2B-687B39F20974}.Release|Any CPU.Build.0 = Release|Any CPU
{B930D2FA-7FC6-4772-89EA-6B925EDD2EBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B930D2FA-7FC6-4772-89EA-6B925EDD2EBC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B930D2FA-7FC6-4772-89EA-6B925EDD2EBC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B930D2FA-7FC6-4772-89EA-6B925EDD2EBC}.Release|Any CPU.Build.0 = Release|Any CPU
{9D4BB729-24FB-4B6E-9EFD-B8C2E0A2B1EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9D4BB729-24FB-4B6E-9EFD-B8C2E0A2B1EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9D4BB729-24FB-4B6E-9EFD-B8C2E0A2B1EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9D4BB729-24FB-4B6E-9EFD-B8C2E0A2B1EB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{949171D5-4018-4C40-AB2B-687B39F20974} = {DE2804D2-3D3D-4A41-91C7-4FEEF71A4434}
{B930D2FA-7FC6-4772-89EA-6B925EDD2EBC} = {4CA15B69-5E75-48E2-BE26-EA818B675CFC}
{9D4BB729-24FB-4B6E-9EFD-B8C2E0A2B1EB} = {DE2804D2-3D3D-4A41-91C7-4FEEF71A4434}
EndGlobalSection
EndGlobal
6 changes: 0 additions & 6 deletions backend/src/api/Constants/ErrorMessages.cs

This file was deleted.

64 changes: 0 additions & 64 deletions backend/src/api/Controllers/AuthenticationController.cs

This file was deleted.

26 changes: 0 additions & 26 deletions backend/src/api/Controllers/GreetingsController.cs

This file was deleted.

Loading
Loading