Skip to content

Commit 44ff162

Browse files
committed
feat: release 1.0.0
Core improvements across: - Admin panel (exercises, modules, users, settings pages + APIs) - Auth system (login, register, OAuth, passkey, session, rate-limit, TOTP) - PII encryption (crypto, email hashing, encrypt-on-write, decrypt-on-read) - Route protection (middleware, API auth checks, useRequireAuth hook) - Per-user preferences (theme + language synced to DB) - Navbar (dynamic settings fetch), LabLayout, ProgressTracker - i18n locales (95+ new keys each in es/en) - DB schema (new columns: preferences, disabled, email_hash, difficulty, showDifficulty)
1 parent a2f1660 commit 44ff162

163 files changed

Lines changed: 23822 additions & 8951 deletions

File tree

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: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,27 @@ SESSION_SECRET=your-secret-key-at-least-32-characters-long
6161
# -----------------------------------------------------------------------------
6262
# ADMIN_EMAIL=admin@devopslab.local
6363
# ADMIN_PASSWORD=admin1234
64+
65+
# -----------------------------------------------------------------------------
66+
# Registration
67+
# -----------------------------------------------------------------------------
68+
# Set to "false" to disable new user sign-ups. Existing users can still log in.
69+
# NEXT_PUBLIC_REGISTRATION_ENABLED=true
70+
71+
# -----------------------------------------------------------------------------
72+
# Demo Mode
73+
# -----------------------------------------------------------------------------
74+
# When set to "true", hides auth UI (login/register/profile/logout) in Navbar
75+
# and shows a "Demo" badge. Admin panel still requires login.
76+
NEXT_PUBLIC_DEMO_MODE=false
77+
78+
# -----------------------------------------------------------------------------
79+
# SMTP (Email verification and password reset)
80+
# -----------------------------------------------------------------------------
81+
# Only enabled when SMTP_HOST is configured
82+
# SMTP_HOST=
83+
# SMTP_PORT=587
84+
# SMTP_USER=
85+
# SMTP_PASS=
86+
# SMTP_FROM=noreply@devopslab.local
87+
# SMTP_SECURE=false

.github/dependabot.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: monthly
7+
open-pull-requests-limit: 10
8+
labels:
9+
- enhancement
10+
- dependency-management
11+
groups:
12+
github-actions:
13+
patterns:
14+
- "*"
15+
- package-ecosystem: pip
16+
directory: "/"
17+
schedule:
18+
interval: monthly
19+
open-pull-requests-limit: 10
20+
labels:
21+
- enhancement
22+
- dependency-management
23+
groups:
24+
pip:
25+
patterns:
26+
- "*"
27+
- package-ecosystem: docker
28+
directory: "/"
29+
schedule:
30+
interval: monthly
31+
open-pull-requests-limit: 10
32+
labels:
33+
- enhancement
34+
- dependency-management
35+
groups:
36+
docker:
37+
patterns:
38+
- "*"

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
check:
9+
name: Lint & Build
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
17+
with:
18+
node-version: 22
19+
cache: npm
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Lint
25+
run: npm run lint
26+
27+
- name: Build
28+
run: |
29+
mkdir -p data
30+
npm run db:seed
31+
npm run exercises:import
32+
npm run build

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: write
9+
issues: write
10+
pull-requests: write
11+
12+
jobs:
13+
release:
14+
name: Semantic Release
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19+
with:
20+
fetch-depth: 0
21+
persist-credentials: false
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
25+
with:
26+
node-version: 22
27+
cache: npm
28+
29+
- name: Install dependencies
30+
run: npm ci
31+
32+
- name: Build
33+
run: |
34+
mkdir -p data
35+
npm run db:seed
36+
npm run exercises:import
37+
npm run build
38+
39+
- name: Configure Git
40+
run: |
41+
git config user.name "$GITHUB_ACTOR"
42+
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
43+
44+
- name: Release
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
run: npx semantic-release

CONTRIBUTING.md

Lines changed: 111 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,114 @@
1-
# Contributing: Adding New Exercises
1+
# Contributing
2+
3+
## Development Setup
4+
5+
### Prerequisites
6+
7+
- Node.js 22 or higher
8+
- npm (included with Node.js)
9+
- Git
10+
11+
### Getting Started
12+
13+
1. Clone the repository:
14+
```bash
15+
git clone https://github.com/devops-ia/self-learning-platform.git
16+
cd self-learning-platform
17+
```
18+
19+
2. Install dependencies:
20+
```bash
21+
npm install
22+
```
23+
24+
3. Create and seed the database:
25+
```bash
26+
npm run db:seed
27+
```
28+
29+
4. Import exercise definitions:
30+
```bash
31+
npm run exercises:import
32+
```
33+
34+
5. Start the development server:
35+
```bash
36+
npm run dev
37+
```
38+
39+
The application will be available at http://localhost:3000
40+
41+
## Available Commands
42+
43+
### npm Scripts
44+
45+
- `npm run dev` - Start development server on localhost:3000
46+
- `npm run build` - Production build
47+
- `npm run lint` - Run ESLint
48+
- `npm run db:seed` - Create or reset SQLite database tables
49+
- `npm run exercises:import` - Import YAML exercises into database
50+
51+
### Makefile Targets
52+
53+
For convenience, the project includes a Makefile with common tasks:
54+
55+
- `make install` - Install npm dependencies
56+
- `make dev` - Start development server
57+
- `make build` - Full production build (seed + import + build)
58+
- `make lint` - Run ESLint
59+
- `make seed` - Create or reset database tables
60+
- `make import` - Import YAML exercises into database
61+
- `make test` - Run tests
62+
63+
See `make help` for the complete list of available commands.
64+
65+
## Coding Standards
66+
67+
- **TypeScript**: All code must use TypeScript in strict mode
68+
- **Styling**: Use Tailwind CSS 4 for all styles. Do not use custom CSS unless absolutely necessary
69+
- **Database**: Use Drizzle ORM for all database operations
70+
- **Validation**: Use Zod schemas for input validation
71+
- **Internationalization**: Use the `useT()` hook for all UI strings. Add translations to `src/lib/i18n/locales/`
72+
- **Code formatting**: No emojis in code, comments, or commit messages
73+
- **File organization**: Follow the existing directory structure. Prefer editing existing files over creating new ones
74+
75+
## Pull Request Workflow
76+
77+
1. Create a new branch from `main`:
78+
```bash
79+
git checkout -b feat/your-feature-name
80+
```
81+
82+
2. Make your changes following the coding standards
83+
84+
3. Verify your changes:
85+
```bash
86+
npm run lint
87+
npm run build
88+
```
89+
90+
4. Commit your changes using conventional commits:
91+
- `feat:` for new features
92+
- `fix:` for bug fixes
93+
- `docs:` for documentation changes
94+
- `refactor:` for code refactoring
95+
- `test:` for test additions or changes
96+
- `chore:` for maintenance tasks
97+
98+
Example:
99+
```bash
100+
git add .
101+
git commit -m "feat: add Ansible module support"
102+
```
103+
104+
5. Push your branch and open a pull request:
105+
```bash
106+
git push origin feat/your-feature-name
107+
```
108+
109+
6. CI will run automatically to verify linting and build. Address any issues before requesting review.
110+
111+
## Adding New Exercises
2112

3113
Exercises are stored in the database and loaded at runtime. There are two ways to add them: **YAML import** (recommended) or **admin panel**.
4114

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ COPY drizzle.config.ts ./
2929
# Build application
3030
RUN npm run build
3131

32+
# Compile seed script to CJS for Docker runtime (no tsx needed)
33+
RUN npx esbuild src/lib/db/seed.ts --bundle --platform=node --outfile=scripts/docker-seed.cjs --external:better-sqlite3 --external:argon2 --format=cjs
34+
3235
# =======================
3336
# Stage 2: Database Init
3437
# =======================
@@ -92,4 +95,4 @@ USER nextjs
9295

9396
# Start the Next.js application
9497
# Use wrapper script to ensure binding to HOST:PORT
95-
CMD ["sh", "-c", "node ./scripts/seed.js 2>/dev/null || true && node ./scripts/start-server.js"]
98+
CMD ["sh", "-c", "node ./scripts/docker-seed.cjs 2>/dev/null || true && node ./scripts/start-server.js"]

0 commit comments

Comments
 (0)