Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

253 Commits

Repository files navigation

Breaktime

A Progressive Web App (PWA) for scheduling and messaging between youth (YA) users and staff at Breaktime. Built by JumboCode 2025–2026.

Project Manager: Luis Suarez | Technical Lead: Yoda Ermias | Designer: Allen Wang


Tech Stack

LayerTechnology
FrontendReact 18, Vite, Tailwind CSS, React Router, Clerk
BackendNode.js, Express 5, MongoDB, Clerk
AuthClerk (permission levels stored in user metadata)
DeploymentVercel (both sides have vercel.json)

Project Structure

breaktime/
├── backend/ Express API
├── frontend/
│ └── breaktime/ React + Vite app
└── package.json Root monorepo scripts

Backend

backend/src/
├── app.js Express app setup (CORS, routes)
├── server.js Entry point
├── routes/ One file per entity
├── schemas/ Joi validation schemas
└── utils/
├── mongodb.js Singleton DB connection
├── clerk.js Clerk client init
└── api.js Shared API helpers

API Routes

RouteDescription
/userCreate and fetch youth (YA) accounts
/staffCreate staff accounts
/adminApprove/deny pending accounts, list all users
/bookingCRUD for bookings and booking history
/serviceService definitions and availability
/serviceExtensionExtended service configuration
/notificationInbox, message threads, mark-read

Databases (MongoDB)

DatabasePurpose
requestsPending account and booking extension approvals
servicesService definitions and bookings
notificationsInbox messages and notifications

Frontend

frontend/breaktime/src/
├── App.jsx Router + Clerk provider + ModalProvider
├── pages/ Full page components (desktop)
│ └── mobile/ Mobile-optimized page variants
├── components/ Reusable UI (NavBar, Calendar, Inbox, etc.)
│ ├── popups/ Modal dialogs (staff booking, YA booking, messaging)
│ └── mobile/ Mobile-specific components (tabs, bottom sheets)
└── utils/
├── ProtectedRoute.jsx Auth guard (checks Clerk + permission level)
├── general.js API call helpers
└── errorMessages.js Centralized error text

Role-Based Routing

After login, HomeChooser.jsx reads user.publicMetadata.permission from Clerk and routes accordingly:

PermissionRoleDestination
0PendingBlocked / redirected
1Youth (YA)YouthLandingPage (desktop) or YouthLandingPageMobile (mobile)
2StaffHomePage (calendar, booking management, user table, inbox)

Mobile is detected via user-agent string or window width < 1025px.


Getting Started

Prerequisites: Node.js, a MongoDB Atlas URI, and Clerk API keys.

1. Install dependencies

npm run install

2. Set up environment variables

backend/.env:

MONGODB_URI=
CLERK_SECRET_KEY=

frontend/breaktime/.env:

VITE_BASE_URL=http://localhost:3000
VITE_CLERK_PUBLISHABLE_KEY=

3. Run in development mode

npm run dev # starts either the backend or frontend depending on the current directory

You can also run them separately:

npm run backend # Express on port 3000
npm run frontend # Vite dev server

Deployment

Both backend/ and frontend/breaktime/ have vercel.json configs. Deploy each as a separate Vercel project. After deploying the backend, update VITE_BASE_URL in the frontend environment to point at the live backend URL.

The current active link for the application is https://breaktime-lemon.vercel.app/

About

Breaktime, JumboCode 2025

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages