Welcome to the Frontend of the DocuThinker application! This React-based frontend integrates with the DocuThinker backend, allowing users to upload documents, chat with an AI, and extract key insights from their documents. The frontend also provides various authentication functionalities such as registration, login, and password recovery.
- Overview
- File Structure
- Prerequisites
- Installation
- Environment Variables
- Running the App
- Key Features
- Screenshots
- Deployment
- Contributing
- License
The DocuThinker Frontend is built using React and Material-UI to create a clean and responsive interface. It allows users to:
- Upload documents (PDF or Word) for AI-based summarization and key insights generation.
- Register, log in, and reset their passwords.
- View and interact with the document processing results in a user-friendly way.
The frontend consists of several pages and components that make up the user interface. Here are the main pages:
Here is the complete file structure for the DocuThinker Frontend. The frontend is located under DocuThinker-AI-App/frontend
:
DocuThinker-AI-App/
├── frontend/
│ ├── public/
│ │ ├── index.html # Main HTML template
│ │ └── manifest.json # Manifest for PWA settings
│ ├── src/
│ │ ├── assets/ # Static assets like images and fonts
│ │ │ └── logo.png # App logo or images
│ │ ├── components/
│ │ │ ├── ChatModal.js # Chat modal component
│ │ │ ├── Spinner.js # Loading spinner component
│ │ │ ├── UploadModal.js # Document upload modal component
│ │ │ ├── Navbar.js # Navigation bar component
│ │ │ ├── Footer.js # Footer component
│ │ │ └── GoogleAnalytics.js # Google Analytics integration component
│ │ ├── pages/
│ │ │ ├── Home.js # Home page where documents are uploaded
│ │ │ ├── LandingPage.js # Welcome and information page
│ │ │ ├── Login.js # Login page
│ │ │ ├── Register.js # Registration page
│ │ │ ├── ForgotPassword.js # Forgot password page
│ │ │ └── HowToUse.js # Page explaining how to use the app
│ │ ├── App.js # Main App component
│ │ ├── index.js # Entry point for the React app
│ │ ├── App.css # Global CSS 1
│ │ ├── index.css # Global CSS 2
│ │ ├── reportWebVitals.js # Web Vitals reporting
│ │ ├── styles.css # Custom styles for different components
│ │ └── config.js # Configuration file for environment variables
│ ├── .env # Environment variables file (e.g., REACT_APP_BACKEND_URL)
│ ├── package.json # Project dependencies and scripts
│ ├── README.md # This README file
│ └── package.lock # Lock file for dependencies
- assets/: Contains static assets such as images, fonts, etc.
- components/: Reusable React components like
Navbar
,Footer
, andGoogleAnalytics
. - pages/: React components representing the different pages of the app (e.g.,
Home
,LandingPage
,Login
). - public/: Contains the
index.html
and other public files that aren't processed by Webpack.
Before you begin, ensure you have the following installed on your machine:
- Node.js (v14 or higher)
- npm or yarn
- Backend API (Ensure that the backend is set up and running. You can find the backend setup guide in the backend directory).
To get started, follow these steps:
-
Clone the repository:
git clone https://github.com/hoangsonww/DocuThinker-AI-App.git cd DocuThinker-AI-App/frontend
-
Install dependencies: Using npm:
npm install
or using Yarn:
yarn install
Ensure you have an .env
file in the frontend/
directory with the necessary environment variables:
REACT_APP_BACKEND_URL=http://localhost:3000 # Backend URL for API requests
REACT_APP_GOOGLE_ANALYTICS_ID=G-XXXXXX # Google Analytics ID (optional)
-
Start the development server:
npm start
or if using yarn:
yarn start
-
Open your browser and navigate to
http://localhost:3001
(or the port you configured).
Here are the most important scripts available in the package.json
:
-
Start:
npm start
Starts the React app in development mode.
-
Build:
npm run build
Builds the app for production in the
build/
directory. -
Test:
npm test
Runs the test suite for the project.
- Document Upload: Users can upload documents (PDF, Word) and get real-time AI summaries and key insights.
- Authentication: Users can register, log in, and reset their passwords.
- Google Analytics Integration: User activity is tracked via Google Analytics.
- Dark Mode Support: Theme toggle between dark and light modes.
- Responsive Design: Works well on both desktop and mobile devices.
Here are some screenshots of the DocuThinker Frontend:
[Placeholder for Landing Page Screenshot - Centered]
[Placeholder for Document Upload Screenshot - Centered]
[Placeholder for Login Page Screenshot - Centered]
Note: Replace the placeholders with actual screenshots once you have them. You can take screenshots using your browser or a screenshot tool.
To deploy the app to Vercel, follow these steps:
- Create an account on Vercel if you don't have one.
- Install the Vercel CLI:
npm install -g vercel
- Link your project:
vercel
- Deploy the project:
vercel --prod
You can also configure the project in Vercel's dashboard and trigger deployments from your GitHub repository.
We welcome contributions from the community! If you'd like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature
- Make your changes and commit them:
git commit -m "Add your feature"
- Push the changes to your forked repository:
git push origin feature/your-feature
- Open a pull request to the main repository.
This project is licensed under the MIT License. See the LICENSE file for details.
Happy coding! 🚀