Skip to content
Open

Dev #64

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
1fc003d
feat(migrations): add link column to content table
FranceHuon Jul 3, 2025
a0d2d61
Create new migrations to update tables media and content
FranceHuon Jul 4, 2025
f0a4404
Updated media entity
FranceHuon Jul 4, 2025
eef4e0c
Created media module, controller and service
FranceHuon Jul 4, 2025
5e1c24e
Updated content entity
FranceHuon Jul 4, 2025
d2a5f46
chore: remove MikroORM cache files from version control and update .g…
FranceHuon Jul 4, 2025
6fc0f72
Linter
FranceHuon Jul 4, 2025
fc5f3c0
Add NestJS/schedule
FranceHuon Jul 4, 2025
bcc7441
Updated snapshot-gazette_db
FranceHuon Jul 4, 2025
e3cdd02
Updated AppModule with new modules
FranceHuon Jul 4, 2025
9ba8333
feat: add subscription system
FranceHuon Jul 7, 2025
791f8af
feat: add media management system
FranceHuon Jul 7, 2025
efea24d
feat: add authentication guards
FranceHuon Jul 7, 2025
254f013
refactor: update RSS feeds and improve content handling
FranceHuon Jul 7, 2025
0c74ad0
refactor: update user management and authentication
FranceHuon Jul 7, 2025
0d0e334
feat: update UI components and layout
FranceHuon Jul 7, 2025
d0535e9
chore: update dependencies and configuration
FranceHuon Jul 7, 2025
6619b0d
feat: update explore page and add subscriptions page
FranceHuon Jul 7, 2025
eac5271
chore(lint): auto-fix linting issues using pnpm --fix
FranceHuon Jul 7, 2025
2a75a8f
enhance content entity and add content management module
FranceHuon Jul 9, 2025
a84244e
improve subscription service and controller
FranceHuon Jul 9, 2025
241c1bd
implement clean subscription context architecture
FranceHuon Jul 9, 2025
e08682f
integrate subscription provider and improve auth flow
FranceHuon Jul 9, 2025
1bc65c0
refactor(backend): remove legacy favorite feature and related files
FranceHuon Jul 13, 2025
7b569a4
feat(like): add Like entity, module, migration and shared DTO
FranceHuon Jul 13, 2025
344a2be
refactor(content): update Content entity and module for new features
FranceHuon Jul 13, 2025
1e5a63f
refactor(backend): update Media, RSS, Subscription, and Job modules
FranceHuon Jul 13, 2025
01d528f
feat(frontend): add Like/Subscription contexts and hooks, remove old …
FranceHuon Jul 13, 2025
9eaec33
feat(frontend): add API services for Like and Content
FranceHuon Jul 13, 2025
a6327bf
chore(frontend): integrate Like/Subscription providers and update con…
FranceHuon Jul 13, 2025
e4a438a
feat(frontend): update main pages and UI components for new Like/Subs…
FranceHuon Jul 13, 2025
a549988
chore(shared): cleanup and update shared package for new features
FranceHuon Jul 13, 2025
8ff1ee8
chore: update docker-compose and lockfile
FranceHuon Jul 13, 2025
7bbbd0c
chore: add scripts, extra migrations, and misc files
FranceHuon Jul 13, 2025
8f99fdc
chore(backend): update dependencies and app module configuration
FranceHuon Jul 13, 2025
a9a4424
refactor(frontend): update RSS and Subscription API services
FranceHuon Jul 13, 2025
e28a8ca
chore(frontend): remove old subscription context files
FranceHuon Jul 13, 2025
9a30ce8
feat: centralize RSS configuration and HTML utilities
FranceHuon Jul 13, 2025
8b2e072
feat: create generic RSS feed implementation
FranceHuon Jul 13, 2025
618b133
refactor: remove duplicate RSS feed files and update services
FranceHuon Jul 13, 2025
01e34a8
refactor: remove role-based authorization system
FranceHuon Jul 14, 2025
8203211
refactor: remove role field from user entity and DTOs
FranceHuon Jul 14, 2025
9e8a179
feat: add migration to remove role column from user table
FranceHuon Jul 14, 2025
a09d233
refactor: update backend controllers and services to use AuthGuard only
FranceHuon Jul 14, 2025
4ae499a
fix: add JwtConfigModule import to MediaModule
FranceHuon Jul 14, 2025
1d70078
refactor: remove role references from frontend components
FranceHuon Jul 14, 2025
793639d
refactor: update subscription system to use authenticated user
FranceHuon Jul 14, 2025
8dfc9a1
refactor: update shared schemas and fix DTO conflicts
FranceHuon Jul 14, 2025
84b8507
refactor: update app module and add user utilities
FranceHuon Jul 14, 2025
5af74f8
style: apply automatic linting fixes
FranceHuon Jul 14, 2025
e36ef20
feat: add like functionality to RSS feed system
FranceHuon Jul 14, 2025
9cc4239
feat: update RssCard component with like functionality
FranceHuon Jul 14, 2025
0b2e8e4
feat: update explore page with like functionality and content separation
FranceHuon Jul 14, 2025
ba0ae64
feat: update subscriptions page and clean up FormSignUp
FranceHuon Jul 14, 2025
461fa60
chore: add basic CI workflow with lint, typecheck and build jobs
FranceHuon Jul 22, 2025
76c6415
fix linter problems
FranceHuon Jul 22, 2025
49b880f
Merge pull request #57 from adatechschool/ci/setup
FranceHuon Jul 22, 2025
aa132f0
chore(eslint): update eslint.config.mjs
FranceHuon Jul 22, 2025
168a80f
Merge pull request #59 from adatechschool/chore/update-eslint-config
FranceHuon Jul 22, 2025
e4b84ec
chore: add basic CI workflow with lint, typecheck and build jobs
FranceHuon Jul 22, 2025
37c872f
chore(eslint): update eslint.config.mjs
FranceHuon Jul 22, 2025
5060c5b
refactor(frontend): simplify modal and clean up imports
FranceHuon Jul 22, 2025
4235aaf
feat(shared): add ContentWithMediaDto interface
FranceHuon Jul 22, 2025
d2cd124
refactor(frontend): update content services to use ContentWithMediaDto
FranceHuon Jul 22, 2025
a20155b
refactor(frontend): redesign RssCard component with media support
FranceHuon Jul 22, 2025
bd3caa3
style(frontend): improve explore page layout and spacing
FranceHuon Jul 22, 2025
24b105d
feat: add responsive design system and layout improvements
FranceHuon Jul 22, 2025
1a5d1ae
refactor: simplify ResponsiveLayout component and improve layout stru…
FranceHuon Jul 22, 2025
3ccf659
feat: enhance RSS feed cards and media display components
FranceHuon Jul 22, 2025
f6762f2
refactor: update page layouts and improve user experience
FranceHuon Jul 22, 2025
e8560c1
refactor: improve authentication forms and components
FranceHuon Jul 22, 2025
e27d550
refactor: update contexts and API services
FranceHuon Jul 22, 2025
c30356c
feat: add Lighthouse accessibility audit to CI pipeline
FranceHuon Jul 22, 2025
c830495
refactor: improve backend type safety and RSS feed handling
FranceHuon Jul 22, 2025
fac602d
refactor: update UI components to use new text styles system
FranceHuon Jul 22, 2025
86822c5
Merge branch 'dev' into feature/rss-feed-layout
FranceHuon Jul 22, 2025
9cb379c
Merge pull request #56 from adatechschool/feature/rss-feed-layout
FranceHuon Jul 24, 2025
a62eb85
Add new library page and LibraryCard component
FranceHuon Jul 24, 2025
b00de52
refactor: improve authentication and context management
FranceHuon Jul 24, 2025
0ece108
refactor: update UI components and settings
FranceHuon Jul 24, 2025
6ff8734
refactor: clean up backend modules and remove unused code
FranceHuon Jul 24, 2025
9f85b65
refactor: update layout components and responsive design
FranceHuon Jul 24, 2025
92b0119
i18n: update internationalization strings
FranceHuon Jul 24, 2025
7ec8f9b
feat: add user account deletion endpoint
FranceHuon Jul 24, 2025
d575fde
feat: add Adminer database management tool
FranceHuon Jul 24, 2025
56f3b4e
refactor: improve navbar component with scroll-based animations
FranceHuon Jul 24, 2025
f7197f2
refactor: enhance MediaCard design and layout
FranceHuon Jul 24, 2025
dd58caf
removed unused files
FranceHuon Jul 24, 2025
3e7772e
deleted useless lint.yml
FranceHuon Jul 24, 2025
47a1b9d
feat: add Lighthouse CI with authentication
FranceHuon Jul 24, 2025
c90e6b5
Configure Docker services in CI workflow
FranceHuon Jul 24, 2025
6675408
feat: improve like system with toast notifications
FranceHuon Jul 24, 2025
2805cd3
feat: enhance settings menu UX with automatic redirects
FranceHuon Jul 24, 2025
c1a8cf5
fix: resolve linter errors in main layout
FranceHuon Jul 24, 2025
faed175
Update ci.yml
FranceHuon Jul 24, 2025
386dbf0
Update ci.yml again
FranceHuon Jul 24, 2025
932f585
Update ci.yml again and again
FranceHuon Jul 24, 2025
c6675cc
Update ci.yml again and again and again
FranceHuon Jul 24, 2025
1028ba3
remove version from docker compose
FranceHuon Jul 24, 2025
c4cc4d8
Update ci.yml again and again and again and again
FranceHuon Jul 24, 2025
e3f0d15
fix linter problems in docker compose
FranceHuon Jul 24, 2025
9f4da74
Update ci.yml again and again and again and again and again
FranceHuon Jul 24, 2025
c3e4936
Update ci.yml again and again and again and again and again and again
FranceHuon Jul 24, 2025
520b6c7
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
f6c6238
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
264291a
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
69cf244
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
16536f6
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
14206d2
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
5c7a479
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
4e1f826
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
8954ce0
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
b7ce90e
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
f9f8dd7
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
599a556
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
d4e0c49
update lighthouse script
FranceHuon Jul 24, 2025
8858417
update lighthouse script again
FranceHuon Jul 24, 2025
107da5a
update lighthouse script again
FranceHuon Jul 24, 2025
e6745b5
update lighthouse script again
FranceHuon Jul 24, 2025
6aaca70
update lighthouse script again
FranceHuon Jul 24, 2025
c159924
update lighthouse script again
FranceHuon Jul 24, 2025
a44ee97
update lighthouse script again
FranceHuon Jul 24, 2025
f284844
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
fb0a34b
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
3a0ebd3
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
fb52957
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
1533fff
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
cd9d3ad
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
f81d294
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
bf0f8ba
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
ab2f12a
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
6d67918
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
f33c3b1
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
e3272a4
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
deecfde
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
0c6c158
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
9bc9220
Update ci.yml again and again and again and again and again and again…
FranceHuon Jul 24, 2025
a9dfb57
Merge pull request #61 from adatechschool/fix-ci-lighthouse-fail
FranceHuon Jul 24, 2025
c3a07fb
fix: improve backend configuration and error handling
FranceHuon Jul 25, 2025
434f513
Lighthouse CI Integration & Docker Multi-stage Builds
FranceHuon Jul 25, 2025
3ee24c8
docs: comprehensive project documentation and test setup
FranceHuon Jul 25, 2025
56683a9
Frontend Performance & SEO Optimizations
FranceHuon Jul 25, 2025
17c99c8
fix linter and performance problems
FranceHuon Jul 25, 2025
799f5a1
remove critters
FranceHuon Jul 25, 2025
acb412d
fix lint problems
FranceHuon Jul 25, 2025
c087f0f
update fontSize
FranceHuon Jul 25, 2025
24864f0
Merge pull request #62 from adatechschool/lighthouse-improvements
FranceHuon Jul 25, 2025
2f90be7
Merge pull request #63 from adatechschool/branche-de-france
FranceHuon Jul 25, 2025
f29a87d
feat: add swagger for api doc
elinelgp Jul 26, 2025
c712159
fix: remove extra semicolon
elinelgp Jul 26, 2025
fd7b04a
fix: imports sort
elinelgp Jul 26, 2025
dfe1465
fix: sort imports
elinelgp Jul 26, 2025
9e29363
Merge pull request #65 from adatechschool/feat/api-documentation
Orianeds Jul 27, 2025
caebac2
feat: about page
elinelgp Aug 15, 2025
76b7b79
fix: lint
elinelgp Aug 15, 2025
503f4e4
fix: lint again
elinelgp Aug 15, 2025
a8b5314
fix: fix dockerfiles back and front
MyriamLeNahelec Aug 11, 2025
a624e9c
fix: delete account
elinelgp Aug 21, 2025
b66e577
fix: lint fix
elinelgp Aug 27, 2025
ffbd2f1
fix: lint again
elinelgp Aug 27, 2025
a94c711
fix: forms
elinelgp Aug 27, 2025
3b33c2a
fix: xml-parser to rss-parser
elinelgp Aug 28, 2025
fa918e5
fix: nock remove
elinelgp Sep 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
203 changes: 203 additions & 0 deletions .github/scripts/lighthouse-auth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
import { execSync } from 'node:child_process'
import process from 'node:process'

// Install dependencies if not present
try {
await import('puppeteer')
}
catch {
console.log('📦 Installing dependencies...')
execSync('pnpm add -w lighthouse puppeteer wait-on', { stdio: 'inherit' })
}

// Install Chrome for Puppeteer
console.log('🌐 Installing Chrome for Puppeteer...')
execSync('npx puppeteer browsers install chrome', { stdio: 'inherit' })

const puppeteer = await import('puppeteer')

// Configuration
const BACKEND_URL = 'http://localhost:3000'
const FRONTEND_URL = 'http://localhost:3002'

// Pages à auditer
const PAGES_TO_AUDIT = [
'/login',
'/signin', // Pages publiques
'/explore',
'/library',
'/subscriptions',
'/settings', // Pages protégées
]

async function loginAndGetCookie(testUser) {
console.log('🔐 Logging in...')

const browser = await puppeteer.default.launch({
headless: true,
args: ['--no-sandbox', '--disable-setuid-sandbox'],
})

try {
const page = await browser.newPage()
console.log(`🌐 Navigating to: ${FRONTEND_URL}/login`)
await page.goto(`${FRONTEND_URL}/login`, { waitUntil: 'networkidle0' })

console.log('📝 Filling login form...')
await page.type('input[name="email"]', testUser.email)
await page.type('input[name="password"]', testUser.password)
await page.click('button[type="submit"]')

console.log('⏳ Waiting for navigation...')
await page.waitForNavigation({ waitUntil: 'networkidle0' })

const cookies = await page.cookies()
console.log(`🍪 Found ${cookies.length} cookies`)
const authCookie = cookies.find(cookie => cookie.name === 'token')

if (authCookie) {
console.log('✅ Authentication successful')
return authCookie
}
else {
console.log('❌ No auth cookie found')
console.log('🍪 Available cookies:', cookies.map(c => c.name))
return null
}
}
finally {
await browser.close()
}
}

async function runLighthouseAudit(authCookie) {
console.log('🔍 Running Lighthouse audit...')

for (const page of PAGES_TO_AUDIT) {
console.log(`📊 Auditing ${page}`)

const url = `${FRONTEND_URL}${page}`
const outputPath = `./lighthouse-report-${page.replace('/', '')}.html`

try {
const lighthouseCommand = [
'npx lighthouse',
url,
'--only-categories=accessibility',
'--quiet',
'--chrome-flags="--headless --no-sandbox --disable-setuid-sandbox"',
'--output html',
`--output-path ${outputPath}`,
`--extra-headers '{"Cookie": "token=${authCookie.value}"}'`,
].join(' ')

console.log(`🔍 Running: ${lighthouseCommand}`)
const result = execSync(lighthouseCommand, { encoding: 'utf8' })
console.log(`✅ ${page} completed`)

// Vérifier si le fichier a été créé
const fs = await import('node:fs')
if (fs.existsSync(outputPath)) {
console.log(`📄 Report saved: ${outputPath}`)
}
else {
console.log(`⚠️ Report not found: ${outputPath}`)
}

// Extraire et afficher le score d'accessibilité
const accessibilityMatch = result.match(/Accessibility.*?(\d+)/)
if (accessibilityMatch) {
console.log(`📊 ${page} - Score accessibilité: ${accessibilityMatch[1]}/100`)
}
}
catch (error) {
console.log(`❌ ${page} failed:`, error.message)
console.log(`🔍 Full error:`, error)
throw error // Propager l'erreur pour faire échouer la CI
}
}

console.log('🎉 All audits completed!')
}

async function createTestUser() {
console.log('👤 Creating test user...')

const testUser = {
pseudo: 'lighthouse-test',
email: '[email protected]',
password: 'test123456',
}

try {
console.log(`🔗 Trying to connect to: ${BACKEND_URL}/users`)
const response = await fetch(`${BACKEND_URL}/users`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(testUser),
})

console.log(`📡 Response status: ${response.status}`)
if (response.ok) {
console.log('✅ Test user created')
return testUser
}
else {
console.log('ℹ️ Test user already exists')
return testUser
}
}
catch (error) {
console.log('⚠️ Could not create test user:', error.message)
console.log('🔍 Full error:', error)
throw error
}
}

async function waitForService(url, serviceName) {
console.log(`⏳ Waiting for ${serviceName} to be ready...`)

for (let i = 0; i < 30; i++) { // 30 tentatives = 30 secondes
try {
const response = await fetch(url)
if (response.ok || response.status === 404) { // 404 est OK, ça signifie que le service répond
console.log(`✅ ${serviceName} is ready!`)
return true
}
}
catch {
// Service pas encore prêt
}

await new Promise(resolve => setTimeout(resolve, 1000)) // Attendre 1 seconde
}

console.log(`❌ ${serviceName} is not ready after 30 seconds`)
return false
}

async function main() {
console.log('🚀 Starting Lighthouse audit...')

// Attendre que les services soient prêts
const backendReady = await waitForService(`${BACKEND_URL}/users`, 'Backend')
const frontendReady = await waitForService(`${FRONTEND_URL}/login`, 'Frontend')

if (!backendReady || !frontendReady) {
console.log('❌ Services are not ready')
process.exit(1)
}

const testUser = await createTestUser()
const authCookie = await loginAndGetCookie(testUser)

if (authCookie) {
await runLighthouseAudit(authCookie)
}
else {
console.log('❌ Cannot run audit without authentication')
process.exit(1)
}
}

main().catch(console.error)
Loading
Loading