This monorepo uses turborepo with pnpm as a package manager. It contains the following:
A Next.js 13 project that uses the new app router.
This app contains the IrvineHacks site.
The development server runs at http://localhost:3000
. If this port is taken, the next available port will be used.
A FastAPI project.
This app contains the api for the IrvineHacks site.
The development server runs at http://localhost:8000
. If this port is taken, the next available port will be used.
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.
This repo used 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 pnpm
When running commands, use pnpm
rather than npm
.
-
Ensure you are in the project root.
-
Install dependencies
pnpm i
-
Ensure you are in
apps/api
withcd apps/api
-
Create a virtual environment. This isolates the libraries you install in this environment from the libraries on your actual machine.
python3 -m venv .venv
-
Activate virtual environment
VS Code may prompt to automatically select the newly created virtual environment. Otherwise, for Mac/Linux, run
source .venv/bin/activate
and for Windows, run
.\.venv\scripts\activate
-
Install dependencies
pip install -r requirements.txt -r requirements-dev.txt
This project uses Docker for 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.
To build all apps and packages, run the following command in the project root.
Note: You would run this BEFORE opening a PR as a sanity check for errors.
pnpm build
To build an individual app or package, first, navigate to the corresponding directory and run the build command.
To develop all apps and packages, run the following command in the project root.
pnpm dev
- 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
This Turborepo includes the following packages/apps:
site
: a Next.js appapi
: a FastAPI appsanity
: a Sanity Studio appeslint-config-custom
:eslint
configurations (includeseslint-config-next
andeslint-config-prettier
)tsconfig
:tsconfig.json
s used throughout the monorepo
- TypeScript for static type checking
- ESLint for code linting
- Prettier for code formatting