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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

tags

/.app_secret.txt
/.db_username
/.db_password
/.ghci
Expand All @@ -18,3 +19,6 @@ tags
/log/
/stack.yaml.lock
/target/

/frontend/dist/
/frontend/node_modules/
4 changes: 2 additions & 2 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Vandyland
Copyright (c) 2017, Jason Bertsche
zócalo
Copyright (c) 2026, Jason Bertsche, Corey Brady
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: vandyland
web: zocalo
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Vandyland
zócalo
===============

### Installation Instructions
Expand Down Expand Up @@ -36,11 +36,11 @@ Vandyland
* Use `sudo systemctl status rc-local` to diagnose; values other than `Active: active` indicate error
* Run whatever your startup script is (e.g. `/etc/rc.local`, if this Postgres-related stuff is all that's in it) to finally launch Postgres

#### Vandyland-Specific Postgres Setup
#### zócalo-Specific Postgres Setup

* Next, you'll need to initialize the Postgres database tables
* Run `psql --username=postgres`
* `CREATE DATABASE vandyland WITH ENCODING='UTF8' CONNECTION LIMIT=-1;`
* `CREATE DATABASE zocalo WITH ENCODING='UTF8' CONNECTION LIMIT=-1;`
* `CREATE DATABASE badgerstate WITH ENCODING='UTF8' CONNECTION LIMIT=-1;`
* `exit`

Expand All @@ -49,13 +49,14 @@ Vandyland
* `touch .db_username .db_password`
* Use your preferred editor to set the sole contents of `.db_username` to your Postgres username (default: `postgres`)
* Use your preferred editor to set the sole contents of `.db_password` to your Postgres password (default: ``)
* This isn't related to Postgres, but run `head -c 32 /dev/urandom | base64 > .app_secret.txt` to set up an application secret

### Running

* To run the server without HTTP, run `stack build && stack exec vandyland`
* To run the server without HTTP, run `stack build && stack exec zocalo`

* For HTTPS support, ensure that your SSL cert is accessible and run this command: `stack build && sudo /PATH/TO/STACK/stack exec --allow-different-user vandyland -- --port=80 --ssl-port=443 --ssl-cert=/PATH/TO/CERT/cert.pem --ssl-key=/PATH/TO/KEY/privkey.pem --ssl-address=0.0.0.0 --no-ssl-chain-cert` (your filenames for the key and cert may differ)
* For HTTPS support, ensure that your SSL cert is accessible and run this command: `stack build && sudo /PATH/TO/STACK/stack exec --allow-different-user zocalo -- --port=80 --ssl-port=443 --ssl-cert=/PATH/TO/CERT/cert.pem --ssl-key=/PATH/TO/KEY/privkey.pem --ssl-address=0.0.0.0 --no-ssl-chain-cert` (your filenames for the key and cert may differ)

### API Docs

Web API docs can be found [here](https://github.com/TheBizzle/Vandyland/wiki/Web-API).
Web API docs can be found [here](https://github.com/TheBizzle/zocalo/wiki/Web-API).
18 changes: 11 additions & 7 deletions app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ module Main(main) where

import Snap.Core(dir, route)
import Snap.Http.Server(quickHttpServe)
import Snap.Util.FileServe(serveDirectory)
import Snap.Util.FileServe(serveDirectory, serveFile)

import qualified Vandyland.BadgerState.Controller as BadgerState
import qualified Vandyland.Gallery.Controller as Gallery
import qualified Zocalo.BadgerState.Controller as BadgerState
import qualified Zocalo.Gallery.Controller as Gallery

main :: IO ()
main = quickHttpServe $
route (BadgerState.routes <> Gallery.routes) <|>
dir "gallery" (serveDirectory "gallery") <|>
dir "html" (serveDirectory "html")
main =
do
Gallery.runMigrations
quickHttpServe $
route (BadgerState.routes <> Gallery.routes) <|>
dir "gallery" (serveDirectory "gallery") <|>
dir "html" (serveDirectory "html") <|>
serveFile "frontend/dist/index.html" -- Needed for Vue to use `createWebHistory` --Jason B. (3/15/26)
11 changes: 11 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#! /usr/bin/env bash

set -e

cd frontend/
npm run build
cd ..

stack build

killall zocalo
61 changes: 61 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Gallery App — Frontend

## Project Structure

```
src/
├── assets/
│ └── styles.css # Global design system (variables, components, utilities)
├── components/
│ ├── AppNavbar.vue # Top navigation bar
│ ├── CommentThread.vue # Reusable comment section
│ └── CreateGalleryForm.vue # New gallery creation form
├── views/
│ ├── RegisterView.vue # Teacher registration
│ ├── LoginView.vue # Two-step OTP login
│ ├── MetaGalleryView.vue # Teacher dashboard (list + create galleries)
│ ├── ModerationView.vue # Teacher moderation (pending / approved panes)
│ ├── StudentGalleryView.vue # Basic student gallery (grid + upload + comments)
│ └── SplitGalleryView.vue # Split-pane gallery (sidebar list + iframe viewer)
├── App.vue # Root component + page transitions
└── main.ts # App entry, Vue Router setup
```

## Routes

| Path | View | Who uses it |
|-------------------------------|-----------------------|--------------------------|
| `/login` | LoginView | Teachers |
| `/register` | RegisterView | New teachers |
| `/galleries/teacher/overview` | MetaGalleryView | Logged-in teachers |
| `/moderate/:id` | ModerationView | Teacher (moderation) |
| `/gallery/:id` | StudentGalleryView | Students (basic gallery) |
| `/gallery/:id/split` | SplitGalleryView | Students (split/iframe) |

## How to build

Dev:

```bash
npm install
npm run dev # Vite dev server on http://localhost:5173
```

Prod preview:

```bash
npm run preview # Outputs static files to dist/ and launches at http://localhost:4173
```

## Design System

All colours, spacing, and typography are driven by CSS custom properties in
`src/assets/styles.css`. Key variables:

- `--clr-primary` → golden amber (#c49a0a)
- `--clr-accent` → sky blue (#3d7ea6)
- `--clr-bg` → warm white (#fdfaf3)
- `--font-display` → Fraunces (serif, for headings)
- `--font-body` → DM Sans (for UI text)

Fonts are loaded from Google Fonts.
Loading
Loading