A comprehensive SaaS metrics benchmarking platform providing real-time comparative analytics across different revenue ranges and data sources. Built with enterprise-grade security and scalability on Replit's infrastructure.
- π Interactive benchmark data visualization
- π Statistical distribution analysis
- π― Multi-dimensional filtering
- π Secure administrative interface
- π 14 key SaaS performance metrics
- π Real-time data processing
- π± Responsive design
- π Export capabilities
The platform is built using a modern microservices architecture:
graph TD
A[Web Application] --> B[API Gateway]
B --> C[Auth Service]
B --> D[Metrics Service]
B --> E[Import Service]
C & D & E --> F[(PostgreSQL)]
C & D --> G[(Redis Cache)]
- Node.js >= 18.0.0
- npm >= 8.0.0
- Docker >= 20.10.0
- Docker Compose >= 2.0.0
- PostgreSQL 14
- Redis 6.2
- Google Cloud Platform account
- Replit account
- Clone the repository:
git clone https://github.com/your-repo/saas-metrics.git
cd saas-metrics
- Configure environment variables:
cp .env.example .env
# Edit .env with your configuration
- Start development environment:
docker-compose up --build
- Access the application:
- Frontend: http://localhost:3000
- API: http://localhost:4000
- API Documentation: http://localhost:4000/api-docs
saas-metrics/
βββ src/
β βββ web/ # Frontend application
β βββ backend/ # Backend services
β β βββ auth/ # Authentication service
β β βββ metrics/ # Metrics processing service
β β βββ import/ # Data import service
β βββ shared/ # Shared utilities and types
βββ docker/ # Docker configurations
βββ docs/ # Additional documentation
βββ scripts/ # Utility scripts
βββ tests/ # Test suites
# Start all services
docker-compose up
# Frontend development
docker-compose exec web npm run dev
# Backend development
docker-compose exec api npm run dev
# Run tests
docker-compose exec web npm run test
docker-compose exec api npm run test
- ESLint configuration with Airbnb style guide
- Prettier for code formatting
- Husky for pre-commit hooks
- TypeScript strict mode enabled
# Run unit tests
npm run test
# Run integration tests
npm run test:integration
# Generate coverage report
npm run test:coverage
# Run security tests
npm run test:security
-
Configure Replit secrets:
DATABASE_URL
REDIS_URL
GOOGLE_CLIENT_ID
GOOGLE_CLIENT_SECRET
JWT_SECRET
-
Deploy the application:
npm run deploy:replit
- Configure domain and SSL in Replit dashboard
# Run migrations
npm run db:migrate
# Rollback migration
npm run db:rollback
# Generate new migration
npm run db:make migration_name
- Google OAuth 2.0 for administrative access
- JWT tokens for API authentication
- Role-based access control (RBAC)
- Secure session management
{
"public": {
"rate": 100,
"burst": 50,
"window": "1m"
},
"authenticated": {
"rate": 1000,
"burst": 100,
"window": "1m"
}
}
- AES-256 encryption for sensitive data
- TLS 1.3 for data in transit
- Regular security audits
- Automated vulnerability scanning
# Get access token
POST /api/v1/auth/login
Content-Type: application/json
{
"code": "google-oauth-code"
}
Method | Endpoint | Description | Auth Required |
---|---|---|---|
GET | /api/v1/metrics | List all metrics | No |
GET | /api/v1/metrics/{id} | Get metric details | No |
GET | /api/v1/benchmarks | Get benchmark data | No |
POST | /api/v1/admin/data | Import data | Yes |
PUT | /api/v1/admin/sources | Update sources | Yes |
# Application health
GET /health
# Detailed health status
GET /health/detailed
- Prometheus metrics exposed at
/metrics
- Grafana dashboards for visualization
- Custom SLO monitoring
- Error rate tracking
- Performance metrics
- Fork the repository
- Create your 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
This project is licensed under the MIT License - see the LICENSE file for details.
For support, please open an issue in the GitHub repository or contact the development team.
- Replit for hosting infrastructure
- Material-UI for UI components
- Chart.js for data visualization