Skip to content

Commit

Permalink
Merge pull request #104 from UTDallasEPICS/Fall2023Documentation
Browse files Browse the repository at this point in the history
Fall 2023 documentation
  • Loading branch information
pariahGH authored Dec 15, 2023
2 parents 0580695 + 016cb81 commit 40570d7
Show file tree
Hide file tree
Showing 22 changed files with 361 additions and 84 deletions.
253 changes: 252 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,24 @@

Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.

## Dependency Software to Install
Nodejs, Docker, IDE with command line, Git, WSL2 (windows only)
## Setup

Make sure to install the dependencies:
Clone repsitory

Copy .env into root or fill out new keys from .env.example

Need Private keys for
- Stripe
- AWS
- Auth0
Need
- email source for AWS SES
- S3 bucket URL
- Auth0 Issuer URL

Install the dependencies:

```bash
# yarn
Expand All @@ -17,6 +32,43 @@ npm install
pnpm install --shamefully-hoist
```

## Run Docker
Start Docker Desktop
Change the director to prisma/local
Run docker compose
```bash
cd prisma/local
docker-compose up
```

## Initialize Database

Initialize Postgres DB via
```bash
npx prisma generate
```
Add first user with prisma studio with valid email that you can use
```bash
npx prisma studio
```
And add email and user role as admin for maximium privilege
And optionally add
- First name
- Last namme
- Middle name
- Phone number
or

Add first user via Postgres CLI
Enter Postgres CLI
``` bash
docker exec -it local-db-1 psql -U postgres
```
Enter first user with your email set to a usable email
``` bash
insert into user_accounts(cuid, email, first_name, last_name, user_role) values ('your_name', 'your_email', 'your_first_name', 'your_last_name','admin')
```

## Development Server

Start the development server on http://localhost:3000
Expand All @@ -40,3 +92,202 @@ npm run preview
```

Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.

## Interacting with site

Log in via the 'Login' button and use Auth0 with the previously entered email

## docker-compose.yml location
The docker-compose file is located in /prisma/local for local development

## Schema location
The schema is in prisma and is in /prisma

## UI Mockups Folder
The ui mockups are located in /figma

## Workflow diagrams
The workflow diagrams are located in /flowcharts

## Notes for the langauges of the tech stack
Notes on the current tech are located in /notes

## Current Deployment Scheme
The main and stage branches automatically deploys to pages.carsonsvillage.org and pages-staged.carsonsvillage.org respectively via an AWS EC2 instance built via GitHub actions for testing.
The deployment scripts are in /.github/workflows.

# Migration Scripts
None
Carsonsvillage.org, the previous solution, is not ever green so the data will start from scratch
on future Carson's Village's usage of this project.

# Conceptual Overview

This system is focused around advocates, families, and pages. Advocates invite families and guide them through the process of creating a memorial page. These pages contain obituaries, times, and locations. These pages are publicly viewable and searchable. Pages can receive donations, have donation goals, and have deadlines for fundraising. Family users can only access the system after being invited by an advocate. Family users have profiles. Admin distributes donations to families.

# Functional Requirements

## Edit Page
- Logged in users can create pages with the following properties filled in:
- Name
- Day of birth (optional)
- Day of passing (optional)
- Visitation (optional)
- Date
- Location
- Description
- Funeral (optional)
- Date
- Location
- Description
- Obituary
- Donation goal (optional)
- Deadline (optional)
- Images (optional)
- Images can be added
- one by one
- multiple at a time
- Viewable via image preview feature
- Images can be deleted one by one
- User can select profile picture

## Users

- There are three roles: family, dvocate, admin
- Users are invite only, regardless of roles
- Admin(s) are entered through CLI only
- Admins can do what advocates can do and only admins can
- Distribute Donations via Stripe
- Only advocates can
- Toggle Page active/inactive status
- Invite users
- See a list of all pages
- See a list of all users
- See Family Reports
- Change the role of a user
- All logged in users can
- Edit a page
- See a list of their own pages
- Only Family Users need to do onboarding for using a connected account via Stripe Connect
- Users are authenticated via Auth0
- Users receive invitation emails via AWS SES

## Family Pages

- All pages can be viewed publicly
- Pages must be publicly searchable
- Pages have
- Name
- Day of birth
- Day of passing
- Visitation
- Date
- Location
- Description
- Funeral
- Date
- Location
- Description
- Obituary
- Donation goal
- Amount donated
- Deadline
- Images
- Donations
- Processed through stripe
- Donation comments associated to a donation
- Page Replies not associated to a donation
- Page sharing links to
- Facebook
- X (formally known as Twitter)
- Mail Application

## Family Report Page
- Family Reports can be viewed by Advocates and Admin(s)
- Family Report can be downloaded to CSV
- Family Report columns are
- Page name
- Advocate Responsible name
- Donation Performance metrics
- Duration
- Donation Status
- Goal Met Date
- Donation Payout Metrics
- Owed / Goal Percentage
- Amount Owed
- Amount Paid
- Amount Raised
- Start Date
- Donation Goal

## Donation Managment Page
- Donation Managment page can only be viewed by an Admin
- Admin can distribute donations to a family page or family
- Admin can view family and page's
- total amount raised
- total amount distributed
- total amount left to distribute
- Admin can view all of family's donations

## Family Creation Page
- Admin and Advocate can create family and the first user
- First user is invited via AWS SES

## User Invite Page
- Admin and Advocate can create a user with the following properties
- Role (advocate or family)
- Select Family via listbox for family role
- First Name
- Middle Name
- Last name
- Phone number

## Home
- Every Logged in user can view their
- First, middle, last name
- Role
- Phone number

## Page List
- Advocates can view all pages of families they are responsible for
- Advocates can select family to view pages for
- Families can view all of their pages
- Page list shows
- Page name
- Donation Deadline
- link to edit
- link to view
- Only admin and advocates can view user cuid of page creator
- Show up to 12 family pages per page

## User List
- Advocates and Admins can view all users
- User List shows
- User name
- User email
- User id
- User Family name for family members
- User role
- Link to user page list of pages they created
- Show up to 12 Users per page

## Search Page
- Show up to 12 results of pages searched per page
- Search by matching any character of page name
- Show all pages with empty query

## Stack
Nuxt, postgres, prisma

## Research Questions
None

## Third party integrations

- Stripe for payments and donation payouts
- Auth0 for authentication
- AWS SES for emails

## Deployment

AWS EC2
18 changes: 13 additions & 5 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,26 @@ This system is focused around advocates, families, and pages. Advocates invite f

## Users

- There are two roles: family and advocate
- There are three roles: family, advocate, admin
- Users are invite only, regardless of roles
- Admin(s) are entered through CLI only
- Admins can do what advocates can do and only admins can
- Distribute Donations via Stripe
- Only advocates can
- Toggle Page active/inactive status
- Invite users
- See a lit of all pages
- See a list of all pages
- See a list of all users
- See Family Reports
- Change the role of a user
- All users can
- All logged in users can
- Edit a page
- See a list of their own pages
- Only Family Users need to do onboarding for using a connected account via Stripe Connect
- Users are authenticated via Auth0
- Users receive invitation emails via AWS SES

## Pages
## Family Pages

- All pages can be viewed publicly
- Pages must be publicly searchable
Expand Down Expand Up @@ -50,9 +57,10 @@ None

## Third party integrations

- Stripe for payments
- Stripe for payments, Donation Distribution
- Auth0 for authentication
- AWS SES for emails
- Constant Contacts for newsletter integration

## Deployment

Expand Down
3 changes: 1 addition & 2 deletions components/DonationEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ const donationData = ref<PageDonation>({
amount: 0,
success: false,
cuid: "",
userCuid: "",
pageCuid: props.pageCuid,
familyCuid: "",
familyCuid: props.familyCuid,
transaction_id : "",
donorFirstName: "",
donorLastName: "",
Expand Down
Binary file added figma/Reports_Mockup-3.fig
Binary file not shown.
Binary file added figma/comment-system.fig
Binary file not shown.
1 change: 1 addition & 0 deletions flowcharts/Donation Distribution.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile host="app.diagrams.net" modified="2023-10-03T20:39:32.471Z" agent="5.0 (Windows)" etag="hwypkoZdZylDIPno1AAq" version="20.7.4" type="google" pages="2"><diagram id="C5RBs43oDa-KdzZeNtuy" name="Page-1">7Vpdc9o6EP01TNqHMtgGGx4DJGl6mzYNaXLzKGyBHWSLSuYrv/6uZPnbAUqhIblhhoy1Xkuyztk9K5Ga0fOXFwxN3SvqYFLTG2PmOTWjX9N1Db5gmKIxzhmEx8B7io0NZZ15DuY5x5BSEnrTvNGmQYDtMGdDjNFF3m1ESXkaAxsRXLLee07oRta2bqX2z9gbu/FAmtmJ7vgodlYT5y5y6CJjMs5qRo9RGkZX/rKHiViZeF3uL1f35OvEvPjyg/9CP7v/3H67+xR1dv47jySvwHAQ7rdrPep6jshMrZd613AVLyCjs8DBopNGzei6oU/gUoPLRxyGK4UvmoUUTJSFLh3TAJGvlE6V34gGoXLTRBsHzqnAEdpDQu1JZDr3CFFjQEv5t6HFQ0YnCXaigwQI4UzQEJMusidjOdEeJZTBrYAGWHTlABnUu6STO0ut3eh9hV+BLxsWW/lxOmM2XuNnKIojNsbr+jMTRkGcYerjkK3gOYYJCr15fnJIhcA48UtxhwsF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kxhJpSGDDxYoyZYR09DHnEdK36KkoFhg2Hyx1envFQadQHxpNra6X88jh6oPzaaf19P2SPl6snmh3MDEZM7b8+eWN70fx0gv/FZ6QrqPWg+pEXPeX8YiisUqGh+XPPCSaD9l76WOytcrRay9733Vqnd36Pi8gL7DzTX1UXBiaVW82NTP55KPEMut6J/MpCGq0HqrLdaN0CtFnteqNbL/5bqPlK3W7w7a9MurejxnToNMyIZcG4Kagy4VcGoFHHnTP/b76EieapRDpFHavRkevd9p6q6E+hUG3jTxNM4vCVxCzZ4INuIpWGbepcOCHCMf3Q9k/iK1d4niP8bj21GNzQB6LCppWMfha9Y65W8RZxYCr6GtngYNm+i+DkXv6X5XG2X8=</diagram><diagram id="Ol_U8AilV8itlYAB7Xan" name="Page-2">dZBND8IgDIZ/DXcGMfE+p1487eCZjDpIGF0YZou/XhbASaaHJu3Ttx95Ca+H5eLEqG4owRBGe6cl4SfCWBUigFH0UIBV0epXhjTRp5YwFUKPaLweS9ihtdD5ggnncC5lDzT7N9pOGNjRu5ZeRXo80I1fQfcqH6po6gwiixOYlJA4fyHeEF47RB+zYanBrM5kX+Lc+U/385gD638MhGTbHYrCft68AQ==</diagram></mxfile>
Binary file not shown.
Binary file not shown.
3 changes: 1 addition & 2 deletions pages/EditFamily.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ const cvuser2 = useCookie<User>('cvuser')
const data_family = ref<Family>({
cuid: "",
Stripe_Account_id: "",
Stripe_Accont_cuid: "",
stripe_account_id: "",
created_at: Date.toString(),
updated_at: "",
family_name: "",
Expand Down
6 changes: 3 additions & 3 deletions pages/EditPage/[EditPageId].vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
} from '@headlessui/vue'
import type { Image, Page, User } from '@/types.d.ts'
import type { Image, Page, User, PageDonation } from '@/types.d.ts'
import { Family } from "@prisma/client"
import { donationFormat, dateFormat } from '@/utils'
Expand Down Expand Up @@ -55,7 +55,7 @@ const data = ref<Page>({
duration: "0 days",
start_date: "",
goal_met_date: "",
PageDonations: [],
PageDonations: ref<PageDonation[]>([]).value,
Reply: [],
})
Expand All @@ -73,7 +73,7 @@ type User2 = {
}
const data_family = ref<Family>({
cuid: "",
stripe_account_id: "",
Stripe_Account_id: "",
created_at: "",
updated_at: Date.toString(),
family_name: "",
Expand Down
3 changes: 1 addition & 2 deletions pages/EditUser/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ const data_user = ref<User>({
const familyCuid = ref("")
const data_family = ref<Family>({
cuid: "",
Stripe_Account_id: "",
Stripe_Accont_cuid: "",
stripe_account_id: "",
created_at: "",
updated_at: Date.toString(),
family_name: "",
Expand Down
3 changes: 1 addition & 2 deletions pages/FamilyReports.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ div
const data_family = ref<Family>({
cuid: '',
family_name: '',
Stripe_Account_id: null,
Stripe_Accont_cuid: null,
stripe_account_id: null,
created_at: '',
updated_at: '',
advocateCuid: '',
Expand Down
Loading

0 comments on commit 40570d7

Please sign in to comment.