A secure document sharing platform with fine-grained access control, built with FastAPI and React.
- Document Management: Upload, organize, move between groups, and delete documents
- Document Groups: Create groups with member permissions and shared document access
- Share Links: Generate secure, time-limited share links with customizable permissions
- Fine-grained Access Control: Role-based permissions via HexIAM integration
- Analytics: Track document views and engagement
- Authentication: OIDC-based authentication with HexIAM
- Authorization: Hybrid edge/PDP authorization with policy-based access control
- Storage: PostgreSQL for metadata, object storage (S3/Cloudinary) for files
- Token Management: JWT-based access tokens with automatic refresh
- Modern UI: TailwindCSS, Lucide icons
- Automatic Token Refresh: Seamless session management
- User visits
/api/auth/login→ Redirects to HexIAM authorize endpoint - After successful authentication, callback sets cookies:
hexshare_access_token(httponly, short-lived)hexshare_refresh_token(httponly, 30 days)
- User is redirected to the dashboard
The frontend automatically refreshes tokens when receiving a 401 response:
- Calls
POST /api/auth/refresh - Backend uses stored refresh token to get new tokens from HexIAM
- New access token is set in cookie
- Original request is retried
| Endpoint | Method | Description |
|---|---|---|
/api/auth/login |
GET | Initiate OIDC login flow |
/api/auth/callback |
GET | OIDC callback handler |
/api/auth/signup |
GET | Initiate signup flow |
/api/auth/refresh |
POST | Refresh access token |
/api/auth/logout |
POST | Clear auth cookies |
# Database
DATABASE_URL=postgresql://user:pass@host:5432/hexshare
# HexIAM Integration
HEXIAM_URL=http://localhost:8000
HEXIAM_JWT_SECRET=your-jwt-secret
HEXSHARE_CLIENT_ID=your-client-id
HEXSHARE_CLIENT_SECRET=your-client-secret
HEXSHARE_PDP_CLIENT_ID=your-pdp-client-id
HEXSHARE_PDP_CLIENT_SECRET=your-pdp-client-secret
# URLs
HEXSHARE_PUBLIC_URL=http://localhost:8001
HEXSHARE_FRONTEND_URL=http://localhost:3003
# Object Storage (choose one)
CLOUDINARY_URL=cloudinary://...
# or
AWS_ACCESS_KEY_ID=...
AWS_SECRET_ACCESS_KEY=...
S3_BUCKET=...VITE_API_URL=http://localhost:8001
VITE_API_PROXY_TARGET=http://host.docker.internal:8000
VITE_BASE_PATH=/# Install dependencies
pip install -r requirements.txt
# Run migrations
alembic upgrade head
# Start server
uvicorn app.main:create_app --factory --host 0.0.0.0 --port 8001 --reloadcd hexshare-frontend
npm install
npm run devGET /api/v1/documents- List all documentsPOST /api/v1/documents- Create document metadataGET /api/v1/documents/{id}- Get document detailsPATCH /api/v1/documents/{id}/group- Move document between groupsDELETE /api/v1/documents/{id}- Delete document
GET /api/v1/document-groups- List groupsPOST /api/v1/document-groups- Create groupGET /api/v1/document-groups/{id}- Get group detailsPOST /api/v1/document-groups/{id}/members- Add memberDELETE /api/v1/document-groups/{id}/members/{user_id}- Remove member
POST /api/v1/links- Create share linkGET /api/v1/links- List share linksDELETE /api/v1/links/{id}- Revoke share link
GET /api/v1/workspace/users- List workspace users (for member selection)
MIT