Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5edfcd5
refactored routes.py, updated __init__.py - LJD 8/18/26
LDurham1213 Aug 18, 2026
d9d4529
created uml and summary 1.0 document
LDurham1213 Aug 18, 2026
ee5b63e
Add files via upload
LDurham1213 Aug 18, 2026
78b3b5a
Delete forum/CircusCircus_uml.png
LDurham1213 Aug 18, 2026
53e266a
Delete forum/Current_Module_Summary.md
LDurham1213 Aug 18, 2026
a869146
update routes.py to previous version ljd 8/18/26
LDurham1213 Aug 18, 2026
c38f2d7
updated init
LDurham1213 Aug 18, 2026
edd91d7
created uml and summary 1.0 document (#120)
LDurham1213 Aug 18, 2026
1e27506
Add DishCourse UI styling and MYSQL configuration LJD 8/19/26
LDurham1213 Aug 19, 2026
1b0f5e5
Merge pull request #121 from CircusCircusLimes/interaction-presentation
moclark710 Aug 19, 2026
b9eb0f5
updated post function,MCC, 19AUG26
Aug 19, 2026
921dbbd
Add post visibility and refactor post routes; created check box and u…
Aug 20, 2026
d2c5036
Add post visibility and refactor post routes, created checkbox in cre…
Aug 20, 2026
22ab882
Merge pull request #165 from CircusCircusLimes/MCC
moclark710 Aug 20, 2026
551826d
Complete interaction and presentation features (#167)
LDurham1213 Aug 20, 2026
5206be9
Interaction presentation (#168)
LDurham1213 Aug 20, 2026
888f400
Add DishCourse informational pages and footer updates (#180)
LDurham1213 Aug 21, 2026
32efc23
"Add popup window for flash messages"
Aug 21, 2026
f55e613
Sloane merged 2 new features into dev: profile/settings (#208)
sloanerudometkin Aug 21, 2026
14362fb
Merge Interaction & Presentation Updates into Dev (#210)
LDurham1213 Aug 21, 2026
4e98555
Merge remote-tracking branch 'origin/dev' into MCC
Aug 21, 2026
4663be5
Merge pull request #211 from CircusCircusLimes/MCC
moclark710 Aug 21, 2026
c98e287
Add Dockerized Flask and MySQL development environment (#213)
LDurham1213 Aug 21, 2026
e933601
Add media_url field to Post: model, form, create route, and image/vid…
Aug 22, 2026
f90354e
Sloane- finished Docker setup (#214)
sloanerudometkin Aug 22, 2026
f8d4782
Merge pull request #215 from CircusCircusLimes/MCC
moclark710 Aug 22, 2026
19823b0
Add reactions to comments
LDurham1213 Aug 23, 2026
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
Binary file added .DS_Store
Binary file not shown.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,10 @@ dmypy.json
.pytype/

# Cython debug symbols
cython_debug/
cython_debug/

# Old stylesheet backup
forum/static/old_style.css

.env

13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3.11-slim

WORKDIR /app

COPY requirements.txt .

RUN pip install --no-cache-dir -r requirements.txt

COPY . .

EXPOSE 5000

CMD ["gunicorn", "-b", "0.0.0.0:5000", "forum.app:app"]
Binary file added Documents/.DS_Store
Binary file not shown.
Binary file added Documents/CircusCircus_uml.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Documents/Current_Module_Summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# CircusCircusLimes — Module Summary

This is a small Flask forum app ("Schooner"). Modules:

## `config.py`
Flask config class: secret key, SQLite DB URI (`circuscircus.db`), SQLAlchemy settings. Note: secret key is hardcoded (`'kristofer'`), not loaded from env despite the commented-out `load_dotenv`.

## `forum/__init__.py`
App factory (`create_app`). Builds the Flask app, loads config, registers the `comments` and `routes` blueprints, initializes SQLAlchemy, and creates tables. Comment notes more blueprints (post/subforum routes) may be split out later.

## `forum/app.py`
Entrypoint. Creates the app via `create_app()`, sets site name/description, wires up `flask_login`'s `LoginManager` with a `user_loader`, seeds default subforums (Forum, Announcements, Bug Reports, General Discussion, Other) on first run via `init_site()`/`add_subforum()`, and defines the `/` index route listing top-level subforums.

## `forum/models.py`
SQLAlchemy models and shared helpers:

- **`User`** (UserMixin): username/email/password hash, admin flag, relations to posts/comments, password hashing via werkzeug.
- **`Post`**: title/content/postdate, tied to a user and subforum, has a relative-time cache (`get_time_string`) recalculated every 30s.
- **`Subforum`**: title/description, self-referential parent/children, list of posts, `hidden` flag.
- **`Comment`**: content/postdate tied to a user and post, same relative-time caching pattern as `Post`.
- **Helpers**: `error()` (renders a red-text HTML error string — not escaped, potential XSS if fed user input), `generateLinkPath()` (builds breadcrumb HTML for a subforum chain), and `valid_title`/`valid_content` length validators.

## `forum/routes.py`
Main blueprint (`rt`) with the bulk of the app's routes: login/logout, account creation, viewing a subforum, the "add post" form, viewing a post with comments, and submitting a new post. Explicit comment in the file flags it as needing to be split into smaller route modules (`post_routes`, `subforum_routes`, etc.).

## `forum/comments.py`
`comments` blueprint with a single route, `/action_comment`, for posting a comment on a post (login required).

## `forum/user.py`
Account utility functions: username/password regex validation, and `username_taken`/`email_taken` lookups against the `User` table.

---

**Worth flagging:** the hardcoded `SECRET_KEY`, the unescaped HTML in `error()`, and the author's own TODO to split `routes.py` into per-feature blueprints.
Binary file added Documents/circuscircus_future_uml.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions TASKS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Tasks

## Active

## Waiting On

## Someday

## Done
13 changes: 13 additions & 0 deletions _to_delete/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copy this file to .env (already gitignored) and fill in real values.
# .env is loaded automatically by config.py via python-dotenv.

# Any private, unpredictable string. Used by Flask-Login to sign session
# cookies -- do not commit a real value, and do not reuse the same value
# across developers/environments if you can avoid it.
SECRET_KEY=

# Shared MySQL database credentials (see CircusCircusLimes_MySQL_Team_Setup_Guide).
DB_USER=
DB_PASSWORD=
DB_HOST=localhost
DB_NAME=circuscircuslimes
43 changes: 43 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
services:
web:
build: .
container_name: dishcourse-web

ports:
- "${APP_PORT}:5000"

environment:
DB_USER: ${MYSQL_USER}
DB_PASSWORD: ${MYSQL_PASSWORD}
DB_HOST: db
DB_NAME: ${MYSQL_DATABASE}

depends_on:
db:
condition: service_healthy

db:
image: mysql:8.4
container_name: dishcourse-mysql

environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}

ports:
- "127.0.0.1:${DB_PORT}:3306"

volumes:
- dishcourse_mysql_data:/var/lib/mysql

healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD}"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s

volumes:
dishcourse_mysql_data:
23 changes: 19 additions & 4 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,32 @@
Flask configuration variables.
"""
from os import environ, path
from sqlalchemy import URL

basedir = path.abspath(path.dirname(__file__))
# load_dotenv(path.join(basedir, '.env'))

class Config:
"""Set Flask configuration from .env file."""
# General Config
SECRET_KEY = 'kristofer'
FLASK_APP = 'forum.app'

# Database
SQLALCHEMY_DATABASE_URI = 'sqlite:///circuscircus.db'
# Reject request bodies over 2.5MB outright (avatar uploads are capped at
# 2MB in forum/user.py; this is a blunt server-side backstop so an
# oversized upload doesn't even get fully read into memory).
MAX_CONTENT_LENGTH = int(2.5 * 1024 * 1024)

DB_USER = environ.get("DB_USER")
DB_PASSWORD = environ.get("DB_PASSWORD")
DB_HOST = environ.get("DB_HOST", "localhost")
DB_NAME = environ.get("DB_NAME", "circuscircuslimes")

SQLALCHEMY_DATABASE_URI = URL.create(
drivername="mysql+pymysql",
username=DB_USER,
password=DB_PASSWORD,
host=DB_HOST,
database=DB_NAME
)

SQLALCHEMY_ECHO = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
Loading