Compare commits

..

13 Commits

Author SHA1 Message Date
WGAVermeer
d8800daba3 created base gallery app, made start on documentation.
Some checks failed
Gitea Test. / tests (push) Has been cancelled
2026-04-09 10:35:28 +02:00
WGAVermeer
5fd943db85 cleaned up dockerfile, removed useless expose as the port is configured in the compose.yaml file. Moved standard ENV into buildfile as they should always be executed no matter the compose variant executed. 2026-04-09 10:34:37 +02:00
WGAVermeer
00db9182d9 added admindocs for automatic documentation. 2026-04-09 10:32:38 +02:00
WGAVermeer
3f52db35c2 added requirements for enforced linting. 2026-04-09 10:31:43 +02:00
WGAVermeer
16c1913e69 hardened makefile by referencing 'web' container as it is specified in the docker compose file. 2026-04-09 10:31:01 +02:00
WGAVermeer
5490593b94 added database healthcheck, removed old test profile, implemented network segregation for containers. 2026-04-09 10:29:53 +02:00
c4785455eb Merge pull request 'woutervermeer-patch-1' (#20) from woutervermeer-patch-1 into pre-prod
All checks were successful
Gitea Test. / tests (push) Successful in 6s
Reviewed-on: #20
2026-03-28 11:33:25 +00:00
b463e5b18b Merge branch 'pre-prod' into woutervermeer-patch-1
All checks were successful
Gitea Test. / tests (pull_request) Successful in 6s
2026-03-28 11:32:49 +00:00
WGAVermeer
76c0cf3e74 Merge branch 'pre-prod' of https://gitea.woutervermeer.com/Quatsh/Quatsh-Website into pre-prod
All checks were successful
Gitea Test. / tests (push) Successful in 13s
2026-03-28 12:31:03 +01:00
WGAVermeer
68689ea885 Updated readme, started extra documentation, started feature list/plan. 2026-03-28 12:30:57 +01:00
74ee2f1965 Delete .gitea/workflows/build_test.yaml
All checks were successful
Gitea Test. / tests (pull_request) Successful in 6s
2026-03-26 10:12:42 +00:00
048828f2d2 Update .gitea/workflows/test.yaml 2026-03-26 10:12:10 +00:00
f6293b7a0c Merge pull request 'Align pre-prod with main' (#19) from main into pre-prod
All checks were successful
Gitea Test. / tests (push) Successful in 5s
Reviewed-on: #19
2026-03-26 09:53:27 +00:00
21 changed files with 215 additions and 47 deletions

View File

@@ -1,20 +0,0 @@
name: Gitea build & Test.
run-name: ${{ gitea.actor }}
on:
push:
branches:
- main
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and test
run: make test
- name: Build
run: make prod

View File

@@ -3,6 +3,7 @@ run-name: ${{ gitea.actor }}
on:
push:
branches:
- main
- pre-prod
pull_request:

View File

@@ -1,15 +1,15 @@
FROM python:3.14-alpine
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
WORKDIR /src
COPY requirements.txt /src/
COPY gunicorn.conf.py /src/
COPY ./src/ /src/
RUN pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
EXPOSE 8000
COPY gunicorn.conf.py /src/
COPY ./src/ /src/
CMD ["gunicorn", "website.wsgi:application"]

View File

@@ -1,20 +1,22 @@
.SHELLFLAGS := -ec
prod:
docker compose down
docker compose --env-file .env -f ./compose.yaml -f ./.docker-compose-files/compose.prod.yaml up -d --build
docker exec quatsh-website-web-1 python manage.py collectstatic --noinput
docker exec quatsh-website-web-1 python manage.py check --deploy
docker exec quatsh-website-web-1 python manage.py migrate
docker compose exec web python manage.py collectstatic --noinput
docker compose exec web python manage.py check --deploy
docker compose exec web python manage.py migrate
dev:
docker compose down
docker compose -f ./compose.yaml -f ./.docker-compose-files/compose.dev.yaml up --build -d
docker exec quatsh-website-web-1 python manage.py collectstatic --noinput
docker exec -it quatsh-website-web-1 sh
docker compose exec web python manage.py collectstatic --noinput
docker compose exec -it web sh
dev_restart:
docker compose down
docker compose -f ./compose.yaml -f ./.docker-compose-files/compose.dev.yaml up -d
docker exec -it quatsh-website-web-1 sh
docker compose exec -it web sh
dev_restart_with_logs:
docker compose down

View File

@@ -6,12 +6,18 @@
Running this requires the use of "make" and docker.
"make" tends to come pre-installed on linux but not on Windows, to install it on Windows I recommend using Chocolatey as follows: \
~"make" tends to come pre-installed on linux but not on Windows, to install it on Windows I recommend using Chocolatey as follows~
```
```shell
choco install make
```
EDIT: I've swapped over to using [[scoop](https://github.com/ScoopInstaller/Scoop#readme)] for these kinds of installations.
```shell
scoop install make
```
### Install docker
<https://docs.docker.com/get-started/get-docker/>
@@ -62,4 +68,3 @@ Or
```shell
make
```

View File

@@ -3,11 +3,11 @@ services:
build: .
command: gunicorn website.wsgi:application
depends_on:
- db
db:
condition: service_healthy
environment:
ALLOWED_HOSTS: ${NGINX_HOSTNAME}
PYTHONDONTWRITEBYTECODE: 1
PYTHONUNBUFFERED: 1
DJANGO_SETTINGS_MODULE: ${DJANGO_SETTINGS_MODULE}
VIRTUAL_HOST: localhost
#VIRTUAL_PORT: 8000
@@ -15,6 +15,9 @@ services:
volumes:
- static_volume:/app/static
- media_volume:/app/media
networks:
- frontend
- backend
db:
@@ -26,6 +29,12 @@ services:
volumes:
- postgres_data:/var/lib/postgresql
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DBNAME}"]
interval: 5s
retries: 5
networks:
- backend
adminer:
image: adminer
@@ -33,7 +42,9 @@ services:
- db
restart: always
ports:
- 8080:8080
- 127.0.0.1:8080:8080
networks:
- backend
proxy:
image: nginx:stable
@@ -51,15 +62,12 @@ services:
- NGINX_SSL_PORT=443
depends_on:
- web
networks:
- frontend
test:
build: .
command: python manage.py test
depends_on:
- db
profiles:
- test
networks:
frontend:
backend:
volumes:
postgres_data:

24
docs/ROADMAP.md Normal file
View File

@@ -0,0 +1,24 @@
# Goals
This document contains the wanted feature list and their current state.
## Basic Pages
-[] Homepage
-[] Boards
-[] Committee page
-[] Contact page
-[] Donator page/Friends of Quatsh
-[] Membership page
## Main Features
-[] Signup form with email SMTP link.
-[] Gallery
-[] Login page
## Extra's
-[] Allow google-workspace login with SSO?
-[] Add Redis for Caching
-[] Setup SMTP with automatic switching to in-mem email saving OR print to stdout when in DEBUG mode.

View File

31
docs/environment.md Normal file
View File

@@ -0,0 +1,31 @@
# Details on environment variables
## Nginx
### NGINX_HOSTNAME
## Django
### DEBUG
### DJANGO_SETTINGS_MODULE
### DJANGO_SECRET_KEY
## Database (PostgreSQL)
### POSTGRES_HOST
### POSTGRES_PORT
### POSTGRES_USER
### POSTGRES_PASSWORD
### POSTGRES_DBNAME
## Gunicorn
### GUNICORN_WORKERS
### GUNICORN_TIMEOUT

22
docs/installation_faq.md Normal file
View File

@@ -0,0 +1,22 @@
# Common Issues & Questions
## Environment
### Postgres Database
The database login-details are set upon first-launch.
Therefore trying to change them later, after first-launch, will require a change of these details.
A way of sidestepping manually changing this in the DB-shell is by deleting the postgres data volume.
> [!WARNING]
> Do not run this command in prod, it will delete ALL data in our database.
```shell
docker volume rm quatsh-website_postgres-data
```
After running this command a Django Migration has to be run to remake the tables.
``` shell
docker exec quatsh-website-web-1 python manage.py migrate
```

72
docs/templates/template.md vendored Normal file
View File

@@ -0,0 +1,72 @@
# Feature Name
> One sentence description of what this feature does and who it is for.
## Status
<!-- Delete all that do not apply -->
`Planned` `In Progress` `In Review` `Complete` `Deferred`
## Background
<!-- Why are we building this? What problem does it solve? Link to any relevant roadmap phase. -->
## Scope
<!-- What is included in this feature. Be explicit about what is out of scope too. -->
**In scope:**
-
**Out of scope:**
-
## User Stories
<!-- Who interacts with this feature and what do they want to achieve? -->
- As a **[member / board member / anonymous visitor]**, I want to **[action]** so that **[outcome]**.
## Data Model
<!-- What models are created or modified? List fields and their types. -->
```python
class ExampleModel(models.Model):
pass
```
**Related models:**
- `User`
## GDPR Considerations
<!-- See docs/gdpr/ for shared policies. Only document what is specific to this feature. -->
| Question | Answer |
|---|---|
| Personal data collected | |
| Legal basis | Legitimate interest / Consent / Legal obligation |
| Retention period | See `docs/gdpr/retention-policy.md` / [custom policy] |
| Erasure behaviour | Cascade delete / Anonymise / Transfer ownership |
| Visible to non-members | Yes / No |
## Open Questions
<!-- Unresolved decisions that are blocking or will affect implementation. -->
- [ ]
## Decisions Log
<!-- Record decisions made during development so future contributors understand why things are the way they are. -->
| Date | Decision | Reasoning |
|---|---|---|
| YYYY-MM-DD | | |
## Tasks
<!-- Break the feature down into concrete implementation steps. -->
### Backend
- [ ]
### Frontend
- [ ]
### Tests
- [ ]
## Related
<!-- Links to related feature files, external docs, or GitHub issues. -->
-

View File

@@ -3,3 +3,7 @@ gunicorn==25.1.0
psycopg [binary] ==3.3.3
django-browser-reload
django-watchfiles
docutils==0.22.4
ruff==0.15.9
Mypy==1.20
django-stubs==5.0.2

0
src/gallery/__init__.py Normal file
View File

3
src/gallery/admin.py Normal file
View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

5
src/gallery/apps.py Normal file
View File

@@ -0,0 +1,5 @@
from django.apps import AppConfig
class GalleryConfig(AppConfig):
name = 'gallery'

View File

3
src/gallery/models.py Normal file
View File

@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
src/gallery/tests.py Normal file
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

3
src/gallery/views.py Normal file
View File

@@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

View File

@@ -40,6 +40,7 @@ INSTALLED_APPS = [
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"django.contrib.admindocs",
"django_browser_reload",
"django_watchfiles",
]

View File

@@ -19,7 +19,8 @@ from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path("__reload__/", include("django_browser_reload.urls")),
path("polls/", include("polls.urls")),
path("admin/doc/", include("django.contrib.admindocs.urls")),
path("admin/", admin.site.urls),
path("__reload__/", include("django_browser_reload.urls")),
]