Skip to content
NULL-CALPOLYPublic

About

csc 308/309 project developed by Brian, Vishnu, Ryan, and Aaron

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

311 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Findr - CSC 308/309 Project

CI Testing Backend Deploy Frontend Deploy

A full-stack web application for finding and connecting with people based on shared interests, events, and locations.

Developed by: Vishnu, Ryan, Aaron, and Brian

Live App: https://findr.page

API: https://findr-ggfjetd2gqe2gday.westus3-01.azurewebsites.net\

Tech Spec: https://docs.google.com/document/d/1xPatnOUdmf4j4XLYecwjvVe7y-TObKSaQwlB1beosF8/edit?usp=sharing


πŸ“‹ Table of Contents


🎯 Project Overview

Findr is a location-based social discovery platform that helps users find events, connect with others, and join communities based on shared interests.

Key Features

  • User registration and authentication (email/password + Google OAuth)
  • JWT-based auth with HttpOnly refresh token cookies
  • Event discovery, creation, and RSVP management
  • Interest-based tagging and filtering
  • Interactive map powered by React-Leaflet
  • Event comment threads
  • Image uploads via Cloudinary
  • Organization management
  • Profile management

UI Design

View Figma Design


πŸ› οΈ Tech Stack

Backend

  • Runtime: Node.js (ESM)
  • Framework: Express.js v5
  • Database: MongoDB with Mongoose
  • Auth: JWT (access + refresh tokens), bcrypt, Passport.js + Google OAuth 2.0
  • Session: express-session + connect-mongo
  • Other: cookie-parser, cors, dotenv, multer, Cloudinary

Frontend

  • Framework: React 18 with Vite
  • Routing: React Router v7
  • Maps: React-Leaflet + Leaflet
  • UI Components: AWS Cloudscape Design
  • Styling: CSS
  • Utilities: date-fns
  • Language: JSX + TypeScript (hooks)

Testing

  • Framework: Jest + Supertest
  • In-memory DB: mongodb-memory-server
  • Mocking: mockingoose
  • Frontend: @testing-library/react
  • Acceptance Testing Cypress

DevOps

  • Backend Hosting: Azure App Service
  • Frontend Hosting: Azure Static Web Apps
  • CI/CD: GitHub Actions (via Azure deployment)
  • Code Quality: ESLint + Prettier

πŸ“ Project Structure

.
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ backend.js                  # Server entry point
β”‚   β”œβ”€β”€ Cloudinary.js               # Cloudinary upload config
β”‚   β”œβ”€β”€ UserFiles/                  # User routes, schema, services
β”‚   β”œβ”€β”€ EventFiles/                 # Event management
β”‚   β”œβ”€β”€ CommentFiles/               # Event comment threads
β”‚   β”œβ”€β”€ InterestFIles/              # Interest management
β”‚   β”œβ”€β”€ OrganizationFiles/          # Organization management
β”‚   └── OAuth/                      # Google OAuth routes (Passport.js)
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ Components/             # Reusable React components
β”‚   β”‚   β”‚   β”œβ”€β”€ AuthProvider.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ModalContext.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ProtectedComponent.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Navbar/
β”‚   β”‚   β”‚   β”œβ”€β”€ CreateEventButton/
β”‚   β”‚   β”‚   β”œβ”€β”€ CreateEventModal/
β”‚   β”‚   β”‚   β”œβ”€β”€ EventComponent/
β”‚   β”‚   β”‚   β”œβ”€β”€ EventColumn/
β”‚   β”‚   β”‚   β”œβ”€β”€ MainMapComponent/
β”‚   β”‚   β”‚   β”œβ”€β”€ Modals/
β”‚   β”‚   β”‚   β”œβ”€β”€ SearchBar/
β”‚   β”‚   β”‚   β”œβ”€β”€ InterestTag/
β”‚   β”‚   β”‚   └── TempAddressInputComponent/
β”‚   β”‚   β”œβ”€β”€ Pages/                  # Page-level components
β”‚   β”‚   β”‚   β”œβ”€β”€ Landing/
β”‚   β”‚   β”‚   β”œβ”€β”€ Home/
β”‚   β”‚   β”‚   β”œβ”€β”€ Profile/
β”‚   β”‚   β”‚   └── EventDetails/
β”‚   β”‚   β”œβ”€β”€ Hooks/
β”‚   β”‚   β”‚   β”œβ”€β”€ UseAuth.ts          # Auth context + JWT logic
β”‚   β”‚   β”‚   β”œβ”€β”€ UseEvents.jsx
β”‚   β”‚   β”‚   └── UseInterests.jsx
β”‚   β”‚   └── App.jsx
β”‚   β”œβ”€β”€ .env                        # Dev env vars
β”‚   β”œβ”€β”€ .env.production             # Production env vars
β”‚   └── vite.config.js
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ Integration/                # Supertest integration tests
β”‚   β”œβ”€β”€ Mockingoose/                # Mockingoose unit tests
β”‚   β”œβ”€β”€ unit/frontend/              # React component tests
β”‚   β”œβ”€β”€ cypress/                    # Automated Acceptance tests
β”‚   └── __mocks__/                  # Leaflet, style mocks
β”œβ”€β”€ .env                            # Backend env vars (local)
β”œβ”€β”€ .env.test                       # Backend env vars (test)
└── package.json

πŸš€ Getting Started

Prerequisites

  • Node.js v18+
  • npm
  • MongoDB Atlas account (or local MongoDB)

Installation

  1. Clone the repository

    git clone <repository-url>
    cd CSC_308-309_NULL
  2. Install all dependencies

    npm install
    cd frontend && npm install && cd ..
  3. Set up environment variables (see Environment Variables)

  4. Start the development servers

    npm run dev

πŸ’» Development

Running the Application

Command Description
npm run dev Start backend + frontend concurrently
npm run backend:dev Start backend only (localhost:3000)
npm run frontend:dev Start frontend only (localhost:5173)

The frontend proxies all /api/* requests to the backend in dev, so cookies work correctly across ports.

Code Quality

Command Description
npm run format Format all files with Prettier
npm run lint Check for lint errors
npm run lint:fix Auto-fix lint errors

πŸ” Environment Variables

Backend β€” .env (root)

MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/dbname
SESSION_SECRET=your_long_random_secret
JWT_TOKEN_SECRET=your_jwt_secret
REFRESH_TOKEN_SECRET=your_refresh_secret
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
CLOUDINARY_CLOUD_NAME=cloud_name
CLOUDINARY_KEY=cloudinary_key
CLOUDINARY_SECRET=cloudinary_secret

Backend β€” .env.test (root)

GOOGLE_CLIENT_ID=dummy
GOOGLE_CLIENT_SECRET=dummy
JWT_TOKEN_SECRET=dummy_jwt_token
REFRESH_TOKEN_SECRET=dummy_refresh_token
SESSION_SECRET=dummy_session_secret

Frontend β€” frontend/.env (local dev)

VITE_API_BASE_URL=/api

Frontend β€” frontend/.env.production

VITE_API_BASE_URL=https://findr-ggfjetd2gqe2gday.westus3-01.azurewebsites.net

Note: .env files are gitignored. Never commit secrets.


πŸ”Œ API Documentation

Base URL

  • Local: http://localhost:3000
  • Production: https://findr-ggfjetd2gqe2gday.westus3-01.azurewebsites.net

Authentication

Method Endpoint Description
POST /users/login Login with email + password
POST /users/logout Logout and clear refresh token cookie
POST /users/refresh-token Get new access token via HttpOnly cookie
GET /auth/google Initiate Google OAuth
GET /auth/google/callback Google OAuth callback
GET /auth/me Get current OAuth session user

Users

Method Endpoint Description
GET /users/all Get all users
GET /users/:id Get user by ID
POST /users Register new user
PUT /users/:id Update user
DELETE /users/:id Delete user

Events

Method Endpoint Description
GET /events/all Get all events
GET /events/:id Get event by ID
GET /events/upcoming Get all future events
POST /events Create event
PUT /events/:id Update event
DELETE /events/:id Delete event
PUT /events/:id/attendees/add/:userId RSVP to event
PUT /events/:id/attendees/remove/:userId Un-RSVP from event

Comments

Method Endpoint Description
GET /comments/event/:eventId Get comments for an event
POST /comments/event/:eventId Create comments thread for event
POST /comments/event/:eventId/message Add message to event comments

Interests

Method Endpoint Description
GET /interests/all Get all interests
GET /interests/:id Get interest by ID
POST /interests Create interest
GET /interests/search/name/:name Search by name

Organizations

Method Endpoint Description
GET /organizations/all Get all organizations
GET /organizations/:id Get organization by ID
POST /organizations Create organization
PUT /organizations/:id/members/add/:userId Add member
PUT /organizations/:id/members/remove/:userId Remove member

πŸ§ͺ Testing

Run Tests

Command Description
npm run test Run all tests
npm run test:unit Run frontend unit tests only
npm run test:integration Run backend integration tests only
npm run test:coverage Run tests with coverage report
npm run test:watch Run tests in watch mode
npm run cypress:open Opens cypress window to run
---------------------- Automated Acceptance Testing
-----------------------------------------------------------------

Test Structure

tests/
β”œβ”€β”€ Integration/        # Supertest tests against mongodb-memory-server
β”‚   β”œβ”€β”€ Users/
β”‚   β”œβ”€β”€ Events/
β”‚   β”œβ”€β”€ Interests/
β”‚   └── Organizations/
β”œβ”€β”€ Mockingoose/        # Route/service tests using mockingoose
β”‚   β”œβ”€β”€ Users/
β”‚   β”œβ”€β”€ Events/
β”‚   β”œβ”€β”€ Interests/
β”‚   └── Organizations/
β”œβ”€β”€ Cypress/            # Automated Accpetance Testing using Cypress
β”‚   β”œβ”€β”€ e2e/
β”‚   └── support/
└── unit/frontend/      # React component tests (jsdom)

☁️ Deployment

The app is deployed on Azure:

  • Frontend: Azure Static Web Apps β€” auto-deploys from main branch via GitHub Actions
  • Backend: Azure App Service β€” auto-deploys from main branch via GitHub Actions

Required Azure App Service Environment Variables (Backend)

Variable Description
NODE_ENV production
MONGODB_URI MongoDB Atlas connection string
SESSION_SECRET Random secret for express-session
JWT_TOKEN_SECRET Secret for signing access tokens
REFRESH_TOKEN_SECRET Secret for signing refresh tokens
FRONTEND_URL https://findr.page
BACKEND_URL https://findr-ggfjetd2gqe2gday.westus3-01.azurewebsites.net
GOOGLE_CLIENT_ID Google OAuth client ID
GOOGLE_CLIENT_SECRET Google OAuth client secret
CLOUDINARY_CLOUD_NAME Cloudinary Cloud Name
CLOUDINARY_KEY Cloudinary Key
CLOUDINARY_SECRET Cloudinary Secret

Note: Do not configure CORS in the Azure portal β€” Express handles CORS. Having both configured causes conflicts.


πŸ“ Contributing Guidelines

  1. Pull latest from main and create a feature branch:

    git checkout -b feature/your-feature
  2. Before committing:

    npm run format
    npm run lint:fix
    npm run test
  3. Use clear, descriptive commit messages and open a PR against main.


πŸ‘₯ Team

  • Vishnu β€” Developer/Designer
  • Ryan β€” Developer
  • Aaron β€” Developer
  • Brian β€” Developer

About

csc 308/309 project developed by Brian, Vishnu, Ryan, and Aaron

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages