A modern, secure, and scalable file management solution built for enterprise environments
π― Features β’ π Quick Start β’ π Documentation β’ π§ͺ Testing β’ π’ Deployment
The Enterprise File Tracking System is a comprehensive, production-ready file management platform designed for organizations that need robust file tracking, security, and collaboration capabilities. Built with modern technologies and enterprise-grade architecture, it provides a seamless experience for managing files across teams and departments.
- π Enterprise Security - JWT authentication, role-based access control, and audit trails
- π Advanced File Management - Upload, organize, share, and track files with metadata
- π Intelligent Search - Advanced search capabilities with filters and categorization
- π₯ Multi-tenant Architecture - Department-based organization and user management
- π Analytics & Reporting - Comprehensive audit trails and usage analytics
- π Modern UI/UX - Beautiful, responsive interface built with Radix UI and Tailwind CSS
- π³ Docker Ready - Containerized deployment with production configurations
- π§ͺ Comprehensive Testing - Unit, integration, and E2E tests with 90%+ coverage
- Secure Authentication - JWT-based authentication with bcrypt password hashing
- Role-Based Access Control - Admin, Manager, and User roles with granular permissions
- Session Management - Secure session handling with automatic token refresh
- Password Security - Strong password requirements and secure storage
- Multi-Format Support - Images, documents, videos, presentations, spreadsheets, and archives
- Drag & Drop Upload - Intuitive file upload with progress tracking
- File Categorization - Organize files by category, department, and custom tags
- Version Control - Track file versions and changes over time
- Bulk Operations - Upload, download, and manage multiple files simultaneously
- Smart Search - Full-text search across file names, descriptions, and metadata
- Advanced Filters - Filter by file type, date range, department, and status
- Quick Access - Recent files and frequently accessed content
- Search Analytics - Track search patterns and popular content
- Secure File Sharing - Share files with specific users or departments
- Access Control - Granular permissions for shared files
- Collaboration Tools - Comments, annotations, and file discussions
- Notification System - Real-time notifications for file activities
- Comprehensive Audit Trail - Track all file operations and user activities
- Usage Analytics - File access patterns, storage usage, and user engagement
- Compliance Reporting - Generate reports for compliance and governance
- Activity Monitoring - Real-time monitoring of system activities
- Modern Interface - Clean, intuitive design with dark/light theme support
- Responsive Design - Optimized for desktop, tablet, and mobile devices
- Accessibility - WCAG compliant with keyboard navigation and screen reader support
- Performance - Optimized loading times and smooth interactions
- Next.js 15.5.3 - React framework with App Router
- React 19 - Latest React with concurrent features
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Accessible component primitives
- React Hook Form - Performant form handling
- Zod - Schema validation
- Node.js - JavaScript runtime
- Next.js API Routes - Serverless API endpoints
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- JWT - JSON Web Tokens for authentication
- bcryptjs - Password hashing
- Docker - Containerization
- Docker Compose - Multi-container orchestration
- GitHub Actions - CI/CD pipelines
- Playwright - End-to-end testing
- Jest - Unit and integration testing
- Node.js 18+ and pnpm (or npm/yarn)
- Docker and Docker Compose
- MongoDB (local or cloud instance)
-
Clone the repository
git clone <repository-url> cd file-tracking-docker
-
Start with Docker Compose
docker-compose up -d
-
Access the application
- Application: http://localhost:3000
- MongoDB Admin: http://localhost:8081 (admin/password)
-
Create demo admin user
docker-compose exec app pnpm run setup:demo-admin
-
Install dependencies
pnpm install
-
Set up environment variables
cp .env.example .env # Edit .env with your configuration
-
Start MongoDB (if not using Docker)
# Using Docker docker run -d -p 27017:27017 --name mongodb mongo:7.0 # Or use MongoDB Atlas cloud service
-
Run the development server
pnpm dev
-
Create admin user
pnpm run setup:admin
After setup, use these credentials to access the system:
- Email:
admin@filetracking.com
- Password:
admin123
Variable | Description | Default | Required |
---|---|---|---|
MONGODB_URI |
MongoDB connection string | mongodb://localhost:27017/file-tracking |
β |
JWT_SECRET |
JWT signing secret (32+ chars) | - | β |
BASE_URL |
Application base URL | http://localhost:3000 |
β |
MAX_FILE_SIZE |
Maximum file size in bytes | 52428800 (50MB) |
β |
ALLOWED_FILE_TYPES |
Comma-separated MIME types | See docker-compose.yml | β |
NODE_ENV |
Environment mode | development |
β |
POST /api/auth/login
- User loginPOST /api/auth/register
- User registrationPOST /api/auth/logout
- User logoutGET /api/auth/verify
- Verify JWT token
POST /api/files/upload
- Upload filesGET /api/files
- List files with paginationGET /api/files/[id]
- Get file detailsPUT /api/files/[id]
- Update file metadataDELETE /api/files/[id]/delete
- Delete fileGET /api/files/[id]/download
- Download filePOST /api/files/[id]/share
- Share file
GET /api/search
- Search filesGET /api/search/suggestions
- Search suggestionsGET /api/search/filters
- Available filters
GET /api/admin/users
- List usersPOST /api/admin/users
- Create userPUT /api/admin/users/[id]
- Update userDELETE /api/admin/users/[id]
- Delete userGET /api/admin/analytics
- System analytics
GET /api/notifications
- Get user notificationsPATCH /api/notifications/[id]/read
- Mark notification as readPATCH /api/notifications/mark-all-read
- Mark all as read
GET /api/audit/trail
- Get audit trailGET /api/audit/stats
- Get audit statisticsGET /api/audit/export
- Export audit report
The project includes comprehensive testing with high coverage:
- Unit Tests - Individual component and function testing
- Integration Tests - API endpoint and database integration
- E2E Tests - Full user workflow testing with Playwright
# Run all tests
pnpm test
# Run tests in watch mode
pnpm test:watch
# Run with coverage
pnpm test:coverage
# Run integration tests
pnpm test:integration
# Run E2E tests
pnpm test:e2e
# Run E2E tests with UI
pnpm test:e2e:ui
The project maintains high test coverage across all critical components:
- API Routes: 95%+ coverage
- Business Logic: 90%+ coverage
- Components: 85%+ coverage
- E2E Workflows: 100% critical paths
-
Build production image
docker build -f Dockerfile -t file-tracking-system .
-
Run with production compose
docker-compose -f docker-compose.prod.yml up -d
The system supports deployment to various cloud platforms:
# Deploy to Railway (configured in GitHub Actions)
git tag v1.0.0
git push origin v1.0.0
# Deploy to Render (configured in GitHub Actions)
git push origin main
- Set up environment variables in your cloud provider
- Deploy the Docker image
- Configure database connection
- Set up file storage (if using cloud storage)
The project includes automated CI/CD with GitHub Actions:
-
Continuous Integration
- Code quality checks (ESLint, TypeScript)
- Security scanning (Snyk)
- Unit and integration tests
- E2E testing
- Build verification
-
Continuous Deployment
- Automated Docker image building
- Multi-environment deployment
- Slack notifications
- Rollback capabilities
// Supported file types
const ALLOWED_TYPES = [
'image/*', // Images
'application/pdf', // PDF documents
'application/msword', // Word documents
'text/plain', // Text files
'video/mp4', // Videos
'application/zip', // Archives
// ... and more
];
// File size limits
const MAX_FILE_SIZE = 50 * 1024 * 1024; // 50MB
const MAX_FILES_PER_UPLOAD = 10;
// JWT Configuration
const JWT_CONFIG = {
expiresIn: '7d',
algorithm: 'HS256',
issuer: 'file-tracking-system'
};
// Rate Limiting
const RATE_LIMITS = {
upload: '10 requests per minute',
api: '100 requests per minute',
auth: '5 requests per minute'
};
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Make your changes
- Add tests for new functionality
- Ensure all tests pass (
pnpm test
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- TypeScript - All code must be properly typed
- ESLint - Follow the configured linting rules
- Testing - Maintain test coverage above 85%
- Documentation - Update docs for new features
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: Check the docs in the
/docs
folder - Issues: Report bugs via GitHub Issues
- Discussions: Join GitHub Discussions for questions
- Email: Contact the development team
π MongoDB Connection Issues
Problem: Cannot connect to MongoDB
Solutions:
- Ensure MongoDB is running:
docker ps
- Check connection string in
.env
- Verify network connectivity
- Check MongoDB logs:
docker logs mongodb
π Authentication Problems
Problem: JWT token issues
Solutions:
- Verify
JWT_SECRET
is set and 32+ characters - Clear browser storage and cookies
- Check token expiration settings
- Restart the application
π File Upload Failures
Problem: Files not uploading
Solutions:
- Check file size limits (
MAX_FILE_SIZE
) - Verify file type is allowed (
ALLOWED_FILE_TYPES
) - Ensure sufficient disk space
- Check upload directory permissions
- Next.js Team - For the amazing React framework
- Radix UI - For accessible component primitives
- Tailwind CSS - For the utility-first CSS framework
- MongoDB - For the flexible database solution
- Open Source Community - For the incredible tools and libraries
Built with β€οΈ for enterprise file management
β Star this repo β’ π Report bug β’ π‘ Request feature