Advanced Web Experience Platform - A comprehensive, production-ready server built with NestJS
AWE (Advanced Web Experience) is a comprehensive, enterprise-grade platform providing:
- Real-time Messaging - WebSocket-based instant messaging with file sharing
- Forum System - Full-featured forum with moderation and search
- Media Management - Advanced media hosting, processing, and CDN delivery
- User Management - Complete user profiles, security, and preferences
- Authentication - Secure auth with JWT, social login, and 2FA
- File Uploads - Scalable file upload with Cloudflare R2 integration
src/
βββ modules/ # Feature modules
β βββ auth/ # Authentication & authorization
β βββ users/ # User management & profiles
β βββ messanger/ # Real-time messaging system
β βββ forum/ # Forum & discussion system
β βββ media-assets/ # Stickers, emojis, GIFs management
β βββ media-hosting/ # Media processing & CDN
β βββ uploads/ # File upload & storage
β βββ common/ # Shared utilities & infrastructure
βββ libs/ # External service integrations
β βββ cloudflare-r2/ # R2 storage integration
β βββ supabase/ # Supabase integration
βββ prisma/ # Database schema & migrations
- JWT Authentication with refresh tokens
- Social Login (Google, Twitter, Facebook, GitHub, Discord)
- Two-Factor Authentication (TOTP)
- Rate Limiting and brute force protection
- Session Management and device tracking
- Password Security with Argon2 hashing
- Rich User Profiles with avatars and banners
- Privacy Controls with granular settings
- Security Dashboard with login history
- Cryptographic Operations for secure data
- User Analytics and behavior tracking
- GDPR Compliance with data export/deletion
- Direct Messages and group chats
- File Sharing with media support
- Voice Messages and rich content
- Read Receipts and typing indicators
- Message Encryption (optional E2E)
- Push Notifications across platforms
- Threaded Discussions with nested replies
- Category Management and organization
- Full-text Search with advanced filtering
- Content Moderation tools and workflows
- Real-time Updates and notifications
- Trending Content and analytics
- Sticker Packs with monetization support
- Custom Emojis for chats and global use
- GIF Management with categories and trending
- Bulk Operations for efficient management
- Usage Analytics and popularity tracking
- Content Moderation and approval workflows
- Global CDN distribution
- Image/Video Processing with optimization
- Format Conversion and compression
- Responsive Images with multiple sizes
- Smart Caching and invalidation
- Performance Analytics and monitoring
- Scalable Uploads with chunked support
- Cloudflare R2 integration
- Virus Scanning and security validation
- Metadata Extraction and thumbnails
- Storage Optimization with tiered storage
- Backup & Redundancy across regions
- NestJS - Scalable Node.js framework
- TypeScript - Type-safe development
- Express - HTTP server foundation
- PostgreSQL - Primary database with optimization
- Prisma - Type-safe database ORM
- Redis - Caching and session storage
- Cloudflare R2 - Object storage and CDN
- Socket.IO - WebSocket communication
- Bull - Background job processing
- Node-cron - Scheduled tasks
- Passport - Authentication strategies
- Argon2 - Password hashing
- Class-validator - Input validation
- Helmet - Security headers
- Sharp - Image processing
- FFmpeg - Video/audio processing
- Multer - File upload handling
- Node.js 18+ and npm
- PostgreSQL 14+
- Redis 6+
- Docker (optional)
# Clone the repository
git clone <repository-url>
cd awe-server
# Install dependencies
npm install
# Setup environment variables
cp .env.example .env
# Edit .env with your configuration
# Setup database
npm run db:migrate
npm run db:seed
# Start the application
npm run start:dev# Database
DATABASE_URL="postgresql://user:password@localhost:5432/awe"
SHADOW_DATABASE_URL="postgresql://user:password@localhost:5432/awe_shadow"
# Redis
REDIS_HOST="localhost"
REDIS_PORT=6379
REDIS_PASSWORD=""
# JWT
JWT_SECRET="your-jwt-secret"
JWT_REFRESH_SECRET="your-refresh-secret"
# Cloudflare R2
R2_ENDPOINT="https://your-account.r2.cloudflarestorage.com"
R2_ACCESS_KEY_ID="your-access-key"
R2_SECRET_ACCESS_KEY="your-secret-key"
R2_BUCKET_NAME="your-bucket"
# Social Auth (optional)
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
# ... other social providersEach module has comprehensive documentation:
- Authentication Module - Auth, security, and user session management
- Users Module - User profiles, settings, and security features
- Messenger Module - Real-time messaging and communication
- Forum Module - Discussion forums and community features
- Media Assets Module - Stickers, emojis, and GIFs
- Media Hosting Module - Media processing and CDN
- Uploads Module - File upload and storage management
- Common Module - Shared utilities and infrastructure
# Development
npm run start:dev # Start in watch mode
npm run start:debug # Start with debugging
# Building
npm run build # Build for production
npm run start:prod # Start production build
# Testing
npm run test # Run unit tests
npm run test:e2e # Run integration tests
npm run test:cov # Run tests with coverage
# Database
npm run db:migrate # Run database migrations
npm run db:seed # Seed database with sample data
npm run db:studio # Open Prisma Studio
npm run db:reset # Reset database (development only)
# Code Quality
npm run lint # Run ESLint
npm run format # Format code with Prettier
npm run type-check # TypeScript type checkingWhen running in development, Swagger documentation is available at:
- Swagger UI:
http://localhost:3000/api - OpenAPI JSON:
http://localhost:3000/api-json
# Generate Prisma client
npx prisma generate
# Create new migration
npx prisma migrate dev --name migration-name
# Apply migrations to production
npx prisma migrate deploy
# Reset database (development only)
npx prisma migrate reset
# Open Prisma Studio
npx prisma studio# Build Docker image
docker build -t awe-server .
# Run with Docker Compose
docker-compose up -d
# View logs
docker-compose logs -f awe-server- Health Checks for all services
- Metrics Collection with Prometheus format
- Request Logging with correlation IDs
- Error Tracking with stack traces
- Performance Monitoring for slow queries
- Health:
/health - Metrics:
/metrics - Database:
/health/database - Redis:
/health/redis - Storage:
/health/storage
- JWT-based authentication with refresh tokens
- Role-based access control (RBAC)
- Social login integration
- Two-factor authentication support
- Session management and device tracking
- Comprehensive input validation with class-validator
- XSS protection and HTML sanitization
- SQL injection prevention with Prisma
- File upload validation and virus scanning
- Rate limiting and DDoS protection
- Encryption at rest and in transit
- Secure password hashing with Argon2
- GDPR compliance with data export/deletion
- Audit logging for sensitive operations
- Regular security updates and patches
- Configure environment variables
- Set up SSL certificates
- Configure reverse proxy (nginx/CloudFlare)
- Set up monitoring and alerting
- Configure backup strategies
- Review security settings
- Test disaster recovery procedures
- Horizontal Scaling: Multiple server instances behind load balancer
- Database Scaling: Read replicas and connection pooling
- Caching: Redis cluster for distributed caching
- File Storage: CDN for global content delivery
- Background Jobs: Separate worker processes
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript and ESLint rules
- Write comprehensive tests for new features
- Update documentation for API changes
- Follow conventional commit messages
- Ensure all tests pass before submitting PR
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: Check module-specific README files
- Issues: Report bugs and feature requests on GitHub
- Discussions: Join community discussions
- Email: Contact the development team
Built with β€οΈ using NestJS and TypeScript
$ npm run test$ npm run test:e2e
$ npm run test:cov
## Deployment
When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the [deployment documentation](https://docs.nestjs.com/deployment) for more information.
If you are looking for a cloud-based platform to deploy your NestJS application, check out [Mau](https://mau.nestjs.com), our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps:
```bash
$ npm install -g mau
$ mau deploy
With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure.
Check out a few resources that may come in handy when working with NestJS:
- Visit the NestJS Documentation to learn more about the framework.
- For questions and support, please visit our Discord channel.
- To dive deeper and get more hands-on experience, check out our official video courses.
- Deploy your application to AWS with the help of NestJS Mau in just a few clicks.
- Visualize your application graph and interact with the NestJS application in real-time using NestJS Devtools.
- Need help with your project (part-time to full-time)? Check out our official enterprise support.
- To stay in the loop and get updates, follow us on X and LinkedIn.
- Looking for a job, or have a job to offer? Check out our official Jobs board.
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
- Author - Kamil MyΕliwiec
- Website - https://nestjs.com
- Twitter - @nestframework
Nest is MIT licensed.