S-Files is an innovative educational platform that helps students store files, collaborate, and work as a team in a modern cloud environment. The platform enables seamless file sharing and intelligent content analysis, making it perfect for academic projects, research collaboration, and group assignments.
Demo.mp4
Built with cutting-edge technologies including Next.js, Supabase PostgreSQL, S3-compatible storage, Cloudflare R2 objects, Google Gemini AI, RAG (Retrieval-Augmented Generation), and comprehensive database management - providing students with hands-on experience using industry-standard tools while fostering collaborative learning.
π Production URL: https://s-files.vercel.app
β¨ Try it now: Sign in with your Google account and experience seamless file management with AI-powered insights!
S-Files is designed as an educational file management platform where students can:
- π Store and organize files collectively - Create a collaborative learning environment
- π€ Understand file content with AI - Get intelligent insights about uploaded documents
- π― Learn modern web development - Built with industry-standard technologies
- βοΈ Experience cloud storage - Hands-on experience with S3-compatible storage solutions
- π Secure Authentication - Google OAuth integration with NextAuth.js v5 (JWT sessions)
- βοΈ Dual Cloud Storage - S3-compatible MinIO for development, Cloudflare R2 object storage for production
- π€ AI-Powered File Analysis - Understand and analyze file content using advanced AI integration
- π₯ Collaborative File Clusters - Students can store and share files in organized clusters
- π€ Advanced File Upload - S3 Presigned URLs with CORS support for direct browser uploads
- π¨ Beautiful UI - Modern glass-morphism design with animated backgrounds
- π Complete File Management - Upload, download, view, and delete files with real-time feedback
- ποΈ Database Integration - PostgreSQL with Prisma ORM and Prisma Accelerate
- π Production Optimized - Deployed on Vercel with automatic CI/CD
- π± Responsive Design - Works perfectly on desktop, tablet, and mobile
- Next.js 15 - Latest React framework with App Router
- React 19 - Modern React with latest features
- TypeScript - Full type safety
- Tailwind CSS v4 - Utility-first styling with custom animations
- NextAuth.js v5 - Modern authentication with JWT sessions
- Google OAuth - Secure Google Sign-In integration
- Supabase PostgreSQL - Robust relational database with real-time capabilities
- Prisma ORM - Type-safe database client with Accelerate for advanced database management
- MinIO - S3-compatible local development storage for hands-on learning
- Cloudflare R2 Object Storage - Production-grade S3-compatible cloud storage with global CDN
- AWS S3 SDK - Universal interface for S3-compatible storage systems
- Google Gemini AI - Advanced AI model for content analysis and understanding
- RAG (Retrieval-Augmented Generation) - Intelligent document search and content generation
- Content Recognition - Automated file categorization and insights
- Educational Analytics - Learning-focused file organization and collaboration metrics
- Vercel - Serverless deployment with automatic builds
- Docker - Containerized MinIO for local development
- S3-Compatible Architecture - Learn industry-standard object storage patterns
- Node.js 18+ and npm/yarn
- PostgreSQL database (Supabase recommended)
- Google Cloud Console account for OAuth
- Cloudflare account for R2 storage
- Vercel account for deployment
- Docker (optional, for local MinIO)
S-Files provides hands-on experience with S3-compatible object storage, the industry standard used by:
- Amazon S3 - The original cloud object storage
- Cloudflare R2 - Cost-effective S3-compatible storage
- MinIO - Self-hosted S3-compatible storage
- Google Cloud Storage - S3-compatible APIs
- Digital Ocean Spaces - S3-compatible object storage
- π Document Analysis - AI understands PDF, Word, and text file contents
- π Smart Search - Find files based on content, not just filenames
- π Content Insights - Get summaries and key points from uploaded documents
- π·οΈ Auto-categorization - Files automatically organized by AI analysis
- π‘ Learning Assistance - AI helps students understand complex documents
- Cloud Storage Architecture - Learn how modern applications handle file storage
- Authentication Systems - Understanding OAuth and JWT tokens
- API Design - RESTful endpoints and presigned URL patterns
- Database Design - Relational data modeling with Prisma
- Modern Web Development - Next.js, React, and TypeScript best practices
git clone https://github.com/Krishnadev-cmd/S-files.git
cd S-files
npm installCreate .env.local file:
# Database (Supabase with Prisma Accelerate)
DATABASE_URL="prisma+postgres://accelerate.prisma-data.net/?api_key=YOUR_ACCELERATE_API_KEY"
# NextAuth Configuration
NEXTAUTH_SECRET="your-generated-secret"
NEXTAUTH_URL="http://localhost:3000"
# Google OAuth Credentials
AUTH_GOOGLE_ID="your-google-client-id.apps.googleusercontent.com"
AUTH_GOOGLE_SECRET="GOCSPX-your-google-client-secret"
# Development Storage (MinIO)
S3_ENDPOINT_LOCAL="localhost"
S3_PORT="9000"
S3_ACCESS_KEY="minioadmin"
S3_SECRET_KEY="minioadmin"
S3_BUCKET_NAME="sfiles"
S3_USE_SSL="false"
# Production Storage (Cloudflare R2) - uncomment for production
# AWS_ACCESS_KEY_ID="your-r2-access-key"
# AWS_SECRET_ACCESS_KEY="your-r2-secret-key"
# AWS_REGION="auto"
# AWS_S3_BUCKET="sfiles"
# S3_ENDPOINT="https://your-account-id.r2.cloudflarestorage.com"# Push database schema to your PostgreSQL database
npx prisma db push
# Generate Prisma client
npx prisma generatedocker run -d \
--name minio-dev \
-p 9000:9000 -p 9001:9001 \
-e "MINIO_ROOT_USER=minioadmin" \
-e "MINIO_ROOT_PASSWORD=minioadmin" \
minio/minio server /data --console-address ":9001"npm run devVisit http://localhost:3000 to see your application!
- Go to Google Cloud Console: https://console.cloud.google.com/
- Create a new project or select existing one
- Enable Google+ API in APIs & Services
- Create OAuth 2.0 credentials:
- Application type: Web application
- Authorized redirect URIs:
http://localhost:3000/api/auth/callback/google(development)https://your-domain.vercel.app/api/auth/callback/google(production)
- Copy Client ID and Secret to your
.envfile
- Create account at https://supabase.com/
- Create new project and wait for setup
- Get connection string from Settings β Database
- Set up Prisma Accelerate (optional but recommended):
- Go to https://accelerate.prisma.io/
- Connect your database
- Get Accelerate connection string
- Create Cloudflare account and enable R2
- Create R2 bucket named
sfiles - Generate R2 tokens:
- Go to R2 β Manage R2 API tokens
- Create token with Object Read & Write permissions
- Configure CORS policy in bucket settings:
[
{
"AllowedOrigins": [
"https://your-domain.vercel.app",
"https://*.vercel.app",
"http://localhost:3000"
],
"AllowedMethods": ["GET", "PUT", "POST", "DELETE", "HEAD"],
"AllowedHeaders": ["*"],
"ExposeHeaders": ["ETag", "x-amz-version-id"],
"MaxAgeSeconds": 3600
}
]-
Connect to Vercel:
npm install -g vercel vercel login vercel
-
Set Environment Variables in Vercel Dashboard:
# Database DATABASE_URL=prisma+postgres://accelerate.prisma-data.net/?api_key=... # Authentication NEXTAUTH_SECRET=your-production-secret NEXTAUTH_URL=https://your-app.vercel.app AUTH_GOOGLE_ID=your-google-client-id AUTH_GOOGLE_SECRET=your-google-client-secret # Cloudflare R2 Storage AWS_ACCESS_KEY_ID=your-r2-access-key AWS_SECRET_ACCESS_KEY=your-r2-secret-key AWS_REGION=auto AWS_S3_BUCKET=sfiles S3_ENDPOINT=https://your-account-id.r2.cloudflarestorage.com S3_BUCKET_NAME=sfiles S3_PORT=443
-
Deploy:
vercel --prod
After deployment, update your Google OAuth configuration:
- Add your production URL:
https://your-app.vercel.app/api/auth/callback/google
S-Files/
βββ app/ # Next.js App Router
β βββ api/ # API routes
β β βββ auth/ # NextAuth endpoints
β β βββ files/ # File management endpoints
β β βββ test-db/ # Database testing
β βββ auth/ # Authentication pages
β βββ components/ # Reusable UI components
β βββ server/ # Server-side utilities
β βββ utils/ # Client-side utilities
βββ prisma/ # Database schema and migrations
βββ public/ # Static assets
βββ README.md # This file
- User selects files in the UI
- Frontend requests presigned URLs from
/api/files/upload/presignedUrl - Files upload directly to storage (MinIO/R2) using presigned URLs
- Metadata saves to database via
/api/files/upload/saveInfo - UI updates with upload progress and completion
- User clicks "Sign in with Google"
- NextAuth.js redirects to Google OAuth
- Google redirects back with authorization code
- NextAuth.js exchanges code for user profile
- JWT token created and stored in secure cookie
- User gains access to protected routes
- JWT Sessions - Stateless, secure authentication
- CORS Protection - Properly configured for cross-origin requests
- Environment Variables - Sensitive data stored securely
- Presigned URLs - Direct uploads without exposing credentials
- HTTPS Only - Production enforces secure connections
- Glass-morphism Design - Modern translucent interfaces
- Animated Backgrounds - Floating gradient blobs
- Smooth Transitions - Butter-smooth hover effects and animations
- Responsive Layout - Works on all device sizes
- Real-time Feedback - Upload progress and error handling
- Accessibility - Proper ARIA labels and keyboard navigation
# Development
npm run dev # Start dev server
npm run build # Build for production
npm run start # Start production server
# Database
npx prisma db push # Push schema changes
npx prisma generate # Generate Prisma client
npx prisma studio # Open database GUI
# Deployment
vercel # Deploy to preview
vercel --prod # Deploy to productionAuthentication Error:
- Check Google OAuth redirect URIs match your domain
- Verify
NEXTAUTH_URLmatches your deployment URL - Ensure
NEXTAUTH_SECRETis set and consistent
File Upload CORS Error:
- Verify R2 bucket CORS policy includes your domain
- Check all required environment variables are set
- Confirm S3_PORT is set to 443 for HTTPS endpoints
Database Connection Error:
- Verify DATABASE_URL is correct
- Check if Prisma schema is pushed to database
- Ensure database is accessible from your deployment
- Issues: Open an issue on GitHub
- Discussions: Use GitHub Discussions for questions
- Documentation: Check individual tool documentation (Next.js, Prisma, etc.)
This project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Next.js - The React framework for production
- Vercel - Deployment and hosting platform
- Supabase - Backend-as-a-Service for PostgreSQL
- Cloudflare - R2 object storage and global CDN
- Prisma - Next-generation ORM for TypeScript
- NextAuth.js - Complete open-source authentication solution
Built with β€οΈ by Krishnadev
A modern file management system for the cloud-native world.