Introduction
Welcome to the IrvineHacks website!
Overview
This monorepo uses turborepo with pnpm as a package manager. It contains the following applications:
apps/site
apps/siteA 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
apps/apiA 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
apps/sanityA 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
`pnpm`
This repo uses pnpm, a space-efficient replacement to npm. You can learn more about its advantages at https://pnpm.io/.
Install pnpm with the following command, or use an alternative installation method.
npm install -g pnpmOf course, this requires that you have NodeJS installed.
When running commands, use pnpm rather than npm.
Next.js
Ensure you are in the project root.
Install dependencies
pnpm i
Python API
If you are interested in running the Python API locally without having to use Docker, then follow these steps. Otherwise, please skip to the Docker section below.
Ensure you are in
apps/apiwithcd apps/apiCreate a virtual environment. This isolates the libraries you install in this environment from the libraries on your actual machine.
python3 -m venv .venvActivate virtual environment. VS Code may prompt to automatically select the newly created virtual environment. Otherwise, for Mac/Linux, run
source .venv/bin/activateand for Windows, run
.\.venv\scripts\activateInstall dependencies
pip install -r requirements.txt -r requirements-dev.txtPlease note that installation will only work with Python 3.9 or less.
Docker
This project uses Docker for running the API and testing API methods locally.
Install Docker. The process varies greatly depending on the operating system, so please refer to this article.
Open Docker Desktop.
A local MongoDB application will start running at http://localhost:8081 after running pnpm dev.
Note: Because the Python files have been copied over to the Docker container, hot reload is no longer possible. Stopping the container and rerunning pnpm dev is the best option.
Build
To build all apps and packages, run the following command in the project root. You can run before opening pull requests as a sanity check for any type errors that you may have missed.
pnpm buildTo build an individual app or package, first, navigate to the corresponding directory and run the build command.
Develop
To develop all apps and packages, run the following command in the project root.
pnpm devHelpful 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
VSCode will automatically ask if you want to install these extensions upon starting the application in the project folder, but in case it does not, you can refer to this list.
Last updated