Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge prod #105

Merged
merged 48 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
a4e4c8d
Started to implement the families table backend and added admin role.
OfekShaltiel-UTD Oct 21, 2023
756d586
created basic logic and code for family onboarding
mshalom21 Oct 21, 2023
7ef8cc5
Changed family page ux when there is no funeral information or no vis…
OfekShaltiel-UTD Oct 23, 2023
c1cd2b1
initial design of donation reply system
Oct 25, 2023
b7c659f
Added advocateResponsible field to the family table.
OfekShaltiel-UTD Oct 26, 2023
4cf80cf
Implemented and integrated the family creation route, integrated page…
OfekShaltiel-UTD Nov 3, 2023
e182e94
family onboarding updated version wiht Taz corrections and logic upd…
mshalom21 Nov 4, 2023
99368c7
clean up schema a bit
Nov 4, 2023
fdf0f97
backend connection for donation reply system
Nov 6, 2023
d3cd48a
Migrated EditPage, PageList, Donation Mangement Page, Family Pages to…
OfekShaltiel-UTD Nov 8, 2023
c1af6d1
tweak some db stuff
Nov 8, 2023
e3e3ce9
backend connection for page reply system
Nov 9, 2023
ae033e5
updated family branch logic and updated auth page per request
mshalom21 Nov 12, 2023
8e54d50
updated family branch logic and auth.ts logic per Taz and Ofek Requests
mshalom21 Nov 14, 2023
a05b815
altered auth.ts page per Ofek Request
mshalom21 Nov 14, 2023
df1af89
Merge branch 'userVsFamily' of ssh://github.com/UTDallasEPICS/carson-…
Nov 15, 2023
4e9ee56
Changed instances of familyCuid refering to users to userCuid and ins…
OfekShaltiel-UTD Nov 15, 2023
69b0709
clean up links
Nov 15, 2023
21cc88b
resolve merge conflict
Nov 15, 2023
469153a
Merge pull request #92 from UTDallasEPICS/userVsFamily
pariahGH Nov 15, 2023
d248986
Merge branch 'stage' into family_onboardingbranch
pariahGH Nov 15, 2023
4aa027e
Merge pull request #91 from UTDallasEPICS/family_onboardingbranch
pariahGH Nov 15, 2023
14718c0
render comments and replies
Nov 16, 2023
4d73e23
Fixed Family Reports, implemented download for csv, improved donation…
OfekShaltiel-UTD Dec 2, 2023
de6d94e
finalized comment system and reply system
Dec 6, 2023
f8a7a11
minor updates
Dec 7, 2023
8db4dcb
Merge branch 'stage' into FamilyReportsDownload
pariahGH Dec 7, 2023
09a5dca
Merge pull request #93 from UTDallasEPICS/FamilyReportsDownload
pariahGH Dec 7, 2023
b76b884
Merge branch 'stage' into commentSystemBranch
Dec 7, 2023
932a941
Merge pull request #98 from UTDallasEPICS/commentSystemBranch
pariahGH Dec 7, 2023
56a365d
fix up merge
Dec 7, 2023
4f77592
Merge branch 'stage' of ssh://github.com/UTDallasEPICS/carson-s-villa…
Dec 7, 2023
fa089d7
Implemented pagination for users page and fixed upper bound/length fo…
OfekShaltiel-UTD Dec 7, 2023
2d4dd2d
tweak family create a bit
Dec 8, 2023
f24c9d4
Merge branch 'stage' into Pagination
Dec 8, 2023
824f25c
Merge pull request #99 from UTDallasEPICS/Pagination
pariahGH Dec 8, 2023
62663fd
Added pagination for page list, social media share links, and ability…
OfekShaltiel-UTD Dec 10, 2023
ef86f3d
added donation amount to comments
Dec 10, 2023
633af8d
Merge pull request #101 from UTDallasEPICS/commentSystemBranch
pariahGH Dec 11, 2023
3f71109
Merge branch 'stage' into ExtendedPagination
Dec 11, 2023
9849fae
Merge pull request #100 from UTDallasEPICS/ExtendedPagination
pariahGH Dec 11, 2023
6ced52b
added donationFormat to comment amount to properly display amount
Dec 11, 2023
fe4752e
Merge pull request #102 from UTDallasEPICS/commentSystemBranch
pariahGH Dec 11, 2023
0580695
clean up image usage
Dec 11, 2023
2677fb5
Added end of semester documentation and resolved post merge issues
OfekShaltiel-UTD Dec 12, 2023
2feaf7f
fixed ReadMe.md
OfekShaltiel-UTD Dec 12, 2023
016cb81
Merge branch 'stage' into Fall2023Documentation
pariahGH Dec 15, 2023
40570d7
Merge pull request #104 from UTDallasEPICS/Fall2023Documentation
pariahGH Dec 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
NUXT_AUTH0_CLIENTID=rizpj6JWOjTuo9YRACPPSmR9ffmZ1Xnk
NUXT_AUTH0_SECRET='example_auth0_secret'
NUXT_BASEURL=http://localhost:3000/
NUXT_ISSUER=https://dev-o5pmpav6snak56qc.us.auth0.com/
NUXT_STRIPE_PUBLIC=pk_test_bG0z4rdRUTA25QUTo0tuXCwX
NUXT_STRIPE_SECRET='example_stripe_secret'
NUXT_AWS_S3_BUCKET_NAME=images-dev.carsonsvillage.org
[email protected]

AWS_ACCESS_KEY_ID=AKIAT4QWIMWMZ3KXGZ62
AWS_SECRET_ACCESS_KEY='example_aws_secret_access_key'
DATABASE_URL=postgresql://postgres:[email protected]:11111/postgres
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
12 changes: 6 additions & 6 deletions components/CVFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ div
img(src='/footer.png')
div.absolute(style="margin-left: auto;margin-right: auto; left: 0;right: 0; text-align: center;")
LinkButton.absolute.bottom-4.mx-auto.text-md(class="left-1/2" to='https://carsonsvillage.org/contact-us/') Contact Us
div.bg-black(style="align-content: center;")
div.flex(style="color: gray; font-weight: 700;justify-content:center")
label Copyright 2023 Carson's Village | 
.col
NuxtLink(to='https://carsonsvillage.org/privacy-policy/') Privacy Policy

div.bg-black.flex(style="color:gray; font-weight: 700; justify-content:center; align-items: center; height: 100px;")
label COPYRIGHT 2023 CARSON'S VILLAGE | 
.col
NuxtLink(to='https://carsonsvillage.org/privacy-policy/') PRIVACY POLICY | 
.col
NuxtLink(to='https://carsonsvillage.org/carsons-village-non-discriminatory-statement/') CARSON’S VILLAGE NON-DISCRIMINATORY STATEMENT
</template>

<style scoped></style>
14 changes: 10 additions & 4 deletions components/CVHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import type { User, Page } from "@/types.d.ts"
import { donationFormat, dateFormat } from '@/utils'
const cvuser = useCookie<User>('cvuser');
const cvtoken = useCookie('cvtoken');
const isAdmin = computed(() => cvuser.value?.user_role == "advocate")
const isAdmin = computed(() => cvuser.value?.user_role == "advocate" || cvuser.value?.user_role == "admin")
const cuid = computed(() => cvuser.value?.cuid)
const familyCuid = computed(() => cvuser.value?.familyCuid)
const isLoggedIn = computed(() => cvuser.value)
const pages = ref<Page[]>([])
const searchQuery = ref('');
Expand All @@ -22,19 +23,24 @@ ClientOnly
href="/api/logout"
)
p.uppercase.white.w-max LOGOUT
NavLinkButton(:to="`/PageList/${cuid}`")
p.uppercase.white.w-max(v-if="isAdmin") Pages
p.uppercase.white.w-max(v-else) Pages
NavLinkButton(:to="`/PageList/${cuid}/?fromUsers=0`" v-if="isAdmin")
p.uppercase.white.w-max Pages
NavLinkButton(:to="`/pageList/${familyCuid}/?fromUsers=0`" v-if="!isAdmin")
p.uppercase.white.w-max Pages
NavLinkButton(to='/EditPage/0')
p.uppercase.white.w-max New page
NavLinkButton( v-if="isAdmin" to='/Users')
p.uppercase.white.w-max Users
NavLinkButton( v-if="isAdmin" to='/EditUser/0')
p.uppercase.white.w-max Invite user
NavLinkButton( v-if="isAdmin" to='/EditFamily')
p.uppercase.white.w-max Create Family
NavLinkButton(to="/")
p.uppercase.white.w-max Home
NavLinkButton(v-if="isAdmin" to='/FamilyTransactionList')
p.uppercase.white.w-max Donations
NavLinkButton(v-if="isAdmin" to='/FamilyReports')
p.uppercase.white.w-max FamilyReports
div.max-w-min.mx-auto.flex.gap-2(v-else)
a.items-center.px-2.py-2.text-base.font-medium.rounded-md.text-green-600.cursor-pointer(style="border: 1px solid #c4c4c4;"
class='hover:text-white hover:bg-gray-600'
Expand Down
Loading
Loading