Skip to content

Commit 2a09fe3

Browse files
MeghP89devksingh4
andauthored
Build initial RSVP frontend (#1)
* feat: initial features created * Merge branch 'main' of https://github.com/acm-uiuc/rsvp * Setup Cloudflare Pages deployment * Fix env var * fix: made github builds better by removing .env and using config.ts, better data loading * rebased * fixed build output dir * Fix pipeline * fixed config.ts file * fixed deployment * fixed deploy.yml * fixed deploy.yml * fixed turnstile key configs * Use shared action for CF deploy * Fix composite workflow * added qr code scanner as well * linting fixes * fixed qr code * fixed style * added identity sync * yarn lock file fixed * rebuild lockfile cleanly * fixed deploy * fixed auth sync * made identity sync work better * refined ui * finished several ui changes * fixed request id * fixed request id * fixed make file again * added node sdk integration * Untrack .yarn folder * fixed nits * fixed nits * fixed favicon * bug fixes * better filtering for events added * fixed final nits --------- Co-authored-by: Dev Singh <dev@devksingh.com>
1 parent c4df7da commit 2a09fe3

57 files changed

Lines changed: 6730 additions & 134 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ updates:
3535
- "*"
3636
update-types:
3737
- "minor"
38-
- "patch"
38+
- "patch"

.github/workflows/deploy.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+
name: "Deployment"
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
jobs:
11+
deploy:
12+
permissions:
13+
contents: read
14+
deployments: write
15+
pull-requests: write
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 10
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 22.x
23+
cache: "yarn"
24+
- name: Restore Yarn Cache
25+
uses: actions/cache@v4
26+
with:
27+
path: node_modules
28+
key: yarn-modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-dev
29+
restore-keys: |
30+
yarn-modules-${{ runner.arch }}-${{ runner.os }}-
31+
- name: Install dependencies
32+
run: yarn install --immutable
33+
- name: Build website
34+
run: yarn build
35+
env:
36+
VITE_RUN_ENVIRONMENT: ${{ github.ref == 'refs/heads/main' && 'prod' || 'dev' }}
37+
- name: Deploy to Cloudflare
38+
uses: acm-uiuc/actions/.github/actions/cloudflare-pages-deploy@main
39+
with:
40+
build-directory: build/
41+
project-name: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
42+
account-id: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
43+
pages-api-token: ${{ secrets.PAGES_API_TOKEN }}

.github/workflows/review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ jobs:
5151
teams:
5252
- "officers"
5353
- "infra-chairs"
54-
- "infra-leads"
54+
- "infra-leads"

.gitignore

Lines changed: 16 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -4,136 +4,22 @@ logs
44
npm-debug.log*
55
yarn-debug.log*
66
yarn-error.log*
7+
pnpm-debug.log*
78
lerna-debug.log*
89

9-
# Diagnostic reports (https://nodejs.org/api/report.html)
10-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11-
12-
# Runtime data
13-
pids
14-
*.pid
15-
*.seed
16-
*.pid.lock
17-
18-
# Directory for instrumented libs generated by jscoverage/JSCover
19-
lib-cov
20-
21-
# Coverage directory used by tools like istanbul
22-
coverage
23-
*.lcov
24-
25-
# nyc test coverage
26-
.nyc_output
27-
28-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29-
.grunt
30-
31-
# Bower dependency directory (https://bower.io/)
32-
bower_components
33-
34-
# node-waf configuration
35-
.lock-wscript
36-
37-
# Compiled binary addons (https://nodejs.org/api/addons.html)
38-
build/Release
39-
40-
# Dependency directories
41-
node_modules/
42-
jspm_packages/
43-
44-
# Snowpack dependency directory (https://snowpack.dev/)
45-
web_modules/
46-
47-
# TypeScript cache
48-
*.tsbuildinfo
49-
50-
# Optional npm cache directory
51-
.npm
52-
53-
# Optional eslint cache
54-
.eslintcache
55-
56-
# Optional stylelint cache
57-
.stylelintcache
58-
59-
# Optional REPL history
60-
.node_repl_history
61-
62-
# Output of 'npm pack'
63-
*.tgz
64-
65-
# Yarn Integrity file
66-
.yarn-integrity
67-
68-
# dotenv environment variable files
69-
.env
70-
.env.*
71-
!.env.example
72-
73-
# parcel-bundler cache (https://parceljs.org/)
74-
.cache
75-
.parcel-cache
76-
77-
# Next.js build output
78-
.next
79-
out
80-
81-
# Nuxt.js build / generate output
82-
.nuxt
10+
node_modules
8311
dist
84-
85-
# Gatsby files
86-
.cache/
87-
# Comment in the public line in if your project uses Gatsby and not Next.js
88-
# https://nextjs.org/blog/next-9-1#public-directory-support
89-
# public
90-
91-
# vuepress build output
92-
.vuepress/dist
93-
94-
# vuepress v2.x temp and cache directory
95-
.temp
96-
.cache
97-
98-
# Sveltekit cache directory
99-
.svelte-kit/
100-
101-
# vitepress build output
102-
**/.vitepress/dist
103-
104-
# vitepress cache directory
105-
**/.vitepress/cache
106-
107-
# Docusaurus cache and generated files
108-
.docusaurus
109-
110-
# Serverless directories
111-
.serverless/
112-
113-
# FuseBox cache
114-
.fusebox/
115-
116-
# DynamoDB Local files
117-
.dynamodb/
118-
119-
# Firebase cache directory
120-
.firebase/
121-
122-
# TernJS port file
123-
.tern-port
124-
125-
# Stores VSCode versions used for testing VSCode extensions
126-
.vscode-test
127-
128-
# yarn v3
129-
.pnp.*
130-
.yarn/*
131-
!.yarn/patches
132-
!.yarn/plugins
133-
!.yarn/releases
134-
!.yarn/sdks
135-
!.yarn/versions
136-
137-
# Vite logs files
138-
vite.config.js.timestamp-*
139-
vite.config.ts.timestamp-*
12+
dist-ssr
13+
*.local
14+
.yarn
15+
16+
# Editor directories and files
17+
.vscode/*
18+
!.vscode/extensions.json
19+
.idea
20+
.DS_Store
21+
*.suo
22+
*.ntvs*
23+
*.njsproj
24+
*.sln
25+
*.sw?

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

README.md

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,69 @@
1-
# rsvp
2-
Website for UIUC students to RSVP to ACM @ UIUC events.
1+
# ACM @ UIUC — RSVP Portal
2+
3+
Frontend for the ACM @ UIUC event RSVP system. Built with React, TypeScript, Vite, and Mantine UI.
4+
5+
## Stack
6+
7+
- **React 19** + **TypeScript**
8+
- **Vite** — dev server and bundler
9+
- **Mantine v8** — UI components and notifications
10+
- **`@acm-uiuc/core-client`** — typed SDK for the Core API
11+
- **`@azure/msal-react`** — Microsoft SSO authentication
12+
- **Cloudflare Turnstile** — bot protection on RSVP/cancel/profile actions
13+
- **React Router v7** — client-side routing
14+
15+
## Getting Started
16+
17+
```bash
18+
yarn install
19+
yarn dev # local-dev (points to QA API)
20+
yarn dev:qa # dev build against QA API
21+
```
22+
23+
## Build
24+
25+
```bash
26+
yarn build # production build
27+
yarn build:dev # dev environment build
28+
yarn build:prod # production environment build
29+
yarn typecheck # type-check without emitting
30+
```
31+
32+
## Environments
33+
34+
Configured in `src/config.ts` via `VITE_RUN_ENVIRONMENT`:
35+
36+
| Environment | Value | API |
37+
|-------------|-------------|----------------------------------|
38+
| Local dev | `local-dev` | `core.aws.qa.acmuiuc.org` |
39+
| QA/Dev | `dev` | `core.aws.qa.acmuiuc.org` |
40+
| Production | `prod` | `core.acm.illinois.edu` |
41+
42+
## Project Structure
43+
44+
```
45+
src/
46+
├── common/
47+
│ ├── types/ # Shared types (re-exported from SDK + enrichment types)
48+
│ └── utils/ # apiError, notifyError helpers
49+
├── components/
50+
│ ├── AuthContext/ # MSAL auth provider + useAuth()
51+
│ ├── EventsContext/ # Fetches all events on mount; useEvents()
52+
│ ├── ProfileContext/ # Fetches RSVP profile after auth; useProfile()
53+
│ ├── RsvpsContext/ # Fetches user RSVPs, enriches with event data; useRsvps()
54+
│ ├── Layout/ # MainLayout shell
55+
│ └── Logo/
56+
├── pages/
57+
│ ├── events/ # Upcoming events list + RSVP flow
58+
│ ├── rsvps/ # My RSVPs (view, cancel)
59+
│ ├── profile/ # RSVP profile create/edit
60+
│ └── Home.page.tsx # Dashboard
61+
└── App.tsx / Router.tsx / main.tsx
62+
```
63+
64+
## Architecture Notes
65+
66+
- **Context-based caching**`EventsContext`, `ProfileContext`, and `RsvpsContext` each fetch once and expose a `refetch()` for manual refresh. Provider order in `main.tsx`: `Auth → Events → Profile → RSVPs`.
67+
- **SDK usage** — all API calls go through `@acm-uiuc/core-client`. Auth tokens (`xUiucToken`) and Turnstile tokens (`xTurnstileResponse`) are passed as typed request parameters, not headers.
68+
- **Empty-body responses** — RSVP POST and DELETE return 201/200 with empty bodies. Use the `Raw` SDK variant (`apiV1Rsvp...Raw`) and skip `.value()` to avoid JSON parse errors.
69+
- **Error notifications** — all errors surface via `showApiErrorNotification()` (`src/common/utils/notifyError.tsx`) which shows a Mantine notification with the error title, message, optional request ID, and a mailto report link.

eslint.config.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
import { defineConfig, globalIgnores } from 'eslint/config'
7+
8+
export default defineConfig([
9+
globalIgnores(['dist']),
10+
{
11+
files: ['**/*.{ts,tsx}'],
12+
extends: [
13+
js.configs.recommended,
14+
tseslint.configs.recommended,
15+
reactHooks.configs.flat.recommended,
16+
reactRefresh.configs.vite,
17+
],
18+
languageOptions: {
19+
ecmaVersion: 2020,
20+
globals: globals.browser,
21+
},
22+
},
23+
])

index.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
6+
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
7+
<link rel="manifest" href="/site.webmanifest" />
8+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
9+
<title>RSVP Portal</title>
10+
</head>
11+
<body>
12+
<div id="root"></div>
13+
<script type="module" src="/src/main.tsx"></script>
14+
</body>
15+
</html>

package.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "rsvp",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "cross-env VITE_RUN_ENVIRONMENT=local-dev vite",
8+
"dev:qa": "cross-env VITE_RUN_ENVIRONMENT=dev vite",
9+
"build": "tsc && vite build",
10+
"build:dev": "cross-env VITE_RUN_ENVIRONMENT=dev tsc && vite build",
11+
"build:prod": "cross-env VITE_RUN_ENVIRONMENT=prod tsc && vite build",
12+
"preview": "cross-env VITE_RUN_ENVIRONMENT=local-dev vite preview",
13+
"typecheck": "tsc --noEmit",
14+
"lint": "eslint . --ext .ts,.tsx --report-unused-disable-directives --max-warnings 0",
15+
"test": "npm run typecheck && npm run lint"
16+
},
17+
"dependencies": {
18+
"@acm-uiuc/core-client": "^4.8.2",
19+
"@acm-uiuc/js-shared": "^3.8.1",
20+
"@azure/msal-browser": "^4.28.0",
21+
"@azure/msal-react": "^3.0.24",
22+
"@mantine/core": "^8.3.12",
23+
"@mantine/hooks": "^8.3.12",
24+
"@mantine/notifications": "^8.3.12",
25+
"@marsidev/react-turnstile": "^1.4.1",
26+
"@tabler/icons-react": "^3.36.1",
27+
"@tailwindcss/vite": "^4.1.18",
28+
"react": "^19.2.0",
29+
"react-dom": "^19.2.0",
30+
"react-qr-code": "^2.0.18",
31+
"react-router-dom": "^7.12.0",
32+
"tailwindcss": "^4.1.18"
33+
},
34+
"devDependencies": {
35+
"@eslint/js": "^9.39.1",
36+
"@types/node": "^24.10.1",
37+
"@types/react": "^19.2.5",
38+
"@types/react-dom": "^19.2.3",
39+
"@vitejs/plugin-react": "^5.1.1",
40+
"cross-env": "^10.1.0",
41+
"eslint": "^9.39.1",
42+
"eslint-plugin-react-hooks": "^7.0.1",
43+
"eslint-plugin-react-refresh": "^0.4.24",
44+
"globals": "^16.5.0",
45+
"typescript": "~5.9.3",
46+
"typescript-eslint": "^8.46.4",
47+
"vite": "^7.2.4"
48+
}
49+
}

public/android-chrome-192x192.png

13.2 KB
Loading

0 commit comments

Comments
 (0)