Skip to content

Commit 841e175

Browse files
Merge pull request #5 from TheRealDarkCoder/chore/repo-setup
Chore/repo setup
2 parents 6f95ea1 + 47f80e3 commit 841e175

37 files changed

Lines changed: 8163 additions & 3 deletions

.env.example

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# ============================================================================
2+
# Routis Environment Configuration
3+
# ============================================================================
4+
# Copy this file to .env and fill in your values.
5+
# For local development, the defaults below are safe.
6+
# For production, use strong, unique values and never commit the actual .env file.
7+
8+
# ============================================================================
9+
# Application Environment
10+
# ============================================================================
11+
12+
# deployment environment: development, staging, production
13+
APP_ENV=development
14+
15+
# ============================================================================
16+
# Database (PostgreSQL)
17+
# ============================================================================
18+
19+
# PostgreSQL connection string
20+
# Format: postgresql://username:password@host:port/database
21+
# Local dev: use "postgres" hostname (Docker service name)
22+
# Production: use managed RDS endpoint or external host
23+
DATABASE_URL=postgresql://postgres:postgres@postgres:5432/routis
24+
25+
# PostgreSQL credentials (used by docker-compose for initialization)
26+
POSTGRES_USER=postgres
27+
POSTGRES_PASSWORD=postgres
28+
POSTGRES_DB=routis
29+
30+
# ============================================================================
31+
# Cache & Rate Limiting (Redis)
32+
# ============================================================================
33+
34+
# Redis connection URL
35+
# Format: redis://[password@]host:port/[db]
36+
# Local dev: use "redis" hostname (Docker service name)
37+
# Production: use ElastiCache endpoint or external Redis host
38+
REDIS_URL=redis://redis:6379/0
39+
40+
# ============================================================================
41+
# Security & Anonymity
42+
# ============================================================================
43+
44+
# Secret salt for email verification hashing
45+
# Used in: SHA256(email + implementation_id + SECRET_SALT)
46+
# Must be a long, random, secret string
47+
# Generate: openssl rand -hex 32
48+
SECRET_SALT=your-secret-salt-change-this-in-production-never-commit-the-real-value
49+
50+
# ============================================================================
51+
# AWS S3 (Database Backups)
52+
# ============================================================================
53+
54+
# S3 bucket name for database backups
55+
# Bucket should have versioning and object lock enabled
56+
# See: docs/runbooks/restore-db.md
57+
S3_BACKUP_BUCKET=routis-db-backups-prod
58+
59+
# AWS access credentials (for db-backup sidecar container)
60+
# DO NOT commit these to version control
61+
# Use IAM roles in production, or AWS Secrets Manager
62+
AWS_ACCESS_KEY_ID=your-aws-access-key-id
63+
AWS_SECRET_ACCESS_KEY=your-aws-secret-access-key
64+
65+
# AWS region for S3 operations
66+
AWS_REGION=eu-west-1
67+
68+
# Backup retention policy
69+
# Daily backups retained for N days; weekly backups for N weeks
70+
S3_BACKUP_RETENTION_DAYS=30
71+
S3_BACKUP_RETENTION_WEEKS=26
72+
73+
# ============================================================================
74+
# Frontend (Next.js)
75+
# ============================================================================
76+
77+
# Public API URL (exposed to browser)
78+
# Local dev: http://localhost:8000
79+
# Production: https://api.yourdomain.com
80+
NEXT_PUBLIC_API_URL=http://localhost:8000
81+
82+
# ============================================================================
83+
# Email Verification (Future)
84+
# ============================================================================
85+
86+
# Email provider credentials (stub for now)
87+
# SMTP_HOST=smtp.example.com
88+
# SMTP_PORT=587
89+
# SMTP_USER=noreply@routis.local
90+
# SMTP_PASSWORD=your-email-password
91+
92+
# Email domain whitelist (comma-separated)
93+
# Only @student.oulu.fi addresses can verify reviews
94+
ALLOWED_EMAIL_DOMAINS=student.oulu.fi
95+
96+
# ============================================================================
97+
# Feature Flags (Future)
98+
# ============================================================================
99+
100+
# ENABLE_EMAIL_VERIFICATION=false
101+
# ENABLE_LEADERBOARD=true

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Bug
3+
about: Something is broken
4+
labels: type/bug
5+
---
6+
7+
**What happened**
8+
<!-- What did you do, what did you expect, what actually occurred? -->
9+
10+
**To reproduce**
11+
<!-- Minimal steps. -->
12+
13+
**Environment**
14+
<!-- Local / staging / prod. Browser or API. Relevant versions. -->
15+
16+
**Notes**
17+
<!-- Logs, screenshots, or leave blank. -->

.github/ISSUE_TEMPLATE/feature.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature
3+
about: A new capability or improvement
4+
labels: type/feature
5+
---
6+
7+
**What and why**
8+
<!-- One or two sentences. What does this do and why does it matter? -->
9+
10+
**Milestone**
11+
<!-- M0 / M1 / M2 / M3 / M4 / M5 -->
12+
13+
**Done when**
14+
<!-- The specific, verifiable condition that closes this issue. -->
15+
16+
**Notes**
17+
<!-- Implementation hints, constraints, links to ADRs, or leave blank. -->

.github/pull_request_template.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Closes #<!-- issue number -->
2+
3+
**What changed**
4+
<!-- One paragraph. Why this approach? -->
5+
6+
**Checklist**
7+
- [ ] Linked issue above
8+
- [ ] `docker compose up` works locally
9+
- [ ] Tests added or existing tests cover this (or N/A)
10+
- [ ] Migration included if schema changed
11+
- [ ] `schema.dbml` updated if schema changed
12+
- [ ] Codegen re-run if API routes or schemas changed

.github/workflows/ci.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main, develop]
6+
push:
7+
branches: [develop]
8+
9+
jobs:
10+
web:
11+
name: Web
12+
runs-on: ubuntu-latest
13+
defaults:
14+
run:
15+
working-directory: apps/web
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 22
23+
cache: npm
24+
cache-dependency-path: apps/web/package-lock.json
25+
26+
- run: npm ci
27+
28+
- run: npm run lint
29+
30+
- run: npm run build
31+
32+
api:
33+
name: API
34+
runs-on: ubuntu-latest
35+
defaults:
36+
run:
37+
working-directory: apps/api
38+
39+
services:
40+
postgres:
41+
image: postgres:18-alpine
42+
env:
43+
POSTGRES_USER: postgres
44+
POSTGRES_PASSWORD: postgres
45+
POSTGRES_DB: routis_test
46+
options: >-
47+
--health-cmd pg_isready
48+
--health-interval 10s
49+
--health-timeout 5s
50+
--health-retries 5
51+
ports:
52+
- 5432:5432
53+
54+
steps:
55+
- uses: actions/checkout@v4
56+
57+
- uses: astral-sh/setup-uv@v5
58+
with:
59+
enable-cache: true
60+
cache-dependency-glob: apps/api/uv.lock
61+
62+
- run: uv sync --frozen
63+
64+
- run: uv run ruff check .
65+
66+
- run: uv run ruff format --check .
67+
68+
- name: Pytest
69+
run: uv run pytest
70+
env:
71+
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/routis_test
72+
REDIS_URL: redis://localhost:6379

.github/workflows/cla.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ jobs:
1717
with:
1818
path-to-signatures: "signatures/version1/cla.json"
1919
path-to-document: "https://github.com/TheRealDarkCoder/Routis/blob/main/docs/CLA.md" # IMPORTANT: Update this URL!
20-
branch: "main"
20+
branch: "signatures"
2121
allowlist: dependabot[bot],greenkeeper[bot]

README.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Routis
2+
3+
Anonymous course review platform for the University of Oulu. Students can submit reviews of courses without creating an account, with optional email-based verification for added credibility.
4+
5+
## Tech Stack
6+
7+
- **Frontend:** Next.js 16, React 19, Tailwind CSS 4, TypeScript
8+
- **Backend:** FastAPI, SQLAlchemy, Pydantic v2, Python 3.13
9+
- **Database:** PostgreSQL 18, Alembic (migrations)
10+
- **Cache:** Redis 7
11+
- **Infrastructure:** Docker Compose
12+
13+
## Getting Started
14+
15+
```bash
16+
cp .env.example .env
17+
docker compose up
18+
```
19+
20+
- Web: http://localhost:3000
21+
- API: http://localhost:8000
22+
- API docs: http://localhost:8000/docs
23+
24+
## Project Structure
25+
26+
```
27+
apps/
28+
web/ # Next.js frontend
29+
api/ # FastAPI backend
30+
packages/
31+
shared/ # Shared schemas & generated types
32+
docs/ # Architecture docs, ADRs, runbooks
33+
infra/ # Deployment config
34+
```
35+
36+
## Development
37+
38+
**Frontend:**
39+
40+
```bash
41+
cd apps/web
42+
npm ci
43+
npm run dev
44+
```
45+
46+
**Backend:**
47+
48+
```bash
49+
cd apps/api
50+
uv sync
51+
uv run fastapi dev main.py
52+
```
53+
54+
**Lint & Test:**
55+
56+
```bash
57+
# Frontend
58+
cd apps/web && npm run lint
59+
60+
# Backend
61+
cd apps/api && ruff check . && ruff format --check . && uv run pytest
62+
```
63+
64+
## Documentation
65+
66+
- [Architecture](docs/ARCHITECTURE.md)
67+
- [Architecture Decision Records](docs/decisions/)
68+
- [Runbooks](docs/runbooks/)
69+
70+
## License
71+
72+
[AGPL-3.0](COPYING)

apps/api/.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

apps/api/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM python:3.13-slim
2+
3+
WORKDIR /app
4+
5+
# Install system dependencies
6+
RUN apt-get update && apt-get install -y --no-install-recommends \
7+
gcc \
8+
postgresql-client \
9+
&& rm -rf /var/lib/apt/lists/*
10+
11+
# Install uv
12+
RUN pip install --no-cache-dir uv
13+
14+
# Copy dependency files
15+
COPY pyproject.toml uv.lock ./
16+
17+
# Install dependencies
18+
RUN uv sync --frozen --no-dev
19+
20+
# Copy application code
21+
COPY . .
22+
23+
EXPOSE 8000
24+
25+
# Use uv run to execute through the virtual environment
26+
CMD ["uv", "run", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]

apps/api/README.md

Whitespace-only changes.

0 commit comments

Comments
 (0)