Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ CALENDAR_TIMEZONE=

WATCHED_CHANNELS=
SLACK_API_TOKEN=
SLACK_JUMPSTART_MESSAGE=
SLACK_SIGNING_SECRET=

WIKI_API=
Expand Down
30 changes: 20 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
FROM ghcr.io/astral-sh/uv:python3.14-alpine AS docbuilder

WORKDIR /jumpstartdocs
FROM ghcr.io/astral-sh/uv:python3.14-alpine AS base

WORKDIR /app

COPY pyproject.toml uv.lock ./
RUN uv sync --group docs --frozen

FROM base AS docbuilder

WORKDIR /appdocs

COPY mkdocs.yml .
COPY docs ./docs
COPY src ./src

RUN uv pip install --no-cache-dir -r ./docs/requirements.txt --system && \
zensical build
WORKDIR /app

RUN uv run zensical build --config-file /appdocs/mkdocs.yml

FROM ghcr.io/astral-sh/uv:python3.14-alpine

COPY src /jumpstart
COPY --from=docbuilder /jumpstartdocs/site /jumpstart/docs
COPY --from=base /app/.venv /app/.venv
COPY src /app
COPY --from=docbuilder /appdocs/site /app/docs

WORKDIR /jumpstart
WORKDIR /app

RUN addgroup -g 2000 jumpgroup && adduser -S -u 1001 -G jumpgroup jumpstart && \
uv pip install --no-cache-dir -r requirements.txt --system && rm requirements.txt
RUN addgroup -g 2000 jumpgroup && \
adduser -S -u 1001 -G jumpgroup jumpstart

USER jumpstart

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--log-config", "/jumpstart/logging_config.yaml", "--proxy-headers", "--forwarded-allow-ips", "*"]
CMD ["uv", "run", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--log-config", "/app/logging_config.yaml", "--proxy-headers", "--forwarded-allow-ips", "*"]
61 changes: 47 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ All information displayed has been authorized to been shown.
Documentation for the project can be found be appended /docs to the url
All HTML requests that are sent in the project can be seen by appending /swag

This project uses Python, [FastAPI](https://fastapi.tiangolo.com/), HTML/CSS, and Javascript.
This project uses Python, [FastAPI](https://fastapi.tiangolo.com/), [UV](https://docs.astral.sh/uv/), HTML/CSS, and Javascript.
See it live [here](https://jumpstart.csh.rit.edu)!

## Installing
Expand Down Expand Up @@ -43,26 +43,59 @@ Jumpstart also has support for Docker Compose, a extended version of docker that

(This is a really cool thing! If you use docker often, check it out!)
```
docker compose up
docker compose up --build
```

## Development
## Local Development

### Setup
1. Install uv on your system if not already on it (this just makes it easy)
2. Run: `uv venv .venv`
3. Activate the virtual environment
### NOTE: MAKE SURE TO USE `uv add` IN THIS PROJECT TO KEEP `pyproject.toml` and `uv.lock` UPDATED!
## UV Setup

Install UV on your system if not already on it. If you already have it installed, you can skip down to the Project Setup page

UV is a blazingly fast python package manager written in Rust. The Jumpstart project uses UV for speed and simplicity. Run the linked install command for your operating system

__Linux and macOS__
```
curl -LsSf https://astral.sh/uv/install.sh | sh
```

__Windows (Powershell)__
```
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```

## UV Commands Useful For this Project

__uv sync__: UV sync serves to replace pip install -r requirements.txt. This command syncs your virtual environment to match the `pyproject.toml` file. By default, it will only copy the default dependencies for the project (found in dependencies)

__uv sync --group $GROUP__: UV sync with the added group flag will ALSO install all dependencies found in that group ALONG with the default dependencies.

__uv sync --frozen__: When reading the UV Sync, it reads ONLY the `uv.lock` file, and does not attempt to make any modifications, and failing instead. This is incredibly useful for reproducibility, which is why its used in the docker file.

__uv sync --all-groups__: UV sync, along with installing dependencies of every group

__uv add $PACKAGE__: UV serves to replace pip install $PACKAGE. It installs the most recent version of the inserted package, and adds it to the projects default dependencies

__uv add --group $GROUP $PACKAGE__: Same as UV add, but adds the package to the group instead of the default project dependencies.

## UV Groups Used in this Project
__dev__: Dependencys needed for testing locally

__docs__: Dependencys used for creating the statically generated website on /docs

__tests__: Dependencys used for running the unit tests.

## Project Setup
1. Run: `uv venv .venv --python 3.14`
2. Activate the virtual environment
* Bash: `source .venv/bin/activate`
* Fish: `source .venv/bin/activate.fish`
* Windows: `.venv\Scripts\activate`
* Other: Good luck!
4. Run:
* `uv pip install -r dev-requirements.txt`
* `uv pip install -r src/requirements.txt`
* `uv pip install -r tests/requirements,txt`
* `uv pip install -r docs/requirements.txt`
5. Run: `pre-commit install`
6. You're all set!
3. Run: `uv sync --all-groups`
4. Run: `pre-commit install`
5. You're all set!

### Testing

Expand Down
3 changes: 0 additions & 3 deletions dev-requirements.txt

This file was deleted.

17 changes: 2 additions & 15 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,5 @@ services:
container_name: Jumpstart
ports:
- "8000:8000"
environment:
- CALENDAR_URL=${CALENDAR_URL}
- CALENDAR_OUTLOOK_DAYS=${CALENDAR_OUTLOOK_DAYS}
- CALENDAR_EVENT_MAXIMUM=${CALENDAR_EVENT_MAXIMUM}
- CALENDAR_TIMEZONE=${CALENDAR_TIMEZONE}

- WATCHED_CHANNELS=${WATCHED_CHANNELS}
- SLACK_API_TOKEN=${SLACK_API_TOKEN}
- SLACK_JUMPSTART_MESSAGE=${SLACK_JUMPSTART_MESSAGE}
- SLACK_SIGNING_SECRET=${SLACK_SIGNING_SECRET}

- WIKI_API=${WIKI_API}
- WIKIBOT_USER=${WIKIBOT_USER}
- WIKIBOT_PASSWORD=${WIKIBOT_PASSWORD}
- WIKI_CATEGORY=${WIKI_CATEGORY}
env_file:
- .env
6 changes: 0 additions & 6 deletions docs/requirements.txt

This file was deleted.

42 changes: 42 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[project]
name = "jumpstart"
version = "0.1.0"
description = "A graphical interface that displays information in the elevator lobby of Computer Science House."
readme = "README.md"
requires-python = ">=3.14"
dependencies = [
"aiohttp==3.13.3",
"arrow==1.4.0",
"dotenv==0.9.9",
"fastapi==0.135.1",
"google-api-python-client==2.191.0",
"httpx==0.28.1",
"icalendar==7.0.3",
"jinja2==3.1.6",
"logging==0.4.9.6",
"python-multipart==0.0.22",
"pyyaml==6.0.3",
"recurring-ical-events==3.8.1",
"requests==2.32.5",
"slack-sdk==3.40.1",
"uvicorn==0.41.0",
]

[dependency-groups]
dev = [
"pre-commit==4.5.1",
"pytest==9.0.2",
"ruff==0.15.6",
]
docs = [
"mkdocs-git-revision-date-localized-plugin==1.5.1",
"mkdocs-minify-plugin==0.8.0",
"mkdocstrings==1.0.3",
"mkdocstrings-python==2.0.3",
"pymdown-extensions==10.21.2",
"zensical==0.0.24",
]
tests = [
"coverage==7.13.4",
"pytest==9.0.2",
]
24 changes: 0 additions & 24 deletions src/requirements.txt

This file was deleted.

2 changes: 0 additions & 2 deletions tests/requirements.txt

This file was deleted.

Loading
Loading