A platform for creating and joining study groups https://cmustudy.com
  • TypeScript 63.8%
  • JavaScript 18.9%
  • CSS 14.1%
  • Nix 2.2%
  • Shell 0.8%
  • Other 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Anna David 2eef5b0d8a
All checks were successful
nixbot/nix-eval evaluation succeeded in 0s (1 warning)
nixbot/nix-build 0 attributes built
kennel/build build succeeded
kennel/deploy deployment healthy
feat: remove showing number on my groups tab
2026-10-31 16:52:42 -04:00
.forgejo docs: update pull request template 2026-10-25 22:40:02 -04:00
.github/workflows fix: try switching workflow from nix to docker 2026-10-26 02:31:28 +00:00
docs test: create separate test/unit and test/integration folders, add automatic test discovery, migrate npm tests to vitest, consolidate test commands to just npm run test:unit and npm run test:integration, updated docs and ci to actually run all tests 2026-10-26 02:31:28 +00:00
prisma merge main into ui_change for kennel and google calendar changes 2026-10-24 12:08:37 -04:00
public Phase 1: cleanup code and remove InstaPlateMobile 2026-07-06 22:06:41 -04:00
src feat: remove showing number on my groups tab 2026-10-31 16:52:42 -04:00
test fix: merge main into ui_change 2026-10-27 15:54:45 -04:00
.eslintrc.cjs First commit create-t3-app 2024-07-03 20:37:42 -04:00
.gitignore merge main into ui_change for kennel and google calendar changes 2026-10-24 12:08:37 -04:00
.nvmrc Phase 3: move style to CSS files 2026-07-06 22:06:41 -04:00
devenv.lock merge main into ui_change for kennel and google calendar changes 2026-10-24 12:08:37 -04:00
devenv.nix merge main into ui_change for kennel and google calendar changes 2026-10-24 12:08:37 -04:00
devenv.yaml merge main into ui_change for kennel and google calendar changes 2026-10-24 12:08:37 -04:00
flake.lock merge main into ui_change for kennel and google calendar changes 2026-10-24 12:08:37 -04:00
flake.nix fix: update hash 2026-10-24 12:44:18 -04:00
general_workflow.md test: create separate test/unit and test/integration folders, add automatic test discovery, migrate npm tests to vitest, consolidate test commands to just npm run test:unit and npm run test:integration, updated docs and ci to actually run all tests 2026-10-26 02:31:28 +00:00
next.config.js merge main into ui_change for kennel and google calendar changes 2026-10-24 12:08:37 -04:00
package-lock.json add Vitest unit and integration tests for join group button 2026-09-23 20:25:31 -04:00
package.json fix: no class is displayed when creating new user 2026-10-26 03:05:44 +00:00
postcss.config.cjs First commit create-t3-app 2024-07-03 20:37:42 -04:00
prettier.config.js First commit create-t3-app 2024-07-03 20:37:42 -04:00
README.md fix: merge main into ui_change 2026-10-27 15:54:45 -04:00
secretspec.toml merge main into ui_change for kennel and google calendar changes 2026-10-24 12:08:37 -04:00
shell.nix merge main into ui_change for kennel and google calendar changes 2026-10-24 12:08:37 -04:00
tailwind.config.ts refactor: create consistent color bank with light-dark pairs so that no component defines a hex color inline. All componenets now use the color bank 2026-10-28 23:51:11 -04:00
tsconfig.json First commit create-t3-app 2024-07-03 20:37:42 -04:00
vitest.config.ts test: create separate test/unit and test/integration folders, add automatic test discovery, migrate npm tests to vitest, consolidate test commands to just npm run test:unit and npm run test:integration, updated docs and ci to actually run all tests 2026-10-26 02:31:28 +00:00

CMU Study

Find and manage CMU study groups.

A Next.js app deployed by kennel.

One-time setup

Install devenv and its shell hooks (stop before devenv init), then sign in to OpenBao so secretspec can resolve this project's secrets:

nix run git+https://git.cmu.dev/ScottyLabs/kennel#login

Running the app

Make sure you run devenv allow the first time you open the shell so the environment loads properly!

Starting services (postgres, ricochet):

devenv up

Once you see postgres ready and ricochet running, open a devenv shell:

devenv shell
npm ci
migrate               # applies prisma migrations

Run the app in the same devenv shell:

npm run dev

Keep devenv up running in its own terminal.

Tests

Run tests from a devenv shell so they use the same Node.js and PostgreSQL setup as the app. Start devenv up in another terminal first, then install dependencies and apply the local migrations if you have not already done so:

devenv shell
npm ci
migrate

From that shell:

Command Runs
npm test or npm run test:unit Every unit test in src/ and test/unit/; these tests must not require PostgreSQL.
npm run test:integration Every database-backed test in test/integration/; creates, migrates, and destroys a temporary PostgreSQL database unless DATABASE_URL_TEST is set.
npm run test:all Runs the unit suite, then the integration suite only if unit tests pass, and prints a final pass/fail and test-count summary.

All test commands use Vitest. The temporary database runner creates, migrates, and destroys a test database. To use an existing dedicated test database instead, set DATABASE_URL_TEST when invoking npm run test:integration:

DATABASE_URL_TEST="postgresql://.../dedicated_test_database" npm run test:integration

DATABASE_URL_TEST must be different from DATABASE_URL; never point it at a development, shared, or production database.

Test placement

Tests are assigned to a suite by location. Use the following rule whenever adding a new *.test.* file:

Test type Location Requirements
Unit Beside its source under src/, or in test/unit/ Must not require PostgreSQL. Frontend, server, and utility tests all belong here when their external state is mocked.
Integration test/integration/ Requires PostgreSQL and must use the disposable DATABASE_URL_TEST database.

The directory-based commands discover new test files automatically. Do not add test files directly under test/.

To stop a suite after its first failed test, append Vitest's --bail=1 flag:

npm run test:unit -- --bail=1
npm run test:integration -- --bail=1
npm run test:all -- --bail=1

The first -- tells npm to pass --bail=1 to Vitest rather than interpret it as an npm option.

Database

devenv up runs PostgreSQL on a unix socket and exports DATABASE_URL. There is no password and no port to configure.

Command Does
migrate applies pending migrations (prisma migrate deploy)
migration creates a migration from schema changes (prisma migrate dev)
studio opens Prisma Studio

Deployed services migrate themselves on startup, so a migration ships with the commit that needs it.

Environment

Secrets live in OpenBao, declared in secretspec.toml and resolved per environment by profile. Kennel supplies DATABASE_URL, PORT, and APP_URL at runtime, so none of those are declared as secrets.

Only src/env.js may read the environment at runtime. Next inlines any direct process.env.FOO at build time, so a value read that way in a component or route handler is whatever it was during the build, not during the request.

You do not need a .env anymore, unless you are working on a feature that requires adding new environment variables that do not exist in OpenBao yet. You should delete your .env (or clear it) so it doesn't overwrite the OpenBao variables.

Deployment and CI

The Forgejo Test workflow runs only when a pull request is opened, reopened, or updated. It runs unit tests first and only starts the PostgreSQL integration tests after they pass. It does not run again for ordinary branch pushes or when a pull request is merged.

Kennel independently receives Forgejo's pull-request and push webhooks: an open pull request gets a preview at study-web-pr-<number>.scottylabs.net, and a push to main deploys production at cmustudy.com. Kennel currently starts those deployments as soon as it receives its webhook; the repository workflow cannot make it wait for CI. Configure the two Test workflow job statuses as required checks for main so an untested or failing pull request cannot be merged and therefore cannot reach production. Progress for the independent Kennel build and deployment appears as kennel/build and kennel/deploy commit statuses.

Project structure

Project structure

  • src/app contains Next.js routes and route layouts.

  • src/features/groups contains study-group components, hooks, services, filters, and constants.

  • src/features/profile contains profile components, hooks, services, and profile-specific types.

  • src/components contains shared layout, provider, and UI components.

  • src/helpers contains external integration helpers such as calendar/date utilities.

  • src/server/api contains the Hono API application and route composition.

  • src/styles contains global and component-level CSS.

  • flake.nix builds the deployable package

  • devenv.nix declares the development environment and what kennel deploys.

  • flake.nix builds the deployable package

  • devenv.nix declares the development environment and what kennel deploys.