Enterprise-grade authentication and user management system for biotechnology platforms
The Reprotech Authentication System is a comprehensive, production-ready solution designed specifically for biotechnology and laboratory management platforms. It provides secure user authentication, role-based access control, and comprehensive audit logging with a modern, responsive user interface.
- π JWT-based Authentication - Secure token-based authentication with refresh capabilities
- π₯ Advanced User Management - Complete CRUD operations with search and filtering
- π‘οΈ Role-Based Access Control - Granular permissions across 39 system operations
- π Real-Time Analytics - Interactive dashboards with live data visualization
- π Comprehensive Audit Logging - Complete activity tracking for compliance
- π¨ Modern UI/UX - Professional React interface with responsive design
- π Production Ready - Enterprise-grade security and performance
- Authentication: JWT tokens with bcrypt password hashing
- API Design: RESTful endpoints with proper error handling
- Database: SQLite for development, PostgreSQL for production
- Security: CORS support, input validation, audit logging
- Framework: React 18 with hooks and context
- UI Library: shadcn/ui components with Tailwind CSS
- State Management: React Context for authentication
- Routing: Protected routes with role-based access
- Charts: Recharts for data visualization
- Python 3.11+
- Node.js 20+
- npm or yarn
- Git
-
Clone the repository
git clone https://github.com/taherkamal/Reprotech-M.git cd Reprotech-M -
Backend Setup
cd backend python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt python src/init_data.py # Initialize database with default data python src/main.py # Start backend server (port 5001)
-
Frontend Setup
cd frontend npm install npm run dev # Start development server (port 5173)
-
Access the Application
- Open your browser to
http://localhost:5173 - Login with default credentials:
- Username:
admin - Password:
Admin123!
- Username:
- Open your browser to
- OS: Windows, macOS, or Linux
- Memory: 4GB RAM minimum, 8GB recommended
- Storage: 2GB free space
- Network: Internet connection for dependencies
- OS: Linux (Ubuntu 20.04+ recommended)
- Memory: 8GB RAM minimum, 16GB recommended
- Storage: 20GB free space
- Database: PostgreSQL 12+
- Web Server: Nginx (recommended)
Create .env files in both backend and frontend directories:
Backend (.env)
FLASK_ENV=production
SECRET_KEY=your-secret-key-here
DATABASE_URL=postgresql://user:password@localhost/reprotech_auth
JWT_SECRET_KEY=your-jwt-secret-here
JWT_ACCESS_TOKEN_EXPIRES=3600
CORS_ORIGINS=http://localhost:3000,https://yourdomain.comFrontend (.env)
VITE_API_BASE_URL=http://localhost:5001/api
VITE_APP_NAME=Reprotech AuthenticationThe system comes with 7 pre-configured roles:
| Role | Permissions | Description |
|---|---|---|
| Super Administrator | 39 permissions | Full system access |
| Administrator | 14 permissions | User and role management |
| Manager | 11 permissions | Oversight and analytics |
| Researcher | 9 permissions | Research data access |
| Veterinarian | 17 permissions | Clinical and animal management |
| Laboratory Technician | 10 permissions | Lab and sample management |
| Viewer | 3 permissions | Read-only access |
- Password Security: Bcrypt hashing with salt
- JWT Tokens: Secure authentication with expiration
- Role-Based Access: Granular permission system
- Audit Logging: Complete activity tracking
- Input Validation: SQL injection and XSS protection
- CORS Configuration: Cross-origin request security
POST /api/auth/login- User loginPOST /api/auth/logout- User logoutPOST /api/auth/refresh- Token refreshGET /api/auth/me- Current user info
GET /api/users- List usersPOST /api/users- Create userPUT /api/users/{id}- Update userDELETE /api/users/{id}- Delete userGET /api/users/analytics- User analytics
GET /api/roles- List rolesPOST /api/roles- Create rolePUT /api/roles/{id}- Update roleDELETE /api/roles/{id}- Delete role
GET /api/audit- List audit logsGET /api/audit/export- Export logs
-
Build and run containers
docker-compose up -d
-
Access the application
- Frontend:
http://localhost:3000 - Backend API:
http://localhost:5001
- Frontend:
Backend
cd backend
docker build -t reprotech-auth-backend .
docker run -p 5001:5001 reprotech-auth-backendFrontend
cd frontend
docker build -t reprotech-auth-frontend .
docker run -p 3000:3000 reprotech-auth-frontend-
Install PostgreSQL
sudo apt update sudo apt install postgresql postgresql-contrib
-
Create database and user
sudo -u postgres psql CREATE DATABASE reprotech_auth; CREATE USER reprotech_user WITH PASSWORD 'your_password'; GRANT ALL PRIVILEGES ON DATABASE reprotech_auth TO reprotech_user;
-
Update configuration
- Update
DATABASE_URLin backend.env - Run migration:
python src/init_data.py
- Update
cd backend
python -m pytest tests/cd frontend
npm test# Test authentication
curl -X POST http://localhost:5001/api/auth/login \
-H "Content-Type: application/json" \
-d '{"username": "admin", "password": "Admin123!"}'- Database Indexing: Proper indexes on frequently queried fields
- Query Optimization: Efficient database queries
- Caching: Redis integration ready
- Connection Pooling: Database connection management
- Code Splitting: Lazy loading of components
- Bundle Optimization: Webpack optimization
- Caching: Browser caching strategies
- CDN Ready: Static asset optimization
- Backend: Structured logging with levels
- Frontend: Error boundary and logging
- Audit Trail: Complete user activity tracking
GET /api/health- Backend health status- Database connection monitoring
- System resource monitoring
AWS Deployment
- EC2 instances with Auto Scaling
- RDS for PostgreSQL
- CloudFront for CDN
- Application Load Balancer
Google Cloud Platform
- Compute Engine or App Engine
- Cloud SQL for PostgreSQL
- Cloud CDN
- Load Balancing
Azure Deployment
- App Service or Virtual Machines
- Azure Database for PostgreSQL
- Azure CDN
- Application Gateway
-
Server Setup
# Install dependencies sudo apt update sudo apt install python3.11 nodejs npm postgresql nginx # Clone and setup application git clone https://github.com/taherkamal/Reprotech-M.git cd Reprotech-M
-
Configure Nginx
server { listen 80; server_name yourdomain.com; location / { proxy_pass http://localhost:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } location /api { proxy_pass http://localhost:5001; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } }
-
SSL Configuration
sudo apt install certbot python3-certbot-nginx sudo certbot --nginx -d yourdomain.com
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Make your changes
- Run tests
npm test # Frontend pytest # Backend
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: support@reprotech.com
Common Issues:
-
Backend won't start
- Check Python version (3.11+ required)
- Verify all dependencies installed:
pip install -r requirements.txt - Check database connection
-
Frontend build fails
- Check Node.js version (20+ required)
- Clear node_modules:
rm -rf node_modules && npm install - Check environment variables
-
Authentication fails
- Verify backend is running on port 5001
- Check CORS configuration
- Verify JWT secret key configuration
- Two-Factor Authentication (2FA)
- LDAP/Active Directory integration
- Advanced audit log filtering
- Email notifications
- API rate limiting
- Single Sign-On (SSO) support
- Mobile application
- Advanced analytics dashboard
- Multi-tenant support
- Backup and restore tools
- Lines of Code: 15,000+
- Components: 25+ React components
- API Endpoints: 15+ RESTful endpoints
- Test Coverage: 85%+
- Performance: < 200ms authentication
- Security: Enterprise-grade
Built with β€οΈ for the biotechnology community
For more information, visit our documentation or contact our support team.