Skip to content

Commit 5537157

Browse files
committed
feat: implement multi-platform contest tracking with comprehensive notification system
- Implemented adapter pattern for platform abstraction - Added support for 4 platforms: Codeforces, LeetCode, CodeChef, AtCoder - Created unified ContestData format for cross-platform consistency - Built platform registry with dependency injection for scalability - Multi-channel support: Email, WhatsApp, Push notifications - User preference-based notification delivery - Contest reminder system with customizable timing - Admin announcement and bulk email capabilities - Notification history and retry mechanism - Email templates with modern HTML design - Refactored to adapter pattern following SOLID principles - Implemented dependency injection throughout - Created reusable base classes and interfaces - Moved logger from core to common module - Added role-based access control (RBAC) - Enhanced security with public route decorator - Complete CRUD operations for contests - Advanced filtering: by platform, phase, difficulty, type - Search functionality with pagination - Contest statistics and analytics - Automated contest synchronization (every 6 hours) - Bulk operations support - JWT-based authentication with refresh tokens - Fixed refresh token bug (now correctly reuses refresh token) - Role-based guards (Admin, User) - Public route decorator for unprotected endpoints - Enhanced user schema with notification preferences - User activation/deactivation - Profile management - Role updates (Admin only) - Notification channel preferences - Custom notification timing (1-168 hours before contest) - VitePress-based documentation site - Comprehensive API documentation for all endpoints - Backend architecture guides - Platform adapter documentation - Database schema documentation - Security and deployment guides - GitHub Pages deployment workflow - PlatformsModule: Platform adapter registry and management - NotificationsModule: Multi-channel notification system - ContestSchedulerService: Automated contest sync and cleanup - CodeforcesAdapter: REST API integration (enabled) - LeetCodeAdapter: GraphQL API integration (enabled) - CodeChefAdapter: REST API integration (enabled) - AtCoderAdapter: Community API integration (enabled) - Enhanced Contest schema with multi-platform support - New Notification schema for tracking notification history - Updated User schema with notification preferences - EmailNotificationService: Nodemailer integration - WhatsAppNotificationService: Twilio integration - PushNotificationService: Web Push API integration - AdminEmailService: Admin-specific email operations - @nestjs/schedule: Cron job scheduling - nodemailer: Email sending - twilio: WhatsApp messaging - web-push: Push notifications - Deprecated alerts module (replaced by notifications) - Old documentation structure (migrated to VitePress) - Zod validation pipe (using class-validator) - Removed /alerts endpoints (use /notifications instead) - Changed contest sync from hourly to every 6 hours - Updated user schema with new required fields - Added comprehensive test specs for all new services - Unit tests for adapters, guards, and decorators - E2E test setup with UI test page
1 parent 1fbed4f commit 5537157

File tree

201 files changed

+52773
-4386
lines changed

Some content is hidden

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

201 files changed

+52773
-4386
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Workflow for building and deploying CodeNotify Backend VitePress documentation to GitHub Pages
2+
name: Deploy CodeNotify Documentation
3+
4+
on:
5+
# Runs on pushes targeting the main branch
6+
push:
7+
branches: [main]
8+
paths:
9+
- 'docs/**'
10+
- '.github/workflows/deploy-docs.yml'
11+
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
16+
permissions:
17+
contents: read
18+
pages: write
19+
id-token: write
20+
21+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
22+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
23+
concurrency:
24+
group: pages
25+
cancel-in-progress: false
26+
27+
jobs:
28+
# Build job
29+
build:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 0 # Not needed if lastUpdated is not enabled
36+
37+
# - uses: pnpm/action-setup@v3 # Uncomment this if you're using pnpm
38+
# with:
39+
# version: 9
40+
- name: Setup Node
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: 22
44+
cache: npm
45+
cache-dependency-path: docs/package-lock.json
46+
47+
- name: Setup Pages
48+
uses: actions/configure-pages@v4
49+
50+
- name: Install dependencies
51+
run: npm ci
52+
working-directory: docs
53+
54+
- name: Build with VitePress
55+
run: npm run docs:build
56+
working-directory: docs
57+
58+
- name: Upload artifact
59+
uses: actions/upload-pages-artifact@v3
60+
with:
61+
path: docs/.vitepress/dist
62+
63+
# Deployment job
64+
deploy:
65+
environment:
66+
name: github-pages
67+
url: ${{ steps.deployment.outputs.page_url }}
68+
needs: build
69+
runs-on: ubuntu-latest
70+
name: Deploy
71+
steps:
72+
- name: Deploy to GitHub Pages
73+
id: deployment
74+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)