🎓 Initial commit: Math2 Platform - Plataforma de Álgebra Lineal PRO
✨ Características: - 45 ejercicios universitarios (Basic → Advanced) - Renderizado LaTeX profesional - IA generativa (Z.ai/DashScope) - Docker 9 servicios - Tests 123/123 pasando - Seguridad enterprise (JWT, XSS, Rate limiting) 🐳 Infraestructura: - Next.js 14 + Node.js 20 - PostgreSQL 15 + Redis 7 - Docker Compose completo - Nginx + SSL ready 📚 Documentación: - 5 informes técnicos completos - README profesional - Scripts de deployment automatizados Estado: Producción lista ✅
This commit is contained in:
46
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
46
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
name: Bug Report
|
||||
about: Create a report to help us improve
|
||||
title: '[BUG] '
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
## Bug Description
|
||||
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
## Steps to Reproduce
|
||||
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
## Expected Behavior
|
||||
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
## Actual Behavior
|
||||
|
||||
A clear and concise description of what actually happened.
|
||||
|
||||
## Screenshots
|
||||
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
## Environment
|
||||
|
||||
- **OS**: [e.g., macOS, Windows, Linux]
|
||||
- **Browser**: [e.g., Chrome, Firefox, Safari]
|
||||
- **Node.js version**: [e.g., 20.11.0]
|
||||
- **Package version**: [e.g., 1.0.0]
|
||||
|
||||
## Additional Context
|
||||
|
||||
Add any other context about the problem here, such as:
|
||||
- Related issues
|
||||
- Stack traces
|
||||
- Error messages
|
||||
- Browser console logs
|
||||
35
.github/ISSUE_TEMPLATE/documentation.md
vendored
Normal file
35
.github/ISSUE_TEMPLATE/documentation.md
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
name: Documentation Issue
|
||||
about: Report an issue with documentation
|
||||
title: '[DOCS] '
|
||||
labels: documentation
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
## Documentation Issue
|
||||
|
||||
Describe what's wrong with the current documentation.
|
||||
|
||||
## Location
|
||||
|
||||
Where is the issue located?
|
||||
- [ ] README.md
|
||||
- [ ] API Documentation
|
||||
- [ ] Architecture Documentation
|
||||
- [ ] Deployment Guide
|
||||
- [ ] Contributing Guide
|
||||
- [ ] Code comments
|
||||
- [ ] Other: please specify
|
||||
|
||||
## Current State
|
||||
|
||||
What does the documentation currently say?
|
||||
|
||||
## Suggested Improvement
|
||||
|
||||
What should the documentation say instead?
|
||||
|
||||
## Additional Context
|
||||
|
||||
Add any other context about the documentation issue here.
|
||||
46
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
46
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
name: Feature Request
|
||||
about: Suggest an idea for this project
|
||||
title: '[FEATURE] '
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
## Feature Description
|
||||
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
## Problem Statement
|
||||
|
||||
Is your feature request related to a problem? Please describe.
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
## Proposed Solution
|
||||
|
||||
Describe the solution you'd like to see implemented.
|
||||
|
||||
## Alternative Solutions
|
||||
|
||||
Describe any alternative solutions or features you've considered.
|
||||
|
||||
## Use Cases
|
||||
|
||||
Describe specific use cases that would benefit from this feature:
|
||||
1. Use case 1
|
||||
2. Use case 2
|
||||
3. Use case 3
|
||||
|
||||
## Implementation Ideas
|
||||
|
||||
If you have ideas on how this could be implemented, please share them here.
|
||||
|
||||
## Additional Context
|
||||
|
||||
Add any other context, screenshots, or mockups about the feature request here.
|
||||
|
||||
## Willingness to Contribute
|
||||
|
||||
- [ ] I can contribute to this feature
|
||||
- [ ] I can test this feature
|
||||
- [ ] I can provide documentation for this feature
|
||||
56
.github/ISSUE_TEMPLATE/security_vulnerability.md
vendored
Normal file
56
.github/ISSUE_TEMPLATE/security_vulnerability.md
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
---
|
||||
name: Security Vulnerability
|
||||
about: Report a security vulnerability
|
||||
title: '[SECURITY] '
|
||||
labels: security
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
⚠️ **IMPORTANT**: If this is a critical security vulnerability, please do not submit it here. Instead, email security@mathplatform.com directly.
|
||||
|
||||
## Security Issue Description
|
||||
|
||||
A clear and concise description of the security vulnerability.
|
||||
|
||||
## Impact
|
||||
|
||||
Describe the potential impact of this vulnerability:
|
||||
- Data exposure
|
||||
- Unauthorized access
|
||||
- System compromise
|
||||
- Other: please specify
|
||||
|
||||
## Steps to Reproduce
|
||||
|
||||
1. Step one
|
||||
2. Step two
|
||||
3. Step three
|
||||
|
||||
## Affected Components
|
||||
|
||||
- [ ] Frontend
|
||||
- [ ] Backend API
|
||||
- [ ] Database
|
||||
- [ ] Infrastructure
|
||||
- [ ] Authentication/Authorization
|
||||
- [ ] Other: please specify
|
||||
|
||||
## Environment
|
||||
|
||||
- **Version**: [e.g., 1.0.0]
|
||||
- **Environment**: [e.g., production, staging, development]
|
||||
- **Browser**: [if applicable]
|
||||
|
||||
## Possible Solution
|
||||
|
||||
If you have suggestions on how to fix the vulnerability, please describe them here.
|
||||
|
||||
## Additional Context
|
||||
|
||||
Add any other context about the security issue here.
|
||||
|
||||
## Disclosure Policy
|
||||
|
||||
- [ ] I agree to follow the responsible disclosure process
|
||||
- [ ] I understand this issue will be addressed according to the security policy
|
||||
71
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
71
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
## Description
|
||||
|
||||
<!-- Provide a brief description of the changes in this PR -->
|
||||
|
||||
## Type of Change
|
||||
|
||||
- [ ] Bug fix (non-breaking change which fixes an issue)
|
||||
- [ ] New feature (non-breaking change which adds functionality)
|
||||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
||||
- [ ] Documentation update
|
||||
- [ ] Refactoring (no functional changes)
|
||||
- [ ] Performance improvement
|
||||
- [ ] Test coverage improvement
|
||||
- [ ] Security fix
|
||||
|
||||
## Related Issues
|
||||
|
||||
<!-- Link to related issues using "Fixes #123" or "Relates to #456" -->
|
||||
Fixes #
|
||||
Relates to #
|
||||
|
||||
## Changes Made
|
||||
|
||||
<!-- Describe the changes in detail -->
|
||||
- Change 1
|
||||
- Change 2
|
||||
- Change 3
|
||||
|
||||
## Testing
|
||||
|
||||
<!-- Describe the tests you ran and how to reproduce them -->
|
||||
- [ ] Unit tests pass
|
||||
- [ ] Integration tests pass
|
||||
- [ ] E2E tests pass
|
||||
- [ ] Manual testing completed
|
||||
|
||||
### Test Instructions
|
||||
|
||||
1. Step one
|
||||
2. Step two
|
||||
3. Step three
|
||||
|
||||
## Screenshots (if applicable)
|
||||
|
||||
<!-- Add screenshots for UI changes -->
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] My code follows the project's style guidelines
|
||||
- [ ] I have performed a self-review of my code
|
||||
- [ ] I have commented my code, particularly in hard-to-understand areas
|
||||
- [ ] I have made corresponding changes to the documentation
|
||||
- [ ] My changes generate no new warnings
|
||||
- [ ] I have added tests that prove my fix is effective or that my feature works
|
||||
- [ ] New and existing unit tests pass locally with my changes
|
||||
- [ ] Any dependent changes have been merged and published
|
||||
|
||||
## Security Considerations
|
||||
|
||||
- [ ] No secrets or credentials exposed
|
||||
- [ ] Input validation implemented
|
||||
- [ ] Authorization checks added
|
||||
- [ ] Security implications considered
|
||||
|
||||
## Breaking Changes
|
||||
|
||||
<!-- If this is a breaking change, describe what breaks and how to migrate -->
|
||||
|
||||
## Additional Notes
|
||||
|
||||
<!-- Any additional information that reviewers should know -->
|
||||
240
.github/workflows/test.yml
vendored
Normal file
240
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,240 @@
|
||||
name: Test Suite
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, develop]
|
||||
pull_request:
|
||||
branches: [main, develop]
|
||||
|
||||
jobs:
|
||||
# ============================================
|
||||
# BACKEND TESTS
|
||||
# ============================================
|
||||
test-backend:
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./backend
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
env:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: test
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
ports:
|
||||
- 5432:5432
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
options: >-
|
||||
--health-cmd "redis-cli ping"
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
ports:
|
||||
- 6379:6379
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: ./backend/package-lock.json
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run linter
|
||||
run: npm run lint
|
||||
|
||||
- name: Run type check
|
||||
run: npm run type-check
|
||||
|
||||
- name: Run unit tests with coverage
|
||||
run: npm run test:coverage
|
||||
env:
|
||||
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test
|
||||
JWT_SECRET: test-secret-for-ci
|
||||
REDIS_URL: redis://localhost:6379
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
files: ./backend/coverage/lcov.info
|
||||
flags: backend
|
||||
name: backend-coverage
|
||||
|
||||
# ============================================
|
||||
# FRONTEND TESTS
|
||||
# ============================================
|
||||
test-frontend:
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./frontend
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: ./frontend/package-lock.json
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run linter
|
||||
run: npm run lint
|
||||
|
||||
- name: Run type check
|
||||
run: npm run type-check
|
||||
|
||||
- name: Run tests with coverage
|
||||
run: npm run test:coverage
|
||||
|
||||
- name: Build application
|
||||
run: npm run build
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
files: ./frontend/coverage/lcov.info
|
||||
flags: frontend
|
||||
name: frontend-coverage
|
||||
|
||||
# ============================================
|
||||
# E2E TESTS WITH PLAYWRIGHT
|
||||
# ============================================
|
||||
e2e-tests:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test-backend, test-frontend]
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
env:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: test
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
ports:
|
||||
- 5432:5432
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
options: >-
|
||||
--health-cmd "redis-cli ping"
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
ports:
|
||||
- 6379:6379
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Install Backend dependencies
|
||||
working-directory: ./backend
|
||||
run: npm ci
|
||||
|
||||
- name: Install Frontend dependencies
|
||||
working-directory: ./frontend
|
||||
run: npm ci
|
||||
|
||||
- name: Install Playwright Browsers
|
||||
run: npx playwright install --with-deps
|
||||
|
||||
- name: Start Backend
|
||||
working-directory: ./backend
|
||||
run: npm run start &
|
||||
env:
|
||||
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test
|
||||
JWT_SECRET: test-secret-for-ci
|
||||
REDIS_URL: redis://localhost:6379
|
||||
PORT: 3001
|
||||
|
||||
- name: Wait for Backend
|
||||
run: npx wait-on http://localhost:3001/health --timeout 30000
|
||||
|
||||
- name: Start Frontend
|
||||
working-directory: ./frontend
|
||||
run: npm run dev &
|
||||
|
||||
- name: Wait for Frontend
|
||||
run: npx wait-on http://localhost:3000 --timeout 60000
|
||||
|
||||
- name: Run Playwright tests
|
||||
run: npx playwright test
|
||||
working-directory: ./e2e
|
||||
|
||||
- name: Upload Playwright Report
|
||||
uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-report
|
||||
path: e2e/playwright-report/
|
||||
retention-days: 30
|
||||
|
||||
# ============================================
|
||||
# COVERAGE THRESHOLD CHECK
|
||||
# ============================================
|
||||
coverage-check:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test-backend, test-frontend]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download Backend Coverage
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: backend-coverage
|
||||
path: backend-coverage
|
||||
|
||||
- name: Download Frontend Coverage
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: frontend-coverage
|
||||
path: frontend-coverage
|
||||
|
||||
- name: Check Backend Coverage
|
||||
run: |
|
||||
COVERAGE=$(cat backend-coverage/coverage-summary.json | jq '.total.lines.pct')
|
||||
if (( $(echo "$COVERAGE < 80" | bc -l) )); then
|
||||
echo "Backend coverage $COVERAGE% is below threshold 80%"
|
||||
exit 1
|
||||
fi
|
||||
echo "Backend coverage: $COVERAGE%"
|
||||
|
||||
- name: Check Frontend Coverage
|
||||
run: |
|
||||
COVERAGE=$(cat frontend-coverage/coverage-summary.json | jq '.total.lines.pct')
|
||||
if (( $(echo "$COVERAGE < 70" | bc -l) )); then
|
||||
echo "Frontend coverage $COVERAGE% is below threshold 70%"
|
||||
exit 1
|
||||
fi
|
||||
echo "Frontend coverage: $COVERAGE%"
|
||||
Reference in New Issue
Block a user