Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ jobs:
node-version: "20"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Install frontend dependencies
run: npm ci --prefix frontend
- name: Run checks
run: npm run gitcheck
37 changes: 24 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
# Environment & secrets
# Environment and secrets
.env
.env.local
.env.*.local
.env.*
!.env.example
.envrc

# Supabase local state
.supabase
# Dependencies
node_modules/
/package-lock.json

# Node/Vercel build output placeholders (anticipating Next.js stack)
.next
out
node_modules
coverage
.vercel
# Build and tool output
.next/
out/
build/
coverage/
.vercel/
.supabase/
*.tsbuildinfo
next-env.d.ts

# OS/Editor cruft
# Logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# OS and editor files
.DS_Store
Thumbs.db
*.swp
*.log
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ node_modules
out
.supabase
coverage
build
.vercel
**/package-lock.json
3 changes: 0 additions & 3 deletions .vscode/extensions.json

This file was deleted.

25 changes: 0 additions & 25 deletions .vscode/settings.json

This file was deleted.

69 changes: 34 additions & 35 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
# Repository Guidelines

## Project Structure & Module Organization
- `frontend/` — Next.js 16 app (App Router). Key files: `app/page.tsx`, `app/layout.tsx`, `app/globals.css`. Shared configs: `eslint.config.mjs`, `tsconfig.json`, `next.config.ts`.
- `supabase/` — database migrations and CLI setup (see `supabase/README.md`); apply schema via Supabase CLI.
- `docs/` — contributor and process docs. Root files (`PRD.md`, `Note_Sharer_Tech_Stack.md`, `project-charter.md`) capture product intent.
- UI system source of truth: `docs/ui-system.md`. Follow its terminology and component rules before introducing new UI or copy changes.
- Keep new UI/features in `frontend/app/<feature>`; colocate helpers with components. Place future tests beside modules or under `frontend/__tests__`.

## Build, Test, and Development Commands
- Install deps: `cd frontend && npm install`.
- Local dev: `npm run dev` (Next.js with fast refresh). Uses `.env.local` for env vars.
- Build: `npm run build` (ensures production readiness) then `npm run start` to smoke-test the build.
- Lint: `npm run lint` (Next + ESLint rules).
- Supabase: `cd supabase && supabase link --project-ref prwaxvxppcbnoqwcvcjn` then `supabase db push` to apply migrations.

## Coding Style & Naming Conventions
- TypeScript, React 19, Next App Router. Prefer server components unless client features are required.
- Functional components only; PascalCase for components/hooks, camelCase for helpers, kebab-case for files and routes.
- Keep styling in dedicated files (route-scoped CSS like `app/auth/auth.css` or shared globals); use class names instead of inline utility chains for new UI.
- 2-space indentation; keep imports ordered (framework → libraries → project paths). Run `npm run lint` before PRs.

## Testing Guidelines
- No automated suite yet. For new work, add component/route tests (e.g., Jest/Testing Library or Playwright) under `frontend/__tests__` or alongside components.
- Name tests after the unit or page they cover (`<component>.test.tsx`). Ensure critical flows (auth, uploads, credit transfers) gain coverage as they land.

## Commit & Pull Request Guidelines
- Use Conventional Commits (`feat: add upload form`, `fix: handle expired token`). Keep commits scoped and readable.
- Branch from `main`; keep changes small and focused. Reference issue IDs in commit bodies when applicable.
- PRs: fill out the template, link related issues, and add before/after notes or screenshots for UI changes. Mention any migrations or env var changes explicitly.

## Supabase & Configuration Tips
- Copy `.env.local` (not committed) and set `NEXT_PUBLIC_SUPABASE_URL` + `NEXT_PUBLIC_SUPABASE_ANON_KEY`; add server-only keys (`SUPABASE_SERVICE_ROLE_KEY`, `SUPABASE_JWT_SECRET`) if needed for server actions.
- Protect secrets: never commit generated `.env*` files. Rotate keys if leaked.
- Before pushing schema changes, run `supabase db lint`; for drift, use `supabase db pull`. Document new migrations in PRs.
# Agent Guide

Be a collaborator, not a drive-by editor. Understand the product before changing it.

## Before Changing Code

- Read `README.md`.
- Read the docs in `docs/`.
- Check the current branch and working tree.
- Understand the route, API, and product flow your change touches.
- Ask a short question if the prompt is genuinely ambiguous.

## How To Work

- Interpret prompts generously, but stay inside scope.
- Preserve existing functionality unless the user explicitly asks to change it.
- Prefer simple, human names.
- Prefer branches with no prefix, like `docs-cleanup` or `upload-preview-fix`.
- Keep the high-level product vision in mind: useful campus note sharing, clear credit rules, student trust.
- Make changes that improve code and architecture quality without reinventing the app.

## Quality Bar

- Use existing project patterns before adding new ones.
- Keep auth, credit, storage, and moderation behavior deliberate.
- Do not leave stale comments or dead docs behind.
- Add tests when changing shared logic or risky behavior.
- Run `npm run gitcheck` before calling work done.

## Communication

- Explain tradeoffs plainly.
- Call out second-order effects before making risky changes.
- Do not work on unrelated cleanup just because you noticed it.
121 changes: 65 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,90 @@
# Note Sharer
# Poly Pages

Note Sharer is a campus‑specific marketplace where students upload high‑quality notes, Quizlet sets, syllabi, and other course resources. Contributors earn credits from uploads and upvotes, then spend those credits to access others' materials—solving the free‑rider problem and reducing reliance on paywalled platforms like Chegg or Brainly.
Poly Pages is a full-stack note-sharing platform for Cal Poly SLO students. Students upload class notes, earn credits when their work is approved, and spend credits to unlock useful study material from other students.

## Overview
The project combines a searchable Cal Poly course catalog, `@calpoly.edu` email verification, PDF uploads, private Supabase storage, generated previews, a credit economy, voting, bookmarks, leaderboard stats, and moderator tools. It is built like a real campus product: useful to students, scoped to one school, and designed with academic-integrity guardrails.

### Purpose
[polypages.dev](https://www.polypages.dev/)

Students struggle to find consolidated, high‑quality, course‑specific study resources. Existing solutions (group chats, random Drive folders, or paywalled sites) are fragmented, low‑signal, and don't reward contributors—creating a free‑rider dynamic and uneven quality. A campus‑scoped platform with aligned incentives is needed to increase the supply of high‑quality materials without charging cash. Finally, this application will reduce the unfair advantage held by members of some Greek life organizations that share study materials exclusively among their members.
![Poly Pages landing page](docs/assets/readme/landing-desktop.png)

### Team
## What It Does

- [First Last](https://www.linkedin.com/) - Project Manager
- [Joshua Panicker](https://www.linkedin.com/in/joshua-panicker-32610a2b0) - Tech Lead
- [Jonah Chan](https://www.linkedin.com/in/jonah-chan) - Tech Lead
- [Isaiah Cortez](https://www.linkedin.com/in/isaiah-cortez9/) - Designer
- [Noah Gullo](https://www.linkedin.com/in/noah-gullo) - Developer
- [Victor Xie](https://www.linkedin.com/in/victor-xie-767626301/) - Developer
- [Moe Aung](https://www.linkedin.com/) - Developer
- [Wieland Rodriguez](https://www.linkedin.com/in/wieland-rodriguez) - Developer
- [Emma Walker](https://www.linkedin.com/) - Developer
- Uses `@calpoly.edu` email verification to keep the community campus-scoped.
- Lets students browse courses, upload PDFs, preview resources, bookmark notes, and download with credits.
- Rewards contribution through upload credits, voting, profile stats, and leaderboard activity.
- Gives moderators a review surface for resources, reports, users, and promotions.
- Keeps original files private and serves access through app-controlled signed URLs.

## Getting Started
## CodeBox

The fastest way to get up and running is the setup script. It checks your local
dependencies, verifies environment variables, installs packages, and then starts
the dev server only when everything looks good.
Poly Pages was built through CodeBox, a Cal Poly student software club. CodeBox teams work like small product teams: PMs, designers, tech leads, and developers build real apps together over the year.

```bash
npm run setup
```
## Tech Stack

- Next.js 16, React 19, TypeScript
- Supabase Auth, Postgres, and Storage
- Resend for email
- Jest for focused unit tests
- ESLint and Prettier for code quality

### What the setup script checks
- Node.js is installed and prints the version.
- Supabase CLI is installed (or it will tell you how to install it).
- Required environment variables exist in `frontend/.env.local`.
- Frontend dependencies are installed.
## Team

| Name | Role | Links |
| --- | --- | --- |
| Anthony Orozco | Product Manager | - |
| Joshua Panicker | Tech Lead | [LinkedIn](https://www.linkedin.com/in/joshua-panicker-32610a2b0), [GitHub](https://github.com/joshuapanicker) |
| Jonah Chan | Tech Lead | [LinkedIn](https://www.linkedin.com/in/jonah-chan), [GitHub](https://github.com/p1an0guy) |
| Isaiah Cortez | Designer | [LinkedIn](https://www.linkedin.com/in/isaiah-cortez9/), [GitHub](https://github.com/isaiah600) |
| Noah Gullo | Developer | [LinkedIn](https://www.linkedin.com/in/noah-gullo), [GitHub](https://github.com/Noah-Gullo) |
| Victor Xie | Developer | [LinkedIn](https://www.linkedin.com/in/victor-xie-767626301/), [GitHub](https://github.com/XieVic978), [GitHub alt](https://github.com/xievic9780) |
| Carter Lim | Developer | [GitHub](https://github.com/carter-a-lim) |
| Emma Walker | Developer | [GitHub](https://github.com/ema-png) |
| Wieland Rodriguez | Developer | [LinkedIn](https://www.linkedin.com/in/wieland-rodriguez), [GitHub](https://github.com/wielandrod) |

## Contributing

### Supabase CLI install (Windows)
Run this in PowerShell:
Install:

```powershell
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
iwr -useb get.scoop.sh | iex
scoop install supabase
- Node.js 20.9+
- npm
- Supabase CLI for `npm run setup`

Ask a lead for the values needed in `frontend/.env.local`:

```env
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=
```

### Supabase CLI install (macOS)
Clone and run:

```bash
brew install supabase/tap/supabase
git clone https://github.com/codebox-calpoly/NoteSharer.git
cd NoteSharer
npm run setup
```

### Required environment variables
Create `frontend/.env.local` and include:
- `NEXT_PUBLIC_SUPABASE_URL`
- `NEXT_PUBLIC_SUPABASE_ANON_KEY`
- `SUPABASE_SERVICE_ROLE_KEY`
For frontend-only work when Supabase CLI is not installed, use `npm run start`.

### Start the dev server
If you want to skip the full checks and just start after installing updates:
Use branches and PRs:

```bash
npm run start
git checkout main
git pull
git checkout -b short-clear-branch-name
npm run gitcheck
```

### Auth flow
Open `/auth`, enter your `@calpoly.edu` email, and use the one-time code to log in.
After that, you will be routed to onboarding or the dashboard.
Open pull requests into `main`. Keep PRs focused, include screenshots for UI changes, and call out database or environment changes clearly.

## Documentation

- Product requirements: `docs/PRD.md`
- Tech stack: `docs/Note_Sharer_Tech_Stack.md`
- Project charter: `docs/project-charter.md`
- Contributing: `docs/contributing.md`
- PR review guide: `docs/PR_REVIEW_GUIDE.md`

## Contributing
## Docs

Visit [contributing.md](docs/contributing.md) on info for how to contribute to this repo.
- [Architecture](docs/architecture.md): how the app is organized.
- [Product Goals](docs/product-goals.md): users, core flows, and product guardrails.
- [Brand](docs/brand.md): product voice, visual direction, and naming.
- [Code Style](docs/code-style.md): project coding conventions.
- [Testing](docs/testing.md): current checks and test expectations.
- [Agent Guide](AGENTS.md): working rules for AI collaborators.
- [Supabase Setup](supabase/README.md): database setup, migrations, and storage buckets.
55 changes: 0 additions & 55 deletions TODO.md

This file was deleted.

Loading
Loading