pandurd / DecisionAdventure

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DecisionAdventure

Running in local

Run via Docker config, Self hosted in Visual studio 2022

To start via Docker, run follwing command in root
Azure SQL db is connected via hardcoded connection string (should be a secret injected via env variable)

docker build . --tag decisionadventure
docker run -d -p 5050:80 decisionadventure:latest

Swagger Docker URL : http://localhost:5050/swagger/index.html

name-of-you-image

UI

Used basic react UI to do minium code which utilizes API for following functionalities

  1. Create/Design Adventure
  2. Take Adventure
  3. List adventures taken so far and show Decision tree once user reaches end

User will not able to add more question to an answer (restricted in UI as one answer can point to another question)
User can add add multiple answers (more than 2)
User can add question to any level

Tree has root node/label with adventure name.
After that it has one child with first question.

Show decision tree will show selected options highlighted in yellow color

Demo

Creating Adventure (Designing)

Once app is started, app home screen list all available adventures and list of adventures taken by user (username input field is given to differntiate multiple runs/user)

List page name-of-you-image

To create adventure, click on create adventure button on top right nav

Provide a name for adventure and click create. User will be redirected to another create adventure page
Create Adventure Page name-of-you-image

A tree is shown with adventure name in root name.
Create Adventure Decision tree Page name-of-you-image

User have to add first question now by clicking add button
Add question/Answer dialog name-of-you-image

Once user entre question, adds multiple answers if needed then click confirm Once that is done answers will be added to tree

name-of-you-image

Add more questions for more paths, name-of-you-image

Add leaf decision as Question without any answers(leave the answers empty) as below
Leaf Decision
name-of-you-image

Start

User can start an adventure by clicking button (start) from home page - 1st listing
USer will be redirected to a page where user has to choose answers by clikcing on asnwers.

Question will be underlined. Answrs will not be underlined. Clicking only enabled for answers.

example new start,
First question will be displayed

Start adventure path name-of-you-image

User can choose answers.
once choosen, more questions will be displayed. name-of-you-image

Decision Tree

Once final question/path is reached user will be redirected to a decision page (readonly) where no click can be done or no more answers cna be choosen.

Selected answers will be highlighted in yellow
Decision Tree name-of-you-image

User can also see past adventures from home page (2nd listing)
List Page name-of-you-image

API

.Net core 5 - Web api is used with Dapper for DB queries
Added inline queries as much as possible to finish faster.
Added a one store proc as one example to calll store procs via dapper
Entity framework/Ado.net is also nice to have but dapper is more efficient

DB

Please see DB diagram in root folder for table deisgns and all scripts are in DBSCripts folder inside Decison Adventure folder
Azure DB is connected via Connection string hardcoded

DB Diagram name-of-you-image

Tests

Xunit used to do basic and important decision tree testing.

About


Languages

Language:C# 61.4%Language:JavaScript 26.8%Language:TSQL 6.6%Language:Dockerfile 2.7%Language:HTML 1.8%Language:CSS 0.7%Language:Shell 0.0%