Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfgx committed May 23, 2024
0 parents commit 32664fe
Show file tree
Hide file tree
Showing 176 changed files with 3,538 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .docker/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
**/*.bat
**/*.log
**/*.md
**/*.yml
**/.dockerignore
**/.editorconfig
**/.git
**/.gitattributes
**/.github
**/.gitignore
**/.vs
**/.vscode
**/bin
**/dist
**/dockerfile
**/node_modules
**/obj
**/package-lock.json
**/postman.json
39 changes: 39 additions & 0 deletions .docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: "3.8"
services:
web:
image: architecture/web
container_name: architecture_web
restart: always
build:
context: ..
dockerfile: ./.docker/dockerfile
environment:
- Authentication__Schemes__Bearer__SigningKeys__1__Issuer=Issuer
- Authentication__Schemes__Bearer__SigningKeys__1__Value=E7F87FB927DB404E9F027E0826AFF62B
- Authentication__Schemes__Bearer__ValidAudience=Audience
- Authentication__Schemes__Bearer__ValidIssuer=Issuer
- ConnectionStrings__Context=Server=architecture_database;Database=Database;User Id=sa;Password=P4ssW0rd!;TrustServerCertificate=true;
- Serilog__WriteTo__1__Args__path=/app/logs/
depends_on:
- database
networks:
- network
ports:
- 8090:80
database:
image: mcr.microsoft.com/mssql/server
container_name: architecture_database
restart: always
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=P4ssW0rd!
networks:
- network
ports:
- 1433:1433
volumes:
- database:/var/opt/mssql
networks:
network:
volumes:
database:
21 changes: 21 additions & 0 deletions .docker/dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# DotNet
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS dotnet
COPY source ./source
RUN dotnet publish ./source/Web/Architecture.Web.csproj --configuration Release --output /dist

# Angular
FROM node:20-alpine AS angular
WORKDIR ./source/Web/Frontend
COPY source/Web/Frontend/package.json .
RUN npm run restore
COPY source/Web/Frontend .
RUN npm run publish

# Runtime
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
RUN apk add --no-cache icu-libs
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
WORKDIR /app
COPY --from=dotnet /dist .
COPY --from=angular /source/Web/Frontend/dist ./wwwroot
ENTRYPOINT ["dotnet", "Architecture.Web.dll"]
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
charset = utf-8
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto
*.cs diff=csharp
44 changes: 44 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: build
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: DotNet Setup
uses: actions/setup-dotnet@v4
with:
global-json-file: source/global.json

- name: DotNet Publish
run: dotnet publish source/Web --configuration Release --output web

- name: Node Setup
uses: actions/setup-node@v4
with:
node-version: 20
check-latest: true

- name: Node Publish
run: |
cd source/Web/Frontend
npm run restore
npm run publish
- name: Artifact Prepare
run: |
mkdir web/wwwroot
rm --force --recursive web/*.pdb
rm --force --recursive web/Frontend/*
mv --force source/Web/Frontend/dist/* web/wwwroot
jq '.api = "https://github.com"' web/wwwroot/assets/settings.json > tmp && mv tmp web/wwwroot/assets/settings.json
- name: Artifact Upload
uses: actions/upload-artifact@v4
with:
name: web
path: web
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
*.bat
*.log
*.pdb
*.suo
*.tmp
*.user
.angular
.vs
[Bb]in
[Dd]ebug
[Ll]og
[Oo]bj
[Rr]elease
[Rr]eleases
[Tt]est[Rr]esults
dist
node_modules
package-lock.json
5 changes: 5 additions & 0 deletions license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1 change: 1 addition & 0 deletions postman.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":1,"collections":[{"id":"33c5f635-8255-4611-80f9-d118f46a3e79","uid":"0-33c5f635-8255-4611-80f9-d118f46a3e79","name":"Architecture","description":null,"auth":null,"events":null,"variables":[],"order":[],"folders_order":["81c988e6-322d-477b-82fb-a2311d46f5ee","5c1f304b-c68c-460f-b2c5-7640506303e4"],"protocolProfileBehavior":{},"createdAt":"2022-12-22T16:25:55.910Z","folders":[{"id":"81c988e6-322d-477b-82fb-a2311d46f5ee","uid":"0-81c988e6-322d-477b-82fb-a2311d46f5ee","name":"Auths","description":null,"auth":null,"events":null,"collection":"33c5f635-8255-4611-80f9-d118f46a3e79","folder":null,"order":["e8086da9-b94a-4237-807d-5356339920e1"],"folders_order":[],"owner":"0","protocolProfileBehavior":{},"createdAt":"2022-12-22T16:26:15.867Z","collectionId":"33c5f635-8255-4611-80f9-d118f46a3e79","folderId":"81c988e6-322d-477b-82fb-a2311d46f5ee"},{"id":"5c1f304b-c68c-460f-b2c5-7640506303e4","uid":"0-5c1f304b-c68c-460f-b2c5-7640506303e4","name":"Users","description":null,"auth":null,"events":null,"collection":"33c5f635-8255-4611-80f9-d118f46a3e79","folder":null,"order":["65930fac-cab7-4ad6-aa4e-739e6eae1341","ba37094c-077a-45d3-8e49-8a4e178104d2","00b49d78-b89c-4860-9821-907686457d1f","79cb2f42-5350-4ea6-81dc-840d68e0205d","05f84113-b9e0-4d73-aa46-67c9e2dd012e","5536ad2b-492e-457e-8b2b-c395935019a8","331a8da3-4eb7-44ec-a1d2-05736e5b8ffe"],"folders_order":[],"owner":"0","protocolProfileBehavior":{},"createdAt":"2022-12-22T16:26:22.305Z","collectionId":"33c5f635-8255-4611-80f9-d118f46a3e79","folderId":"5c1f304b-c68c-460f-b2c5-7640506303e4"}],"requests":[{"id":"00b49d78-b89c-4860-9821-907686457d1f","uid":"0-00b49d78-b89c-4860-9821-907686457d1f","name":"Grid","url":"{{url}}/users/grid?page.index=1&page.size=2&order.ascending=false&order.property=name","description":null,"data":null,"dataOptions":{"raw":{"language":"json"}},"dataMode":null,"headerData":[{"key":"Authorization","value":"Bearer {{token}}","description":"","type":"default","enabled":true}],"method":"GET","pathVariableData":[],"queryParams":[{"key":"page.index","value":"1","equals":true,"description":null,"enabled":true},{"key":"page.size","value":"2","equals":true,"description":null,"enabled":true},{"key":"order.ascending","value":"false","equals":true,"description":null,"enabled":true},{"key":"order.property","value":"name","equals":true,"description":null,"enabled":true}],"auth":null,"events":[{"listen":"test","script":{"id":"93bcbfda-357b-42bb-b01c-868e9bceb6cb","exec":[""],"type":"text/javascript"}}],"folder":"5c1f304b-c68c-460f-b2c5-7640506303e4","responses_order":[],"preRequestScript":null,"tests":null,"currentHelper":null,"helperAttributes":null,"collectionId":"33c5f635-8255-4611-80f9-d118f46a3e79","headers":"Authorization: Bearer {{token}}\n","pathVariables":{}},{"id":"05f84113-b9e0-4d73-aa46-67c9e2dd012e","uid":"0-05f84113-b9e0-4d73-aa46-67c9e2dd012e","name":"Inactivate","url":"{{url}}/users/2/inactivate","description":null,"data":null,"dataOptions":{"raw":{"language":"json"}},"dataMode":null,"headerData":[{"key":"Authorization","value":"Bearer {{token}}","description":"","type":"default","enabled":true}],"method":"PATCH","pathVariableData":[],"queryParams":[],"auth":null,"events":[{"listen":"test","script":{"id":"50a8236f-9914-483d-bfad-f60e4aaa3123","exec":[""],"type":"text/javascript"}}],"folder":"5c1f304b-c68c-460f-b2c5-7640506303e4","responses_order":[],"preRequestScript":null,"tests":null,"currentHelper":null,"helperAttributes":null,"collectionId":"33c5f635-8255-4611-80f9-d118f46a3e79","headers":"Authorization: Bearer {{token}}\n","pathVariables":{}},{"id":"331a8da3-4eb7-44ec-a1d2-05736e5b8ffe","uid":"0-331a8da3-4eb7-44ec-a1d2-05736e5b8ffe","name":"Delete","url":"{{url}}/users/2","description":null,"data":null,"dataOptions":{"raw":{"language":"json"}},"dataMode":null,"headerData":[{"key":"Authorization","value":"Bearer {{token}}","description":"","type":"default","enabled":true}],"method":"DELETE","pathVariableData":[],"queryParams":[],"auth":null,"events":[{"listen":"test","script":{"id":"b0a40e44-b5ad-430c-99dd-1ceed2707cf3","exec":[""],"type":"text/javascript"}}],"folder":"5c1f304b-c68c-460f-b2c5-7640506303e4","responses_order":[],"preRequestScript":null,"tests":null,"currentHelper":null,"helperAttributes":null,"collectionId":"33c5f635-8255-4611-80f9-d118f46a3e79","headers":"Authorization: Bearer {{token}}\n","pathVariables":{}},{"id":"5536ad2b-492e-457e-8b2b-c395935019a8","uid":"0-5536ad2b-492e-457e-8b2b-c395935019a8","name":"Update","url":"{{url}}/users/2","description":null,"data":[],"dataOptions":{"raw":{"language":"json"}},"dataMode":"raw","headerData":[{"key":"Authorization","value":"Bearer {{token}}","description":"","type":"default","enabled":true}],"method":"PUT","pathVariableData":[],"queryParams":[],"auth":null,"events":[{"listen":"test","script":{"id":"dc19629f-14c9-45c7-93f3-768b3b127134","exec":[""],"type":"text/javascript"}}],"folder":"5c1f304b-c68c-460f-b2c5-7640506303e4","responses_order":[],"preRequestScript":null,"tests":null,"currentHelper":null,"helperAttributes":null,"collectionId":"33c5f635-8255-4611-80f9-d118f46a3e79","rawModeData":"{\r\n \"id\": 2,\r\n \"name\": \"{{$randomFirstName}}\",\r\n \"email\": \"{{$randomEmail}}\"\r\n}","headers":"Authorization: Bearer {{token}}\n","pathVariables":{}},{"id":"65930fac-cab7-4ad6-aa4e-739e6eae1341","uid":"0-65930fac-cab7-4ad6-aa4e-739e6eae1341","name":"Add","url":"{{url}}/users","description":null,"data":[],"dataOptions":{"raw":{"language":"json"}},"dataMode":"raw","headerData":[{"key":"Authorization","value":"Bearer {{token}}","description":"","type":"default","enabled":true}],"method":"POST","pathVariableData":[],"queryParams":[],"auth":null,"events":[{"listen":"test","script":{"id":"8eb69cd7-1039-4975-a6a8-d3d133b62058","exec":[""],"type":"text/javascript"}}],"folder":"5c1f304b-c68c-460f-b2c5-7640506303e4","responses_order":[],"preRequestScript":null,"tests":null,"currentHelper":null,"helperAttributes":null,"collectionId":"33c5f635-8255-4611-80f9-d118f46a3e79","rawModeData":"{\r\n \"name\": \"{{$randomFirstName}}\",\r\n \"email\": \"{{$randomEmail}}\",\r\n \"login\": \"{{$randomUserName}}\",\r\n \"password\": \"{{$randomPassword}}\"\r\n}","headers":"Authorization: Bearer {{token}}\n","pathVariables":{}},{"id":"79cb2f42-5350-4ea6-81dc-840d68e0205d","uid":"0-79cb2f42-5350-4ea6-81dc-840d68e0205d","name":"Get","url":"{{url}}/users/1","description":null,"data":null,"dataOptions":{"raw":{"language":"json"}},"dataMode":null,"headerData":[{"key":"Authorization","value":"Bearer {{token}}","description":"","type":"default","enabled":true}],"method":"GET","pathVariableData":[],"queryParams":[],"auth":null,"events":[{"listen":"test","script":{"id":"c082a4b7-d864-410a-8429-faafda68a487","exec":[""],"type":"text/javascript"}}],"folder":"5c1f304b-c68c-460f-b2c5-7640506303e4","responses_order":[],"preRequestScript":null,"tests":null,"currentHelper":null,"helperAttributes":null,"collectionId":"33c5f635-8255-4611-80f9-d118f46a3e79","headers":"Authorization: Bearer {{token}}\n","pathVariables":{}},{"id":"ba37094c-077a-45d3-8e49-8a4e178104d2","uid":"0-ba37094c-077a-45d3-8e49-8a4e178104d2","name":"List","url":"{{url}}/users","description":null,"data":null,"dataOptions":{"raw":{"language":"json"}},"dataMode":null,"headerData":[{"key":"Authorization","value":"Bearer {{token}}","description":"","type":"default","enabled":true}],"method":"GET","pathVariableData":[],"queryParams":[],"auth":null,"events":[{"listen":"test","script":{"id":"dcd82279-283f-4602-9d96-cf3157f68229","exec":[""],"type":"text/javascript"}}],"folder":"5c1f304b-c68c-460f-b2c5-7640506303e4","responses_order":[],"preRequestScript":null,"tests":null,"currentHelper":null,"helperAttributes":null,"collectionId":"33c5f635-8255-4611-80f9-d118f46a3e79","headers":"Authorization: Bearer {{token}}\n","pathVariables":{}},{"id":"e8086da9-b94a-4237-807d-5356339920e1","uid":"0-e8086da9-b94a-4237-807d-5356339920e1","name":"Auth","url":"{{url}}/auths","description":null,"data":[],"dataOptions":{"raw":{"language":"json"}},"dataMode":"raw","headerData":[],"method":"POST","pathVariableData":[],"queryParams":[],"auth":null,"events":[{"listen":"test","script":{"id":"cd2620be-f3c3-4df4-808c-ab890f2e47f0","exec":["pm.environment.set(\"token\", pm.response.json().token);"],"type":"text/javascript"}}],"folder":"81c988e6-322d-477b-82fb-a2311d46f5ee","responses_order":[],"preRequestScript":null,"tests":"pm.environment.set(\"token\", pm.response.json().token);","currentHelper":null,"helperAttributes":null,"collectionId":"33c5f635-8255-4611-80f9-d118f46a3e79","rawModeData":"{\r\n \"login\": \"admin\",\r\n \"password\": \"admin\"\r\n}","headers":"","pathVariables":{}}]}],"environments":[{"id":"71dc994b-6187-46e5-a3af-0052b162cbaa","name":"Local","values":[{"key":"url","value":"https://localhost:8090","type":"default","enabled":true},{"key":"token","value":"","type":"default","enabled":true}]},{"id":"bf00f882-45c1-4705-974f-fcfceda9c039","name":"My Workspace - globals","values":[]}],"headerPresets":[],"globals":[]}

0 comments on commit 32664fe

Please sign in to comment.