Compare commits

..

10 Commits

9 changed files with 3360 additions and 5 deletions

3
.gitignore vendored
View File

@@ -6,3 +6,6 @@ dist
*.db-wal
.DS_Store
coverage
*.tsbuildinfo
vite.config.js
vite.config.d.ts

48
README.md Normal file
View File

@@ -0,0 +1,48 @@
quick ai-generated code base, stashed for later / to remember / give an idea
# Mitwirkung
Mitwirkung ist ein MVP für nachvollziehbare politische Beteiligung. Registrierte Nutzerinnen und Nutzer können eigene Gesetzesentwürfe formulieren, bestehende Vorschläge nach Thema und Status durchsuchen und mit Dafür, Dagegen oder Enthaltung abstimmen.
## Produktidee
Die Plattform strukturiert politische Vorschläge in drei prüfbare Teile: Ausgangslage, konkrete Lösung und erwartete Wirkung. Abstimmungen sind an Nutzerkonten gebunden, können bis zum Ablauf geändert werden und werden transparent aggregiert. Der Demonstrator ist bewusst keine staatliche Plattform und ersetzt kein formelles Gesetzgebungsverfahren.
## Funktionen
- Registrierung, Anmeldung und sichere HTTP-only Session-Cookies
- Thematische Übersicht mit Filterung und Sortierung
- Detailseiten mit Frist, Urheber, Begründung und Live-Ergebnis
- Einmalige, änderbare Abstimmung pro Nutzerkonto und Entwurf
- Strukturierter Editor für eigene Gesetzesentwürfe
- Responsives Frontend für Desktop und Mobilgeräte
- SQLite-Datenbank mit Demo-Inhalten
## Lokaler Start
```bash
npm install
npm run dev
```
Frontend: `http://localhost:5173`
API: `http://localhost:4000`
Demo-Anmeldung: `leonie@mitwirkung.de` / `demo1234`
## Produktion und Tests
```bash
npm test
npm run build
npm start
```
Nach dem Build liefert der Express-Server unter `http://localhost:4000` auch das React-Frontend aus.
## Technik
- React 19, TypeScript, Vite
- Express 5, Zod, JWT, bcrypt
- SQLite über `better-sqlite3`
- Vitest und Supertest

38
apps/api/src/app.test.ts Normal file
View File

@@ -0,0 +1,38 @@
import request from "supertest";
import { describe, expect, it } from "vitest";
import { app } from "./app.js";
describe("Mitwirkung API", () => {
it("liefert Themen und initiale Entwürfe", async () => {
const [topics, bills] = await Promise.all([
request(app).get("/api/topics"),
request(app).get("/api/bills"),
]);
expect(topics.status).toBe(200);
expect(topics.body.topics.length).toBeGreaterThanOrEqual(6);
expect(bills.status).toBe(200);
expect(bills.body.bills.length).toBeGreaterThanOrEqual(5);
});
it("meldet einen Nutzer an und speichert genau eine aktuelle Stimme", async () => {
const agent = request.agent(app);
const login = await agent.post("/api/auth/login").send({
email: "leonie@mitwirkung.de",
password: "demo1234",
});
expect(login.status).toBe(200);
const vote = await agent.post("/api/bills/1/vote").send({ value: "yes" });
expect(vote.status).toBe(200);
const detail = await agent.get("/api/bills/1");
expect(detail.status).toBe(200);
expect(detail.body.bill.userVote).toBe("yes");
});
it("verhindert anonyme Abstimmungen", async () => {
const response = await request(app).post("/api/bills/1/vote").send({ value: "no" });
expect(response.status).toBe(401);
});
});

View File

@@ -1,6 +1,18 @@
import { app } from "./app.js";
import express from "express";
import { existsSync } from "node:fs";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
const port = Number(process.env.PORT || 4000);
const here = dirname(fileURLToPath(import.meta.url));
const webDist = resolve(here, "../../web/dist");
if (existsSync(webDist)) {
app.use(express.static(webDist));
app.get(/^(?!\/api).*/, (_req, res) => res.sendFile(resolve(webDist, "index.html")));
}
app.listen(port, () => {
console.log(`Mitwirkung API läuft auf http://localhost:${port}`);
});

285
apps/web/src/styles.css Normal file
View File

@@ -0,0 +1,285 @@
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Newsreader:ital,opsz,wght@1,6..72,500;1,6..72,600&display=swap');
:root {
font-family: "DM Sans", Arial, sans-serif;
color: #17241d;
background: #f5f2ea;
font-synthesis: none;
--ink: #17241d;
--muted: #667069;
--paper: #f5f2ea;
--cream: #ebe6da;
--white: #fffefa;
--green: #245c44;
--green-dark: #173f2e;
--lime: #d9e6a4;
--border: #d8d5ca;
--serif: "Newsreader", Georgia, serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(245, 242, 234, .94); border-bottom: 1px solid rgba(23,36,29,.12); backdrop-filter: blur(14px); }
.header-inner { height: 74px; max-width: 1420px; margin: auto; padding: 0 48px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; letter-spacing: -.6px; }
.logo-mark { width: 28px; height: 28px; position: relative; display: flex; gap: 2px; align-items: flex-end; transform: skew(-5deg); }
.logo-mark i { width: 7px; background: var(--green); border-radius: 1px; display: block; }
.logo-mark i:nth-child(1) { height: 15px; }
.logo-mark i:nth-child(2) { height: 23px; }
.logo-mark i:nth-child(3) { height: 19px; }
.main-nav { display: flex; align-items: center; gap: 32px; margin-left: auto; }
.main-nav a { position: relative; color: #4b554f; font-size: 14px; font-weight: 600; }
.main-nav a:hover, .main-nav a.active { color: var(--green); }
.main-nav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -27px; height: 2px; background: var(--green); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.button { min-height: 42px; border: 0; border-radius: 3px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 700; font-size: 14px; transition: .2s ease; }
.button-primary { background: var(--green); color: #fff; box-shadow: 0 5px 15px rgba(36,92,68,.16); }
.button-primary:hover { background: var(--green-dark); transform: translateY(-1px); }
.button-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.button-ghost { background: transparent; color: var(--ink); border: 1px solid var(--border); }
.button-ghost:hover { border-color: var(--green); color: var(--green); }
.button-large { min-height: 52px; padding: 0 24px; }
.button-wide { width: 100%; min-height: 50px; }
.menu-toggle { display: none; border: 0; background: transparent; color: var(--ink); padding: 5px; }
.profile-wrap { position: relative; }
.profile-button { border: 0; background: transparent; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.avatar, .mini-avatar { display: grid; place-items: center; border-radius: 50%; background: #dbe3ca; color: var(--green-dark); font-weight: 700; }
.avatar { width: 34px; height: 34px; font-size: 11px; }
.mini-avatar { width: 35px; height: 35px; font-size: 10px; flex: 0 0 auto; }
.profile-menu { position: absolute; right: 0; top: 48px; min-width: 230px; padding: 12px; background: var(--white); border: 1px solid var(--border); box-shadow: 0 15px 40px rgba(23,36,29,.13); }
.profile-menu span { display: block; padding: 8px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--border); }
.profile-menu button { border: 0; width: 100%; padding: 11px 8px 5px; display: flex; align-items: center; gap: 8px; color: #84372e; background: transparent; }
.hero { min-height: 690px; position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 330px; grid-template-rows: 1fr auto; background: var(--cream); padding: 95px max(48px, calc((100vw - 1324px)/2)); }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .22; background-image: radial-gradient(#7a847b 0.6px, transparent 0.6px); background-size: 6px 6px; mask-image: linear-gradient(90deg, transparent 0%, #000 50%, transparent 100%); }
.hero-content { position: relative; z-index: 2; align-self: center; max-width: 840px; padding-bottom: 60px; }
.eyebrow { color: var(--green); font-size: 12px; text-transform: uppercase; letter-spacing: 1.8px; font-weight: 700; margin: 0 0 20px; }
.hero .eyebrow { display: flex; align-items: center; gap: 10px; }
.hero .eyebrow span { display: block; width: 28px; height: 1px; background: var(--green); }
.hero h1, .create-heading h1 { margin: 0; font-size: clamp(57px, 6.2vw, 96px); line-height: .91; font-weight: 600; letter-spacing: -5px; }
h1 em, h2 em { font-family: var(--serif); font-weight: 500; color: var(--green); }
.hero-lead { max-width: 670px; font-size: 19px; line-height: 1.65; color: #4f5b54; margin: 31px 0 34px; }
.hero-actions { display: flex; align-items: center; gap: 30px; }
.text-link { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14px; border-bottom: 1px solid #7c827e; padding-bottom: 4px; }
.hero-manifesto { z-index: 2; align-self: center; border-left: 1px solid rgba(23,36,29,.24); padding: 18px 0 18px 32px; color: #465049; }
.manifesto-number { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--green); }
.hero-manifesto p { font-family: var(--serif); font-size: 26px; line-height: 1.3; margin: 30px 0; }
.hero-manifesto strong { color: var(--green); font-weight: 600; }
.manifesto-line { width: 70px; height: 1px; background: var(--green); margin-bottom: 14px; }
.hero-manifesto > span:last-child { text-transform: uppercase; letter-spacing: 1.2px; font-size: 9px; font-weight: 700; }
.hero-stats { position: relative; z-index: 2; grid-column: 1 / -1; display: flex; border-top: 1px solid rgba(23,36,29,.2); padding-top: 25px; gap: 80px; }
.hero-stats div { display: flex; align-items: baseline; gap: 11px; }
.hero-stats strong { font-family: var(--serif); color: var(--green); font-size: 28px; font-style: italic; }
.hero-stats span { color: var(--muted); font-size: 12px; }
.hero-orbit { position: absolute; border: 1px solid rgba(36,92,68,.12); border-radius: 50%; }
.orbit-one { width: 520px; height: 520px; right: 6%; top: -210px; }
.orbit-two { width: 370px; height: 370px; right: 2%; top: -135px; }
.bills-section, .process-section { max-width: 1324px; margin: auto; padding: 105px 0 120px; }
.section-heading { display: grid; grid-template-columns: 1fr 420px; align-items: end; gap: 50px; margin-bottom: 60px; }
.section-heading h2, .process-heading h2 { font-size: clamp(43px, 4vw, 62px); line-height: .98; letter-spacing: -2.5px; margin: 0; font-weight: 600; }
.section-heading > p { color: var(--muted); line-height: 1.65; margin: 0; }
.topic-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 18px; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.topic-tabs button { white-space: nowrap; border: 1px solid var(--border); border-radius: 99px; padding: 10px 16px; color: #59635c; background: transparent; font-weight: 600; font-size: 12px; transition: .2s; }
.topic-tabs button:hover, .topic-tabs button.active { color: #fff; background: var(--green); border-color: var(--green); }
.topic-tabs sup { margin-left: 5px; opacity: .65; }
.filter-row { min-height: 78px; display: flex; align-items: center; justify-content: space-between; }
.filter-row > span { color: var(--muted); font-size: 13px; }
.filter-row > div { display: flex; gap: 24px; }
.filter-row label { color: var(--muted); text-transform: uppercase; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.filter-row select { border: 0; border-bottom: 1px solid #acaea8; background: transparent; margin-left: 8px; padding: 7px 22px 7px 4px; color: var(--ink); font-weight: 600; font-size: 12px; }
.bill-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.bill-card { opacity: 0; animation: card-in .55s ease forwards; animation-delay: var(--delay); min-height: 410px; position: relative; display: flex; flex-direction: column; background: var(--white); border: 1px solid #dfddd4; padding: 26px 27px 0; transition: transform .25s, box-shadow .25s, border-color .25s; }
.bill-card:hover { transform: translateY(-4px); border-color: #c2c6b9; box-shadow: 0 18px 45px rgba(27,45,34,.09); }
@keyframes card-in { to { opacity: 1; } }
.card-topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.topic-pill { display: inline-flex; align-items: center; color: var(--topic); background: color-mix(in srgb, var(--topic) 10%, white); padding: 6px 9px; font-size: 9px; text-transform: uppercase; font-weight: 700; letter-spacing: .9px; }
.topic-pill::before { content: ""; width: 5px; height: 5px; background: var(--topic); border-radius: 50%; margin-right: 7px; }
.status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; text-transform: uppercase; font-weight: 700; letter-spacing: .7px; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: #8c958f; }
.status-open i { background: #43a26f; box-shadow: 0 0 0 3px #e1f2e7; }
.status-review i { background: #c28c32; box-shadow: 0 0 0 3px #f2eadb; }
.bill-card h3 { font-size: 22px; line-height: 1.25; letter-spacing: -.7px; margin: 23px 0 12px; }
.bill-card > p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 13px; }
.card-author { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 10px; margin-top: auto; padding-top: 22px; }
.card-author strong { display: block; color: #48534c; margin-top: 2px; }
.support-block { margin-top: 20px; }
.support-label { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-bottom: 7px; }
.support-label strong { color: var(--green); }
.support-bar { height: 4px; background: #e6e5df; }
.support-bar i { display: block; height: 100%; background: var(--green); }
.card-footer { min-height: 55px; margin: 19px -27px 0; padding: 0 27px; border-top: 1px solid #e4e2da; display: flex; align-items: center; gap: 17px; color: var(--muted); font-size: 10px; }
.card-footer span { display: flex; align-items: center; gap: 5px; }
.card-arrow { margin-left: auto; color: var(--green); }
.loading-grid, .empty-state { padding: 90px 20px; text-align: center; color: var(--muted); background: rgba(255,255,255,.35); }
.empty-state h3, .empty-state h2 { color: var(--ink); }
.process-section { max-width: none; padding-left: max(48px, calc((100vw - 1324px)/2)); padding-right: max(48px, calc((100vw - 1324px)/2)); background: var(--green-dark); color: #fff; }
.process-heading { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 60px; }
.process-heading .eyebrow { color: #bdccaa; }
.process-heading h2 em { color: #d8e6aa; }
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(255,255,255,.18); }
.process-grid article { min-height: 310px; padding: 30px 28px; border-right: 1px solid rgba(255,255,255,.18); position: relative; }
.process-grid article:first-child { border-left: 1px solid rgba(255,255,255,.18); }
.process-grid article > span { position: absolute; right: 18px; top: 15px; font-family: var(--serif); font-style: italic; color: #a9b8a9; }
.process-grid svg { color: #d8e6aa; width: 30px; height: 30px; margin-top: 30px; }
.process-grid h3 { margin: 56px 0 13px; font-size: 18px; }
.process-grid p { color: #afbbb4; font-size: 13px; line-height: 1.6; }
.site-footer { background: #122f23; color: #fff; padding: 55px 48px; border-top: 1px solid rgba(255,255,255,.1); }
.footer-inner { max-width: 1324px; margin: auto; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.footer-inner .logo-mark i { background: #d8e6aa; }
.footer-inner > div:first-child p { color: #92a299; font-size: 12px; }
.footer-links { display: flex; gap: 25px; font-size: 11px; color: #b9c3bd; }
.footer-note { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; color: #778a7f; font-size: 10px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(12,30,22,.65); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(7px); animation: fade-in .2s; }
@keyframes fade-in { from { opacity: 0; } }
.auth-modal { width: min(470px, 100%); max-height: calc(100vh - 30px); overflow-y: auto; position: relative; background: var(--paper); padding: 42px 48px 35px; box-shadow: 0 30px 100px rgba(0,0,0,.25); }
.auth-modal::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 5px; background: var(--green); }
.modal-close { position: absolute; right: 18px; top: 18px; border: 0; background: transparent; color: var(--muted); }
.auth-modal > .logo { margin-bottom: 40px; }
.auth-modal h2 { font-size: 39px; line-height: 1; letter-spacing: -1.5px; margin: 0; }
.modal-intro { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 15px 0 25px; }
.auth-modal form label, .bill-form label { display: block; font-size: 11px; color: #4c5750; font-weight: 700; margin-bottom: 16px; }
.auth-modal input, .bill-form input, .bill-form textarea, .bill-form select { width: 100%; border: 1px solid #d2d1c9; border-radius: 2px; background: #fffefa; padding: 13px 14px; color: var(--ink); margin-top: 7px; outline: none; transition: .15s; }
.auth-modal input:focus, .bill-form input:focus, .bill-form textarea:focus, .bill-form select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(36,92,68,.08); }
.form-error { color: #a43e31; background: #f8e8e4; padding: 10px 12px; font-size: 12px; line-height: 1.4; }
.auth-switch { text-align: center; color: var(--muted); font-size: 12px; margin: 22px 0 0; }
.auth-switch button { color: var(--green); border: 0; background: transparent; font-weight: 700; margin-left: 5px; }
.demo-hint { text-align: center; color: #78817c; background: #ebe8df; padding: 8px; font-size: 10px; }
.detail-page, .create-page { min-height: 70vh; padding: 52px 48px 110px; }
.detail-shell, .create-shell { max-width: 1324px; margin: auto; }
.back-link { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 45px; }
.back-link:hover { color: var(--green); }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 70px; align-items: start; }
.bill-detail { max-width: 790px; }
.bill-detail h1 { font-size: clamp(44px, 5vw, 70px); line-height: .98; letter-spacing: -3px; margin: 27px 0 22px; }
.detail-summary { color: #556159; font-size: 19px; line-height: 1.6; max-width: 730px; }
.detail-meta { margin-top: 35px; display: flex; align-items: center; gap: 12px; color: var(--muted); }
.detail-meta > div { display: flex; flex-direction: column; font-size: 11px; }
.detail-meta strong { color: #46524a; margin-top: 3px; }
.detail-meta .meta-date { border-left: 1px solid var(--border); padding-left: 23px; margin-left: 12px; }
.detail-meta button { margin-left: auto; border: 1px solid var(--border); background: transparent; padding: 10px; color: var(--green); }
.bill-detail hr { border: 0; border-top: 1px solid var(--border); margin: 45px 0; }
.detail-copy { display: grid; grid-template-columns: 50px 1fr; gap: 20px; margin-bottom: 46px; }
.detail-copy > span, .form-section-title > span { font-family: var(--serif); color: var(--green); font-style: italic; font-size: 17px; }
.detail-copy h2 { font-size: 25px; margin: 0 0 13px; }
.detail-copy p { color: #566158; line-height: 1.8; margin: 0; font-size: 15px; }
.vote-panel { position: sticky; top: 98px; background: var(--white); border: 1px solid #d9d8cf; box-shadow: 0 18px 50px rgba(26,45,34,.08); }
.vote-panel-head { padding: 28px 28px 23px; }
.vote-panel-head .eyebrow { margin-bottom: 11px; }
.vote-panel-head h2 { margin: 0 0 8px; font-size: 24px; }
.vote-panel-head > p:last-child { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.deadline { background: #eff0e7; padding: 13px 28px; display: flex; align-items: center; gap: 11px; color: var(--green); }
.deadline div { display: flex; flex-direction: column; }
.deadline small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .8px; }
.deadline strong { font-size: 13px; margin-top: 2px; }
.vote-buttons { padding: 20px 28px; display: grid; gap: 8px; }
.vote-buttons button { min-height: 62px; text-align: left; padding: 9px 13px; border: 1px solid var(--border); background: transparent; display: flex; align-items: center; gap: 12px; color: #536057; transition: .15s; }
.vote-buttons button:hover { border-color: #89948c; }
.vote-buttons button > svg:first-child { width: 19px; }
.vote-buttons button > svg:last-child { margin-left: auto; width: 17px; }
.vote-buttons button span { display: flex; flex-direction: column; }
.vote-buttons strong { font-size: 13px; color: var(--ink); }
.vote-buttons small { font-size: 9px; color: var(--muted); margin-top: 2px; }
.vote-buttons .vote-yes.selected { border-color: #32805a; background: #edf7f1; color: #24704c; }
.vote-buttons .vote-no.selected { border-color: #a34a3e; background: #fbefed; color: #a34a3e; }
.vote-buttons .vote-neutral.selected { border-color: #777; background: #f1f1ef; }
.vote-panel > .form-error { margin: 0 28px 15px; }
.result-block { border-top: 1px solid var(--border); padding: 21px 28px 12px; }
.result-title { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 17px; }
.result-title span { display: flex; align-items: center; gap: 5px; color: var(--muted); }
.result-row { display: grid; grid-template-columns: 55px 1fr 32px; gap: 8px; align-items: center; margin-bottom: 10px; font-size: 9px; color: var(--muted); }
.result-row > div { height: 4px; background: #e8e7e2; }
.result-row i { display: block; height: 100%; }
.result-row i.yes { background: #32805a; }.result-row i.no { background: #a34a3e; }.result-row i.neutral { background: #92958f; }
.result-row strong { text-align: right; color: var(--ink); }
.vote-note { background: #f1f0ea; color: var(--muted); margin: 8px 0 0; padding: 13px 28px; display: flex; gap: 7px; align-items: center; font-size: 9px; }
.create-heading { max-width: 850px; margin-bottom: 65px; }
.create-heading h1 { font-size: clamp(48px, 6vw, 76px); }
.create-heading > p:last-child { color: var(--muted); font-size: 16px; }
.create-layout { display: grid; grid-template-columns: minmax(0, 850px) 300px; gap: 70px; align-items: start; }
.bill-form { background: var(--white); border: 1px solid #dcdad1; padding: 42px 48px; }
.bill-form section + section { border-top: 1px solid var(--border); margin-top: 42px; padding-top: 42px; }
.form-section-title { display: grid; grid-template-columns: 35px 1fr; margin-bottom: 30px; }
.form-section-title h2 { margin: 0; font-size: 24px; }
.form-section-title p { color: var(--muted); font-size: 12px; margin: 5px 0 0; }
.bill-form label small { float: right; color: #92978f; font-weight: 400; }
.bill-form textarea { resize: vertical; line-height: 1.55; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-submit { border-top: 1px solid var(--border); padding-top: 25px; margin-top: 30px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.form-submit p { color: var(--muted); font-size: 10px; max-width: 230px; }
.writing-guide { position: sticky; top: 100px; padding: 28px 0; }
.writing-guide h3 { font-family: var(--serif); font-size: 27px; line-height: 1.1; margin-bottom: 28px; }
.writing-guide > div { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 17px 0; border-top: 1px solid var(--border); }
.writing-guide svg { width: 20px; color: var(--green); }
.writing-guide p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.writing-guide strong { display: block; color: var(--ink); margin-bottom: 3px; font-size: 12px; }
@media (max-width: 1100px) {
.header-inner { padding: 0 24px; }
.main-nav { display: none; position: absolute; top: 74px; left: 0; right: 0; background: var(--paper); padding: 25px; border-bottom: 1px solid var(--border); }
.main-nav.open { display: flex; flex-direction: column; align-items: flex-start; }
.main-nav a.active::after { display: none; }
.menu-toggle { display: block; }
.hero { grid-template-columns: 1fr; padding: 80px 48px 45px; }
.hero-manifesto { display: none; }
.bills-section { padding-left: 35px; padding-right: 35px; }
.bill-grid { grid-template-columns: repeat(2, 1fr); }
.process-grid { grid-template-columns: repeat(2, 1fr); }
.detail-layout { gap: 35px; grid-template-columns: minmax(0, 1fr) 350px; }
.create-layout { gap: 35px; grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (max-width: 760px) {
.header-inner { height: 64px; padding: 0 16px; }
.main-nav { top: 64px; }
.header-create { font-size: 0; width: 40px; padding: 0; }
.header-create svg { width: 19px; height: 19px; }
.profile-button > span:not(.avatar), .profile-button > svg { display: none; }
.login-button { padding: 0 11px; }
.hero { min-height: 650px; padding: 65px 22px 35px; }
.hero-content { padding-bottom: 50px; }
.hero h1 { font-size: 58px; letter-spacing: -3px; }
.hero-lead { font-size: 16px; }
.hero-actions { align-items: flex-start; flex-direction: column; gap: 18px; }
.hero-stats { gap: 14px; justify-content: space-between; }
.hero-stats div { flex-direction: column; gap: 0; }
.hero-stats strong { font-size: 23px; }
.hero-stats span { font-size: 9px; }
.bills-section, .process-section { padding: 75px 20px; }
.section-heading { display: block; margin-bottom: 40px; }
.section-heading > p { margin-top: 25px; }
.section-heading h2, .process-heading h2 { font-size: 45px; }
.filter-row { align-items: flex-start; padding: 20px 0; gap: 18px; }
.filter-row > div { flex-direction: column; gap: 10px; align-items: flex-end; }
.bill-grid { grid-template-columns: 1fr; }
.bill-card { min-height: 390px; }
.process-grid { grid-template-columns: 1fr; }
.process-grid article { min-height: 245px; border-left: 1px solid rgba(255,255,255,.18); }
.process-grid h3 { margin-top: 38px; }
.footer-inner { grid-template-columns: 1fr; }
.footer-links { flex-wrap: wrap; }
.site-footer { padding: 45px 22px; }
.auth-modal { padding: 35px 25px 28px; }
.detail-page, .create-page { padding: 30px 20px 75px; }
.detail-layout, .create-layout { grid-template-columns: 1fr; }
.bill-detail h1 { font-size: 47px; letter-spacing: -2px; }
.detail-meta { flex-wrap: wrap; }
.detail-meta .meta-date { padding-left: 0; margin-left: 47px; border-left: 0; }
.vote-panel, .writing-guide { position: static; }
.bill-form { padding: 28px 20px; }
.form-row { grid-template-columns: 1fr; gap: 0; }
.form-submit { flex-direction: column; align-items: stretch; }
.form-submit p { max-width: none; }
.create-heading h1 { letter-spacing: -2.5px; }
}

View File

@@ -4,7 +4,7 @@
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "Bundler",
"allowImportingTsExtensions": true
"noEmit": true
},
"include": ["vite.config.ts"]
}

2947
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -4,12 +4,9 @@
"version": "1.0.0",
"workspaces": ["apps/*"],
"scripts": {
"dev": "concurrently -n API,WEB -c blue,green \"npm run dev -w @mitwirkung/api\" \"npm run dev -w @mitwirkung/web\"",
"dev": "node scripts/dev.mjs",
"build": "npm run build -w @mitwirkung/api && npm run build -w @mitwirkung/web",
"test": "npm run test -w @mitwirkung/api",
"start": "npm run start -w @mitwirkung/api"
},
"devDependencies": {
"concurrently": "^9.1.2"
}
}

25
scripts/dev.mjs Normal file
View File

@@ -0,0 +1,25 @@
import { spawn } from "node:child_process";
const commands = [
["API", ["run", "dev", "-w", "@mitwirkung/api"]],
["WEB", ["run", "dev", "-w", "@mitwirkung/web"]],
];
const children = commands.map(([name, args]) => {
const child = spawn("npm", args, { stdio: ["inherit", "pipe", "pipe"] });
const forward = (stream, target) => stream.on("data", (data) => {
for (const line of data.toString().split("\n")) {
if (line) target.write(`[${name}] ${line}\n`);
}
});
forward(child.stdout, process.stdout);
forward(child.stderr, process.stderr);
return child;
});
const stop = () => children.forEach((child) => child.kill("SIGTERM"));
process.on("SIGINT", stop);
process.on("SIGTERM", stop);
const results = await Promise.all(children.map((child) => new Promise((resolve) => child.on("exit", resolve))));
process.exit(results.some((code) => code !== 0 && code !== null) ? 1 : 0);