Skip to content

Commit 24d5586

Browse files
merge(pull request #1 from allthingslinux/cursor/refactor-codebase-to-modern-standards-bca2): read desc
Refactor codebase to modern standards
2 parents ad12734 + 67f5dae commit 24d5586

File tree

139 files changed

+6110
-5514
lines changed

Some content is hidden

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

139 files changed

+6110
-5514
lines changed

.editorconfig

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
indent_style = space
13+
indent_size = 2
14+
15+
# Matches multiple files with brace expansion notation
16+
[*.{js,jsx,ts,tsx,json,css,scss,yml,yaml}]
17+
indent_size = 2
18+
19+
# Markdown files
20+
[*.md]
21+
trim_trailing_whitespace = false
22+
23+
# Package files
24+
[package.json]
25+
indent_size = 2
26+
27+
# YAML files
28+
[*.{yml,yaml}]
29+
indent_size = 2
30+
31+
# Makefile
32+
[Makefile]
33+
indent_style = tab

.env.example

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,73 @@
1-
# Base64 Encoded Service Account JSON
1+
# ================================================================
2+
# Application Configuration
3+
# ================================================================
4+
# Node environment: development, production, test
5+
NODE_ENV=development
6+
7+
# ================================================================
8+
# Next.js Configuration
9+
# ================================================================
10+
# Public URL of your application
11+
NEXT_PUBLIC_APP_URL=http://localhost:3000
12+
13+
# API URL (if different from app URL)
14+
NEXT_PUBLIC_API_URL=http://localhost:3000/api
15+
16+
# Site name for SEO and metadata
17+
NEXT_PUBLIC_SITE_NAME="Next.js App"
18+
19+
# ================================================================
20+
# Google Drive Configuration
21+
# ================================================================
22+
# Base64 encoded service account credentials
223
GD_SERVICE_B64=
3-
# Secret Key for Encryption
24+
25+
# Encryption key for secure operations
426
ENCRYPTION_KEY=
27+
28+
# ================================================================
29+
# Database Configuration (if applicable)
30+
# ================================================================
31+
# DATABASE_URL=postgresql://user:password@localhost:5432/dbname
32+
33+
# ================================================================
34+
# Authentication (if applicable)
35+
# ================================================================
36+
# JWT_SECRET=
37+
# AUTH_SECRET=
38+
39+
# ================================================================
40+
# External Services (if applicable)
41+
# ================================================================
42+
# Analytics
43+
# NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=
44+
# NEXT_PUBLIC_MIXPANEL_TOKEN=
45+
46+
# Error Tracking
47+
# SENTRY_DSN=
48+
# NEXT_PUBLIC_SENTRY_DSN=
49+
50+
# Email Service
51+
# SMTP_HOST=
52+
# SMTP_PORT=
53+
# SMTP_USER=
54+
# SMTP_PASSWORD=
55+
56+
# ================================================================
57+
# Feature Flags (if applicable)
58+
# ================================================================
59+
# NEXT_PUBLIC_ENABLE_FEATURE_X=false
60+
# NEXT_PUBLIC_ENABLE_BETA_FEATURES=false
61+
62+
# ================================================================
63+
# Development Tools
64+
# ================================================================
65+
# Enable debug logging
66+
# DEBUG=true
67+
68+
# Disable Next.js telemetry
69+
NEXT_TELEMETRY_DISABLED=1
70+
571
# Index password, used when private mode is enabled
672
SITE_PASSWORD=
773

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## Description
2+
3+
Please include a summary of the changes and which issue is fixed. Include relevant motivation and context.
4+
5+
Fixes # (issue)
6+
7+
## Type of change
8+
9+
Please delete options that are not relevant.
10+
11+
- [ ] Bug fix (non-breaking change which fixes an issue)
12+
- [ ] New feature (non-breaking change which adds functionality)
13+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
14+
- [ ] Documentation update
15+
- [ ] Performance improvement
16+
- [ ] Code refactoring
17+
18+
## Checklist
19+
20+
- [ ] My code follows the style guidelines of this project
21+
- [ ] I have performed a self-review of my code
22+
- [ ] I have commented my code, particularly in hard-to-understand areas
23+
- [ ] I have made corresponding changes to the documentation
24+
- [ ] My changes generate no new warnings
25+
- [ ] I have added tests that prove my fix is effective or that my feature works
26+
- [ ] New and existing unit tests pass locally with my changes
27+
- [ ] Any dependent changes have been merged and published
28+
29+
## Screenshots (if applicable)
30+
31+
Please add screenshots to help explain your changes.
32+
33+
## Additional context
34+
35+
Add any other context about the pull request here.

.github/workflows/ci.yml

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
env:
10+
NODE_VERSION: "20.x"
11+
12+
jobs:
13+
lint:
14+
name: Lint
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: ${{ env.NODE_VERSION }}
24+
cache: "npm"
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Run ESLint
30+
run: npm run lint
31+
32+
- name: Check Prettier formatting
33+
run: npm run format:check
34+
35+
type-check:
36+
name: Type Check
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout code
40+
uses: actions/checkout@v4
41+
42+
- name: Setup Node.js
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version: ${{ env.NODE_VERSION }}
46+
cache: "npm"
47+
48+
- name: Install dependencies
49+
run: npm ci
50+
51+
- name: Run TypeScript type check
52+
run: npm run type-check
53+
54+
build:
55+
name: Build
56+
runs-on: ubuntu-latest
57+
needs: [lint, type-check]
58+
steps:
59+
- name: Checkout code
60+
uses: actions/checkout@v4
61+
62+
- name: Setup Node.js
63+
uses: actions/setup-node@v4
64+
with:
65+
node-version: ${{ env.NODE_VERSION }}
66+
cache: "npm"
67+
68+
- name: Install dependencies
69+
run: npm ci
70+
71+
- name: Build application
72+
run: npm run build
73+
env:
74+
NEXT_TELEMETRY_DISABLED: 1
75+
76+
- name: Upload build artifacts
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: build-artifacts
80+
path: .next
81+
retention-days: 7
82+
83+
test:
84+
name: Test
85+
runs-on: ubuntu-latest
86+
needs: [lint, type-check]
87+
steps:
88+
- name: Checkout code
89+
uses: actions/checkout@v4
90+
91+
- name: Setup Node.js
92+
uses: actions/setup-node@v4
93+
with:
94+
node-version: ${{ env.NODE_VERSION }}
95+
cache: "npm"
96+
97+
- name: Install dependencies
98+
run: npm ci
99+
100+
# Uncomment when tests are added
101+
# - name: Run unit tests
102+
# run: npm test
103+
104+
# - name: Run integration tests
105+
# run: npm run test:integration
106+
107+
# - name: Upload coverage reports
108+
# uses: codecov/codecov-action@v4
109+
# with:
110+
# file: ./coverage/coverage-final.json
111+
# flags: unittests
112+
# name: codecov-umbrella
113+
114+
security:
115+
name: Security Scan
116+
runs-on: ubuntu-latest
117+
steps:
118+
- name: Checkout code
119+
uses: actions/checkout@v4
120+
121+
- name: Run npm audit
122+
run: npm audit --audit-level=high
123+
continue-on-error: true
124+
125+
- name: Run Snyk to check for vulnerabilities
126+
uses: snyk/actions/node@master
127+
continue-on-error: true
128+
env:
129+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
130+
131+
lighthouse:
132+
name: Lighthouse CI
133+
runs-on: ubuntu-latest
134+
needs: build
135+
steps:
136+
- name: Checkout code
137+
uses: actions/checkout@v4
138+
139+
- name: Setup Node.js
140+
uses: actions/setup-node@v4
141+
with:
142+
node-version: ${{ env.NODE_VERSION }}
143+
cache: "npm"
144+
145+
- name: Install dependencies
146+
run: npm ci
147+
148+
- name: Download build artifacts
149+
uses: actions/download-artifact@v4
150+
with:
151+
name: build-artifacts
152+
path: .next
153+
154+
- name: Run Lighthouse CI
155+
uses: treosh/lighthouse-ci-action@v12
156+
with:
157+
urls: |
158+
http://localhost:3000
159+
uploadArtifacts: true
160+
temporaryPublicStorage: true
161+
continue-on-error: true

.github/workflows/codeql.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: "0 0 * * 1" # Weekly on Monday
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
language: ["javascript", "typescript"]
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@v3
31+
with:
32+
languages: ${{ matrix.language }}
33+
34+
- name: Autobuild
35+
uses: github/codeql-action/autobuild@v3
36+
37+
- name: Perform CodeQL Analysis
38+
uses: github/codeql-action/analyze@v3
39+
with:
40+
category: "/language:${{matrix.language}}"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Dependency Review
2+
3+
on: [pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
dependency-review:
10+
name: Dependency Review
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Dependency Review
17+
uses: actions/dependency-review-action@v4
18+
with:
19+
fail-on-severity: moderate

0 commit comments

Comments
 (0)