# Install dependencies (first time only)
npm install
cd backend && pip install -r requirements.txt && cd ..
# Run the application
npm run devLibraDigit AI/
├── src/ # Frontend React code
│ ├── components/ # Reusable UI components
│ ├── context/ # State management
│ ├── pages/ # Page components
│ ├── App.jsx # Main app
│ └── index.css # Design system
├── backend/ # Python Flask API
│ └── server.py # API server
├── electron/ # Desktop wrapper
│ └── main.js # Electron config
└── Archive/ # Generated archives
- Dashboard → View all projects
- Upload & OCR → Upload document and run OCR
- Cleanup → Edit OCR text
- Metadata → Add title, author, year, subject, keywords
- Archive → Generate structured archive
| Endpoint | Method | Purpose |
|---|---|---|
/api/projects |
GET | List all projects |
/api/projects |
POST | Create new project |
/api/projects/:id |
GET | Get project details |
/api/projects/:id |
DELETE | Delete project |
/api/ocr/:id |
POST | Run OCR |
/api/cleanup/:id |
POST | Save cleaned text |
/api/metadata/:id |
POST | Save metadata |
/api/archive/:id |
POST | Generate archive |
- Primary:
#6366f1(Indigo) - Accent:
#10b981(Emerald) - Background:
#0a0a0f(Deep Dark) - Surface:
#2a2a3a(Elevated)
- UI Font: Inter
- Code Font: JetBrains Mono
- xs: 0.25rem
- sm: 0.5rem
- md: 1rem
- lg: 1.5rem
- xl: 2rem
id- Primary keyfilename- Document namefilepath- File locationstatus- Current workflow stepcreated_at- Creation timestampupdated_at- Last update
project_id- Foreign keyoriginal_path- Original fileocr_path- OCR processed filecleaned_path- Cleaned text filefinal_path- Archive file
project_id- Foreign keytitle- Document title (required)author- Author nameyear- Publication yearsubject- Subject/categorykeywords- Search keywords
project_id- Foreign keyoriginal_text- Raw OCR outputcleaned_text- User-edited text
- Create component in
src/pages/ - Add route in
src/App.jsx - Add navigation in
src/components/Sidebar.jsx
- Add route in
backend/server.py - Add function in
src/context/ProjectContext.jsx - Call from page component
- Edit
src/index.cssfor global styles - Edit component
.cssfiles for specific styles
upload- File uploadedocr- OCR processingcleanup- Text cleanupmetadata- Metadata entryarchived- Archive generated
Archive/
└── {Subject}/
└── {Year}/
└── {Author}_{Year}_{Title}.pdf
Example:
Archive/
└── History/
└── 2023/
└── Smith_2023_Ancient_Rome.pdf
cd backend
python server.pynpm run dev:reactDelete libradigit.db and restart
Change ports in:
vite.config.js(frontend)backend/server.py(backend)
- react, react-dom, react-router-dom
- axios, lucide-react
- vite, electron
- flask, flask-cors
- pytesseract, Pillow, PyPDF2
- ✅ Offline-first architecture
- ✅ SQLite persistent storage
- ✅ 5-step guided workflow
- ✅ Premium dark UI
- ✅ Real-time progress tracking
- ✅ Form validation
- ✅ Error handling
- ✅ Archive organization
- Sidebar, Header, WorkflowTracker
- Dashboard, UploadOCR, Cleanup, Metadata, Archive
- ProjectContext (state management)
.btn- Base button.btn-primary- Primary action.btn-secondary- Secondary action.btn-accent- Success action.btn-ghost- Minimal button
.card- Base card.card-elevated- With shadow
.form-group- Form field wrapper.form-label- Field label.form-input- Text input.form-textarea- Text area
.badge-primary- Blue badge.badge-accent- Green badge.badge-warning- Orange badge.badge-error- Red badge
npm run buildOutput: dist/ folder
- Node.js: v18+
- Python: v3.8+
- Tesseract: Latest
- Tesseract: https://github.com/tesseract-ocr/tesseract
- Flask: https://flask.palletsprojects.com/
- React: https://react.dev/
- Electron: https://www.electronjs.org/
Quick Tip: Use npm run dev for everything!