A full-stack AI-powered document classification system with user authentication, built with FastAPI backend and React frontend.
- Python 3.8+ (You have: 3.12.0rc2 ✅)
- Node.js 16+ (You have: 22.17.0 ✅)
- PostgreSQL Database (Supabase configured ✅)
- Run the setup script:
# Double-click or run: start_project.bat
# Navigate to server directory
cd "C:\Users\VICTUS 15\Desktop\react-doc-classifier\server"
# Start FastAPI server
python -m uvicorn main:app --host 0.0.0.0 --port 8000 --reload
# Navigate to client directory
cd "C:\Users\VICTUS 15\Desktop\react-doc-classifier\client"
# Start React development server
npm start
Once both servers are running:
- Frontend App: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
- API Alternative Docs: http://localhost:8000/redoc
- Go to http://localhost:3000
- Click "Sign up here"
- Fill in: Full Name, Email, Username, Password
- Click "Create Account"
- Enter your Username/Email and Password
- Click "Sign In"
- Upload PDF, PNG, JPG, JPEG, TIFF, or BMP files
- AI will automatically classify as: Invoice, Receipt, Contract, Resume, Report, etc.
- View confidence scores and detailed results
- Click "History" in the top navigation
- Search and filter your past classifications
- View all your document processing history
- Click your profile icon in the top right
- View account details
- Sign out when finished
The project uses these key configurations:
Backend (.env):
DATABASE_URL
: PostgreSQL connection stringSECRET_KEY
: JWT token encryption keyALGORITHM
: JWT algorithm (HS256)
Frontend:
REACT_APP_API_URL
: Backend API URL (defaults to http://localhost:8000)
✅ User Authentication
- JWT-based secure login/signup
- Password hashing and validation
- Session management
✅ Document Classification
- AI-powered document type detection
- Support for multiple file formats
- Confidence scoring
✅ Personal History
- User-specific document storage
- Search and filtering capabilities
- Classification results tracking
✅ Modern UI/UX
- Dark/Light mode toggle
- Responsive design
- Professional styling
cd server
# Install dependencies
pip install -r requirements.txt
# Run server
python main.py
# OR
uvicorn main:app --reload
# Run with specific host/port
uvicorn main:app --host 0.0.0.0 --port 8000 --reload
cd client
# Install dependencies
npm install
# Start development server
npm start
# Build for production
npm run build
# Run tests
npm test
-
"Module not found" errors
# Backend: Install Python dependencies cd server && pip install -r requirements.txt # Frontend: Install Node dependencies cd client && npm install
-
Database connection errors
- Check your
.env
file has correctDATABASE_URL
- Ensure Supabase database is accessible
- Check your
-
Port already in use
# Kill processes on ports 3000 or 8000 netstat -ano | findstr :3000 netstat -ano | findstr :8000 # Then kill with: taskkill /PID <PID_NUMBER> /F
-
CORS errors
- Ensure backend is running on port 8000
- Check CORS configuration in
server/middleware.py
-
Authentication not working
- Clear browser localStorage: F12 > Application > Local Storage > Clear
- Check if JWT SECRET_KEY is set in backend .env
react-doc-classifier/
├── client/ # React Frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── contexts/ # Authentication context
│ │ ├── services/ # API integration
│ │ └── styles/ # CSS styles
│ └── package.json
├── server/ # FastAPI Backend
│ ├── routers/ # API endpoints
│ ├── models/ # Database models
│ ├── schemas/ # Pydantic schemas
│ ├── utils/ # Utility functions
│ ├── model/ # AI model files
│ └── main.py # Server entry point
└── README.md
After startup, you can:
- Create your user account
- Test document classification
- Explore the history dashboard
- Try the API documentation at
/docs
For questions or issues, check the troubleshooting section above.
Happy Classifying! 🚀