Skip to content

Commit 66e1201

Browse files
Initial commit
0 parents  commit 66e1201

79 files changed

Lines changed: 20344 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
VITE_FIREBASE_API_KEY=
2+
VITE_FIREBASE_AUTH_DOMAIN=
3+
VITE_FIREBASE_PROJECT_ID=
4+
VITE_FIREBASE_STORAGE_BUCKET=
5+
VITE_FIREBASE_MESSAGING_SENDER_ID=
6+
VITE_FIREBASE_APP_ID=

.github/workflows/deploy.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build-and-deploy:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '20'
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Build
25+
run: npm run build
26+
27+
- name: Deploy to GitHub Pages
28+
uses: peaceiris/actions-gh-pages@v3
29+
with:
30+
github_token: ${{ secrets.GITHUB_TOKEN }}
31+
publish_dir: ./dist
32+
cname: twitter.example.com

.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
electron_modules
12+
dist
13+
dist-ssr
14+
*.local
15+
16+
# Build outputs
17+
dist-electron/
18+
*.exe
19+
*.blockmap
20+
21+
# Electron packaging artifacts
22+
win-unpacked/
23+
builder-debug.yml
24+
builder-effective-config.yaml
25+
26+
# Environment files
27+
.env
28+
.env.*
29+
!.env.example
30+
31+
# Editor directories and files
32+
.vscode/*
33+
!.vscode/extensions.json
34+
.idea
35+
.DS_Store
36+
*.suo
37+
*.ntvs*
38+
*.njsproj
39+
*.sln
40+
*.sw?

GITHUB_PAGES_SETUP.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# GitHub Pages Deployment
2+
3+
Diese App ist eine static site und kann direkt mit GitHub Pages gehostet werden.
4+
5+
## Setup für GitHub Pages
6+
7+
### Option 1: Automatisches Deployment mit GitHub Actions (Empfohlen)
8+
9+
1. **Repository zu GitHub pushen**
10+
```bash
11+
git init
12+
git add .
13+
git commit -m "Initial commit"
14+
git remote add origin https://github.com/dein-username/twitter.git
15+
git push -u origin main
16+
```
17+
18+
2. **GitHub Pages aktivieren**
19+
- Gehe zu deinem Repository → Settings → Pages
20+
- Unter "Source" wähle: "GitHub Actions"
21+
- Der `.github/workflows/deploy.yml` wird automatisch triggern
22+
23+
3. **Fertig!** Deine App ist jetzt unter `https://dein-username.github.io/twitter` erreichbar.
24+
25+
### Option 2: Manuelles Deployment
26+
27+
1. **Build erstellen**
28+
```bash
29+
npm run build
30+
```
31+
32+
2. **`dist/` folder zum `gh-pages` branch pushen**
33+
```bash
34+
git subtree push --prefix dist origin gh-pages
35+
```
36+
37+
3. **GitHub Pages aktivieren** (siehe oben)
38+
39+
## Wichtig für Firebase
40+
41+
Deine Firebase-Credentials sind in `.env` - diese Datei ist im `.gitignore`, wird also nicht gepusht.
42+
43+
**Für production:**
44+
1. Environment Variables in GitHub Actions setzen:
45+
- Gehe zu Settings → Secrets and variables → Actions
46+
- Füge deine Firebase-Keys ein: `VITE_FIREBASE_API_KEY`, etc.
47+
48+
2. Update `deploy.yml`:
49+
```yaml
50+
- name: Build
51+
env:
52+
VITE_FIREBASE_API_KEY: ${{ secrets.VITE_FIREBASE_API_KEY }}
53+
VITE_FIREBASE_AUTH_DOMAIN: ${{ secrets.VITE_FIREBASE_AUTH_DOMAIN }}
54+
# ... alle anderen keys
55+
run: npm run build
56+
```
57+
58+
## Testing
59+
60+
```bash
61+
# Dev Server
62+
npm run dev
63+
64+
# Production Build lokal testen
65+
npm run build
66+
npm run preview
67+
```
68+
69+
Dann öffnest du `http://localhost:4173` im Browser - das ist exakt wie deine GitHub Pages aussieht.

README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Old Twitter (Security First)
2+
3+
Dieses Projekt ist eine schnelle, klassische Twitter-artige App mit Firebase als Basis.
4+
Zentrale Prioritaet: Sicherheit und Authentizitaet vor Monetarisierung.
5+
6+
## Features
7+
8+
- E-Mail Login/Registrierung via Firebase Auth
9+
- Echtzeit-Feed mit Firestore
10+
- 3 Verifizierungsstufen ohne Kaufmodell
11+
- Security-First Datenmodell mit Firestore Rules
12+
- Schnelles UI durch leichtes React + Vite Setup
13+
14+
## Verifizierungsstufen
15+
16+
### Stufe 1: Verifizierte Person 🔵
17+
- **Farbe**: Blauer Haken
18+
- **Anforderung**: Authentisches Verhalten, konsequente Aktivitaet
19+
- **Delegationsrechte**: Keine
20+
- **Besonderheiten**: Nur Profil-Badge, keine Zusatzfunktionen
21+
22+
### Stufe 2: Organisation 🟡
23+
- **Farbe**: Goldener Haken
24+
- **Anforderung**: Legitime Organisation mit Nachweisen
25+
- **Delegationsrechte**:
26+
- Darf andere als "Verifizierte Person" verifizieren
27+
- Darf andere als "Organisation" verifizieren
28+
- **Besonderheiten**:
29+
- Verifizierte Profile zeigen das Logo der Organisation neben dem Haken
30+
- Starke Sichtbarkeit durch Farb- und Logo-Kombination
31+
32+
### Stufe 3: Regierung ⚪
33+
- **Farbe**: Grauer Haken
34+
- **Anforderung**: Offizielle Regierungsinstitution
35+
- **Delegationsrechte**:
36+
- Darf andere als "Verifizierte Person" verifizieren
37+
- Darf andere als "Organisation" verifizieren
38+
- Darf andere als "Regierung" verifizieren (einzig diese Stufe)
39+
- **Besonderheiten**:
40+
- Höchste Autorität im System
41+
- Kann auch Regierungs-Haken vergeben
42+
- Logo-Branding fuer alle delegierten Personen/Organisationen
43+
44+
## Schnellstart
45+
46+
1. Abhaengigkeiten installieren
47+
- npm install
48+
49+
2. Umgebungsvariablen setzen
50+
- Kopiere .env.example nach .env
51+
- Trage Firebase-Projektwerte ein
52+
53+
3. Entwicklung starten
54+
- npm run dev
55+
56+
4. Production Build erstellen
57+
- npm run build
58+
59+
## Sicherheitsstrategie (wichtig)
60+
61+
Der aktuelle Stand legt die Sicherheitsbasis. Fuer produktiven Einsatz bitte zusaetzlich aktivieren:
62+
63+
- Firebase App Check (Web reCAPTCHA Enterprise)
64+
- MFA fuer sensible Konten
65+
- Cloud Functions fuer serverseitige Rate-Limits
66+
- Device-Risiko-Scoring und Session-Rotation
67+
- ModQueue + Trust Score Pipeline fuer Verifizierungen
68+
- Abuse-Erkennung (Bot-Muster, Burst-Posts, Link-Spam)
69+
70+
## Wichtige Dateien
71+
72+
- src/App.jsx: UI, Auth, Feed-Logik
73+
- src/firebase.js: Firebase Initialisierung
74+
- firestore.rules: Sicherheitsregeln fuer Firestore
75+
- firebase.indexes.json: Indexe fuer Feed-Queries

electron-main.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { app, BrowserWindow } from 'electron'
2+
import path from 'path'
3+
import isDev from 'electron-is-dev'
4+
import { fileURLToPath } from 'url'
5+
6+
const __filename = fileURLToPath(import.meta.url)
7+
const __dirname = path.dirname(__filename)
8+
9+
let mainWindow
10+
11+
function createWindow() {
12+
mainWindow = new BrowserWindow({
13+
width: 1400,
14+
height: 900,
15+
webPreferences: {
16+
preload: path.join(__dirname, 'preload.js'),
17+
nodeIntegration: false,
18+
contextIsolation: true,
19+
},
20+
})
21+
22+
const startUrl = isDev ? 'http://localhost:5173' : `file://${path.join(__dirname, 'dist/index.html')}`
23+
mainWindow.loadURL(startUrl)
24+
25+
if (isDev) {
26+
mainWindow.webContents.openDevTools()
27+
}
28+
29+
mainWindow.on('closed', () => {
30+
mainWindow = null
31+
})
32+
}
33+
34+
app.on('ready', createWindow)
35+
36+
app.on('window-all-closed', () => {
37+
if (process.platform !== 'darwin') {
38+
app.quit()
39+
}
40+
})
41+
42+
app.on('activate', () => {
43+
if (mainWindow === null) {
44+
createWindow()
45+
}
46+
})

eslint.config.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import { defineConfig, globalIgnores } from 'eslint/config'
6+
7+
export default defineConfig([
8+
globalIgnores(['dist']),
9+
{
10+
files: ['**/*.{js,jsx}'],
11+
extends: [
12+
js.configs.recommended,
13+
reactHooks.configs.flat.recommended,
14+
reactRefresh.configs.vite,
15+
],
16+
languageOptions: {
17+
ecmaVersion: 2020,
18+
globals: globals.browser,
19+
parserOptions: {
20+
ecmaVersion: 'latest',
21+
ecmaFeatures: { jsx: true },
22+
sourceType: 'module',
23+
},
24+
},
25+
rules: {
26+
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
27+
},
28+
},
29+
])

firebase.indexes.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"indexes": [
3+
{
4+
"collectionGroup": "posts",
5+
"queryScope": "COLLECTION",
6+
"fields": [
7+
{
8+
"fieldPath": "createdAt",
9+
"order": "DESCENDING"
10+
}
11+
]
12+
}
13+
],
14+
"fieldOverrides": []
15+
}

0 commit comments

Comments
 (0)