This repository contains a React + Vite frontend and an Express-based Node server for a document intelligence application.
The project uses:
- React 19 + Vite
- Express server bundled with
esbuild - Google Gemini AI via
@google/genai - Tailwind CSS for styling
- Vitest for tests
- Node.js 20 or later
- npm
-
Install dependencies:
npm install
-
Create a
.envfile in the project root with the following values:GEMINI_API_KEY=your_google_gemini_api_key JWT_SECRET=your_jwt_secret
GEMINI_API_KEYis required for AI model requests.JWT_SECRETis used by the server for token generation and validation.
Run the app in development mode:
npm run devThis starts the application via tsx server.ts and serves the frontend through Vite.
To build the frontend and bundle the server for production:
npm run buildWhat this does:
vite buildbuilds the React frontendesbuild server.ts --bundle --platform=node --format=cjs --packages=external --sourcemap --outfile=dist/server.cjsbundles the Express server intodist/server.cjs
After building, start the production server with:
npm run startThe server listens on port 3000 by default.
Remove build artifacts:
npm run cleanRun the test suite:
npm run test- The server uses an in-memory database, so data does not persist across restarts.
- File upload size limits are configured in
server.tswith JSON and URL-encoded payload limits of50mb. - If you need to customize the port, update
PORTinserver.ts.
DocuSense AI is designed for enterprise document analysis and decision support. It combines:
- A React frontend for dashboarding, document upload, and knowledge graph visualization
- An Express backend for API handling, AI requests, authentication, and document parsing
- Google Gemini AI integration for classification, summarization, and compliance insights
- In-memory state for user sessions, documents, conversations, audit logs, and shared reports
This build is intended as a modern proof-of-concept stack with fast local development and easy production bundling.
-
Extend the AI flows:
- add smarter prompt templates
- support additional Gemini models or fallback logic
- persist results to a database instead of memory
-
Add production readiness:
- implement real authentication and user management
- add logging, metrics, and error tracking
- secure env handling and secrets management
-
Improve UX:
- add file upload previews and document history
- enhance the knowledge graph and analysis viewer
- support PDF, image OCR, and advanced document types
-
Deploy:
- containerize with Docker
- host on a cloud platform (AWS, GCP, Azure, or Vercel for frontend)
- connect to a persistent database and secure API gateway