A comprehensive full-stack document management system built with FastAPI backend and React frontend. This application allows users to organize, upload, and manage documents within structured organizations, categories, and folders with robust role-based access control.
- User Authentication & Authorization: JWT-based authentication
- Role-Based Access Control: Granular permissions for users, admins, and organization roles
- Organization Management: Create and manage multiple organizations with departments
- Document Organization: Hierarchical structure with categories, folders, and documents
- File Management: Upload, download, and view documents with support for various file types
- Document Viewing: Built-in viewer for images, PDFs, and text files
- Admin Panel: Comprehensive administration interface for system management
- File Synchronization: Track file changes and sync status
- Responsive UI: Modern, accessible interface built with React, Shadcn and Tailwind CSS
- FastAPI: High-performance web framework for building APIs
- SQLAlchemy: ORM for database operations
- PostgreSQL: Primary database
- Pydantic: Data validation and serialization
- JWT: Authentication tokens
- Alembic: Database migrations
- React: UI library with TypeScript
- Vite: Fast build tool and development server
- Tailwind CSS: Utility-first CSS framework
- Shadcn: Accessible component library
- React Query: Data fetching and caching
- React Hook Form: Form management
- React Router: Client-side routing
- Python 3.8+
- Node.js 16+
- PostgreSQL database
-
Navigate to the server directory:
cd server -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
cp .env.example .env
Edit
.envwith your database URL and other configuration. -
Run database migrations:
# Assuming you have alembic configured alembic upgrade head -
Start the backend server:
uvicorn main:app --reload
The API will be available at http://localhost:8000
-
Navigate to the client directory:
cd client -
Install dependencies:
npm install
-
Start the development server:
npm run dev
The application will be available at http://localhost:5173
-
Initial Setup: The application creates default roles and an admin user on startup (credentials configured in
.env) -
Admin Access: Login with admin credentials to access the admin panel for managing organizations, users, and system settings
-
User Registration: Users can register or be assigned to organizations by admins
-
Document Management:
- Create categories to organize documents
- Add folders within categories for further organization
- Upload documents to categories or folders
- Set permissions for viewing/editing documents
-
File Operations:
- View supported document types directly in the browser
- Download files securely
- Track file synchronization status
When the backend is running, API documentation is available at:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
documents-app/
├── server/ # FastAPI backend
│ ├── core/ # Core functionality (config, security, database)
│ ├── models/ # SQLAlchemy models
│ ├── routes/ # API route handlers
│ ├── schemas/ # Pydantic schemas
│ ├── services/ # Business logic services
│ ├── repositories/ # Data access layer
│ └── main.py # Application entry point
├── client/ # React frontend
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Page components
│ │ ├── hooks/ # Custom React hooks
│ │ └── utils/ # Utility functions
│ ├── public/ # Static assets
│ └── package.json
└── README.md
This project is licensed under the MIT License - see the LICENSE file for details.