Skip to content

Latest commit

 

History

History
185 lines (152 loc) · 9.1 KB

README.md

File metadata and controls

185 lines (152 loc) · 9.1 KB

Project Management App

Project Sonar Status Build Status Release Status
Api Gateway Quality Gate Status Build
Discovery Server N/A N/A
Company Api Quality Gate Status Build
Project Api Quality Gate Status Build
Frontend App Quality Gate Status Build

TODO

Project Scope

Create a simple microservices based application with the following components:

  • Service Discovery (Consul)
    • Basic Setup
    • Setup Scripts
    • ACL Setup
    • mTLS Setup
  • Configuration Server (One or more of)
    • Consul KV
    • Vault
  • Api Gateway (Ocelot)
    • Project Setup
    • Connection with Consul
    • Auth Implementation
    • Add routes for company-api
    • Add routes for project-api
    • Consul Policies
    • Consul Configuration
  • Logging/Monitoring (One of)
  • Tracing
    • Setup Jaeger using Docker
  • Authentication/Authorization (One of)
    • Azure AD
    • Keycloak
    • Identity Server
    • Auth0
      • Create an API
      • Create Backend Application
      • Create Frontend Application
      • Documentation
  • Health checks dashboard
  • Backend Apis (.NET 7)
    • Company API
      • Project Setup
      • Logging
      • Tracing using OpenTelemetry
      • Auth
      • Controllers
      • Health checks
      • Docker file
      • Unit Tests
      • Integration Tests
      • CI/CD
      • Consul Policies
      • Consul Configuration
    • Project Api
      • Project Setup
      • Logging
      • Tracing using OpenTelemetry
      • Auth
      • Controllers
      • Health checks
      • Docker file
      • Unit Tests
      • Integration Tests
      • CI/CD
      • Consul Policies
      • Consul Configuration
  • Frontend Application
    • SolidJS App
    • Integration with Auth0
    • Tests
    • CI/CD
  • Create Deployment Files for K8s

Getting Started

Before you can begin development, you need to setup the following:

  • Auth0
  • Consul
  • Docker
  • DotNET 7 SDK

Auth0

Create Backend Application

  • Under Applications > Applications, create a new application with the following settings:
    • Name: Project Management Backend
    • Application Type: Regular Web Application
    • Allowed Callback URLs: http://localhost:8012/login/oauth2/code/auth0
    • Grant Types: Authorization Code, Refresh Token, Implicit, Client Credentials

Create a Frontend Application

  • Under Applications > Applications, create a new application with the following settings:
    • Name: Project Management Frontend
    • Application Type: Single Page Application
    • Allowed Callback URLs: http://localhost:3000
    • Allowed Logout URLs: http://localhost:3000
    • Grant Types: Authorization Code, Refresh Token, Implicit

Create an API

  • Under Applications > APIs, create a new API with the following settings:
    • Name: Project Management
    • Identifier: projectmanagement
    • Signing Algorithm: RS256
  • Under Permissions tab of the API, create the following permissions:
    • read:company
    • write:company
    • read:project
    • write:project
    • read:project
    • write:project
    • update:project
    • delete:project
  • Under the Machine to Machine Applications tab, Authorize the Backend Application created above to access the API and assign the permissions created above.

Consul

Download/Setup

  • Download Consul binary from Consul's Website
  • Extract Consul binary to any location e.g. C:\tools\consul
  • Add location to PATH

Start Agent

consul.exe agent -config-file="config\\config.hcl"

Bootstrap ACL

consul.exe acl bootstrap

Save the secret-id generated by this command.

Create admin token for Consul Server

Run the following command from powershell:

consul.exe acl token create -description "Token for consul-server-1" -node-identity "consul-server-1:az-1" -token="<bootstrap-token>"

Reload config consul.exe reload

Setup ACL/KV for each service

  • Run the configure-consul.ps1 script under the consul folder for each service.
  • Use the generated secret-ids in appsettings.json for each service

Common Issues

docker-compose fails to start es01

wsl -d docker-desktop sysctl -w vm.max_map_count=262144