# Evidence Tool App Documentation Legacy ###### tags: `Documentation` `API` ## TABLE OF CONTENTS [TOC] ## Getting Started ##### Local Setup for Existing .NET Core & Vue * **Development Tools** * Visual Studio 2019 / 2017 * SQL Server & Server Management Studio 2017 & above. * .Net 3.1 version * Hangfire.io (Background process) * Microsoft Entity Framework (seeding & migrations) * **Environment Keys** * Microsoft Azure Storage (Image blob) * Coconut.co (Video encoder) * Google Auth (Sign in & Sign up) * SMTP Host (Email process) * JWTBearer Token (Existing in `appsettings.json`) * Local Environment Setup * **Project Setup** * In EvidenceTool -> Properties -> Debug * Set `Key=ASPNETCORE_ENVIRONMENT | Value=Local` * Then Save the File * **Keys Settings** * Open `appsettings.json` * Set `GeneralOptions['EnvironmentName'] to Local` * Create a new file named `appsettings.Local.json` * Copy all details in `appsettings.json` and paste it to `appsettings.Local.json` * Replace the ff with your generated keys: * SMTP Options * Google Options (Google Auth) * Azure Options * Coconut Options * GeneralOptions: `AppBaseUrl: https://127.0.0.1/api/v1/` * GeneralOptions: `EnvironmentName: Local` * **Database Setup** * Open SQL Server management Studio (SSMS) * Create a Database named `SimpleCase` * In Visual Studio, Open Package Manager Console * Enter `dotnet tool install --global dotnet-ef` to verify you have entity framework. * Followed with `dotnet ef migration update` * In your SSMS, you should see tables now exist in `SimpleCase` * **Vue Setup** * Open Package Manager Console * Enter `cd EvidenceTool` * Then followed with `npm install` * If success done! * **Run Project** * Click IISExpress Button in Visual Studio. ## Frontend Guide (Vue & .NET) * Directory Guide * EvidenceTool -> Views (ASP.NET Page) * Accounts * Admin * Case * Client * Client Case * Home * Shared * EvidenceTool -> ClientApp (Vue) * Components * Router (path) * Services (axios requests) * Assets, Static, CSS (Media, Styles) * App.vue * boot-app.js * boot-server.js * main.js ## Backend Guide * Directory Guide * EvidenceTool -> Classes * Statup.cs (Configuration of the Website) * Program.cs (Environment Configuration) * Constant.cs (Global values) * Controllers (API route calls) * Models (Database querys [get/set] ## Process flow ![](https://i.imgur.com/TrYl982.jpg) ## Data Schema ### **Attorney to Cases** ![](https://i.imgur.com/61hidFi.png) ### **Client to Cases** ![](https://i.imgur.com/nzOp9S6.png) ### **Attorney/Client's Cases to Storage (Coconut for Videos & Azure for Images)** ![](https://i.imgur.com/cLnmVdD.png) ## API Routes Reference from Simple Case | Accounts | Methods | Functions | Response | -------- | -------- | -------- | -------- | | api/account | Default | Initial Route | | api/account/register | POST | Attorney Registration | 200 | api/account/login | POST | Attorney Sign in | 200 | api/account/reset-password | POST | Attorney Reset password | userId, code | api/account/forgot-password | POST | Attorney Forgot password | 200 | api/account/logout | POST | Attorney Sign out | 200 | api/account/me | POST(`ATTORNEY/CLIENT[JWTOKEN]`) | Dashboard view for attorney & client(require: jwtoken) | isAuthenticated, role, name, clientId | Cases | Methods | Functions | Response | -------- | -------- | -------- | -------- | | api/cases | Default | Initial Route | | api/cases/{caseId} | DELETE | Case Fetch/Removal | 200 | api/cases/{caseId} | GET `(JWTOKEN)` | Case to be Accessed by Client | 200 | api/cases/{caseId} | GET `(ATTORNEY)` | Case to be Accessed by Attorney | 200 | api/cases/{casesId} | PUT `(ATTORNEY)` | Case Create by Attorney | 200 | Allegations | Methods | Functions | Response | -------- | -------- | -------- | -------- | | api/allegations | Default | Initial Route | | api/cases/{caseId}/allegations | POST | Create Allegation to Case | 200 | api/cases/{caseId}/allegations/{allegationId} | PUT | Update Allegation from Case | 200 | api/allegations/{allegationId} | DELETE | Delete Allegation from Case | 200 | api/cases/{caseId}/allegations | GET | Fetch Allegation details | 200 | Evidences | Methods | Functions | Response | -------- | -------- | -------- | -------- | | api/cases/allegations/{allegationId}/evidences | POST | Create Evidence to Allegation | | api/cases/evidences/{evidencesId} | PUT | Update Evidence from Allegation | 200 | api/allegations/{allegationId}/evidences/{evidencesId} | DELETE | Delete Eveidence from Allegation | 200 | api/allegations/{allegationId}/evidences/{evidenceId}/activate | POST (`CLIENT | ATTORNEY`) | Activate Evidence to Allegation | 200 | api/evidences/{evidenceId}/files/{fileId} | GET (`CLIENT | ATTORNEY`) | Activate Fetch Evidence(Image/Video) to be Displayed | 200 | api/evidences/{evidenceId}/tag | PUT (`CLIENT | ATTORNEY`) | Notify Client/Attorney for the Evidence | 200 | Hearing Dates| Methods | Functions | Response | -------- | -------- | -------- | -------- | | api/hearing-dates | Default | Initial Route | 200 | api/hearing-dates/{hearingDateId} | DELETE (`ATTORNEY`) | Delete Hearing date | 200 | api/cases/{caseId}/hearing-dates | GET(`ATTORNEY`) | Fetch Hearing Date | 200 | api/cases/{caseId}/hearing-dates | POST(`ATTORNEY`) | Create Hearing Date | 200 | Client| Methods | Functions | Response | -------- | -------- | -------- | -------- | | api/cases/{caseId}/clients/{clientId}/resend-invitation | POST(`ATTORNEY`) | Send Email for Access to Client | 200 | api/cases/{caseId}/clients/{clientId}/mark-timeline-visited | PUT (`CLIENT`) | Track Client upon visiting case | 200 # How it works ## I. Creating of Cases 1. Attorney creates a cases fill up the fields 2. Then adding of Case members (clients) - Note: The added member will receive an email from the system, allowing them to access and add case allegation/evidences 3. Adding of hearing dates; a. Click the date b. Click the Add hearing date button 4. Then Save Case > Screenshot > ![](https://i.imgur.com/NfBacUr.png) ## II. Adding Allegation to Case 1. Open Cases 2. Click Add Allegation Button 3. Modal will show 4. Fill up the fields 5. Then save > Screenshot > ![](https://i.imgur.com/50rYKCV.png) ## III. Adding of Evidence to Allegation 1. Open Cases 2. Click Attach Evidence 3. Modal will show 4. Select Allegation to point the evidence 5. Fill up the details a. Image - will be stored as blob b. Video - will be uploaded to a video encoding api (Coconut.co) then returns the video link. 6. Links will only be save in the database > Screenshot > ![](https://i.imgur.com/eqzvJCo.png)