Skip to content
Sam Der edited this page Nov 20, 2024 · 8 revisions

Welcome to the IrvineHacks website!

Overview

This monorepo uses turborepo with pnpm as a package manager. It contains the following applications:

apps/site

A Next.js 13 App Router application that contains the frontend for the IrivneHacks site. At the moment, the site contains the following sections:

  • User-facing frontend that contains a home page, a resources page, and a schedule page
  • Administration portal where organizers can review applications and check hackathon participants into the hackathon and workshops at the hackathon

The development server runs at http://localhost:3000. If this port is taken, the next available port will be used.

apps/api

A FastAPI project that contains the API for the IrvineHacks site. Specifically, it includes various routes related to the following:

  • Processing hackathon applications
  • UCI Shibboleth and guest authentication
  • Sending various emails to hackathon participants with SendGrid
  • Processing DocuSign waiver completions
  • Updating user statuses (i.e. whether they are accepted, have RSVP'd, etc.)
  • Enforcing RSVP deadlines

The development server runs at http://localhost:8000. If this port is taken, the next available port will be used.

apps/sanity

A Sanity Studio project.

This app contains the dashboard used to view and edit content stored in Sanity.

The development server runs at http://localhost:3333. If this port is taken, the project will error.

First Time Setup

Installing pnpm and Project Dependencies

Install pnpm by running npm install -g pnpm. Ensure that pnpm is in your PATH variable and can be run in a terminal. Then, in the project root, run pnpm i to install the project's dependencies for the TypeScript-based applications apps/site and apps/sanity.

The Python API can be run with or without Docker. Running without Docker will require installing the dependencies through the following steps:

  1. Change directory into the apps/api directory.
  2. Create a virtual environment by running python3 -m venv .venv. This isolates the libraries you install in this environment from the libraries on your machine.
  3. Activate the virtual environment by running source .venv/bin/activate on MacOS/Linux and .\.venv\Scripts\activate on Windows. If you're using an editor like VSCode, it may automatically detect and prompt you to use the virtual environment when linting your code.
  4. Finally, install the API dependencies by running pip install -r requirements.txt -r requirements-dev.txt.

Please note that the API currently supports Python 3.9 or less.

Docker

This project uses Docker for running the API and testing API methods locally.

  1. Install Docker. The process varies greatly depending on the operating system, so please refer to this article.
  2. Open Docker Desktop.

A local MongoDB application will start running at http://localhost:8081 after running pnpm dev.

Note: Because the Python files are copied over to the Docker container when building the API, hot reloading will not work. Docker volumes can be set up so that Docker will use the files on your system rather than copying over files but this is currently not set up in this project.

Building

To build all apps and packages, run pnpm build in the project root. You can run before opening pull requests as a sanity check for any type errors that you may have missed or set up a pre-commit hook that runs this automatically. To build an individual app or package, first navigate to the corresponding directory and then run pnpm build.

Running

You can run the application with pnpm dev. Please note that you do not need to build the application first before running it.

Helpful VSCode Extensions

  • Python for Python linting, IntelliSense, etc.
  • Mypy for Python type checking
  • Black for Python code formatting
  • Prettier for code formatting on file save or set to a keybind
  • ESLint for linting JavaScript