A full-stack web application that allows users to upload documents and search through them with intelligent keyword highlighting and relevance ranking.
- Multi-format Support: Upload PDF, DOCX, PPTX, and TXT files
- Full-text Search: Search across all uploaded documents instantly
- Keyword Highlighting: See highlighted search terms in results
- Relevance Ranking: Results ranked by relevance score
- Document Management: View, download, and delete documents
- Responsive Design: Works on desktop and mobile devices
- Real-time Search: Debounced search with instant results
- FastAPI: Modern Python web framework
- Python 3.9+: Core language
- Uvicorn: ASGI server
- React 18: Frontend framework
- Tailwind CSS: Utility-first CSS framework
- Axios: HTTP client
- React Dropzone: File upload component
On Windows:
Double-click start.bat or run:
start.batOn macOS / Linux:
chmod +x start.sh
./start.sh# From the project root
python backend/app/main.py- Backend API:
http://localhost:8002 - Interactive Swagger Docs:
http://localhost:8002/docs
cd frontend
npm start- Frontend App:
http://localhost:3000
POST /api/v1/upload
Content-Type: multipart/form-data
GET /api/v1/search?q={query}&page={page}&size={size}&file_type={type}
GET /api/v1/documents/{id}
GET /api/v1/documents/{id}/download
DELETE /api/v1/documents/{id}
GET /api/v1/documents?page={page}&size={size}&sort={field}
GET /api/v1/stats
- Upload Documents: Drag and drop files or click to select files on the home page
- Search: Use the search bar to find documents containing specific keywords
- View Results: Click on search results to see highlighted keywords and download files
- Manage Documents: View all documents, sort them, and delete unwanted files
- PDF: Portable Document Format
- DOCX: Microsoft Word documents
- PPTX: Microsoft PowerPoint presentations
- TXT: Plain text files
- Fuzzy Search: Handles typos and similar words
- Multi-word Search: Search for multiple keywords
- File Type Filtering: Filter results by document type
- Pagination: Navigate through large result sets
- Metadata Tracking: File size, upload date, word count
- Status Tracking: Processing status of each document
- Bulk Operations: Select and manage multiple documents
- Responsive Design: Works on all screen sizes
- Dark/Light Theme: Automatic theme detection
- Accessibility: WCAG compliant interface
- Progressive Web App: Can be installed as a desktop app
document-search-engine/
├── backend/
│ ├── app/
│ │ └── main.py # FastAPI application
│ ├── uploads/ # Uploaded files storage
│ └── requirements.txt # Python dependencies
├── frontend/
│ ├── public/
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # Page components
│ │ ├── services/ # API services
│ │ └── App.jsx # Main app component
│ └── package.json # Node.js dependencies
└── README.md
To add support for new file types:
- Update
ALLOWED_EXTENSIONSinbackend/app/main.py - Add text extraction logic in the
extract_textfunction - Update the frontend file type filters
- Styling: Modify Tailwind CSS classes in components
- Search Algorithm: Enhance the search logic in the backend
- File Processing: Add more sophisticated text extraction
- Database: Replace in-memory storage with PostgreSQL or MongoDB
Create a docker-compose.yml file:
version: '3.8'
services:
backend:
build: ./backend
ports:
- "8000:8000"
volumes:
- ./uploads:/app/uploads
frontend:
build: ./frontend
ports:
- "3000:3000"
depends_on:
- backend- Frontend: Deploy to Vercel, Netlify, or AWS S3
- Backend: Deploy to Heroku, AWS ECS, or Google Cloud Run
- Storage: Use AWS S3 or Google Cloud Storage for file storage
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue on GitHub
- Check the documentation
- Review the API endpoints
- OCR support for scanned documents
- Multi-language support
- Document preview
- Advanced search filters
- User authentication
- Document sharing
- API rate limiting
- Elasticsearch integration
- Machine learning-based search
- Document categorization