DocuThinker-AI-App

DocuThinker Frontend

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.

Table of Contents

Overview

The DocuThinker Frontend is built using React and Material-UI to create a clean and responsive interface. It allows users to:

User Interfaces

The frontend consists of several pages and components that make up the user interface. Here are the main pages:

Landing Page

Landing Page

Landing Page - Dark Mode

Landing Page - Dark Mode

Document Upload Page

Document Upload Page

Document Upload Page - Dark Mode

Document Upload Page - Dark Mode

Home Page

Home Page

Home Page - Dark Mode

Home Page - Dark Mode

Home Page - With Key Ideas

Home Page - With Key Ideas

Chat Modal

Chat Modal

Chat Modal - Dark Mode

Chat Modal - Dark Mode

How To Use Page

How To Use Page

How To Use Page - Dark Mode

How To Use Page - Dark Mode

Login Page

Login Page

Login Page - Dark Mode

Login Page - Dark Mode

Register Page

Register Page

Register Page - Dark Mode

Register Page - Dark Mode

Forgot Password Page

Forgot Password Page

Forgot Password Page - Dark Mode

Forgot Password Page - Dark Mode

Responsive Design - Example

Responsive Design

File Structure

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

Key Folders

Prerequisites

Before you begin, ensure you have the following installed on your machine:

Installation

To get started, follow these steps:

  1. Clone the repository:

    git clone https://github.com/hoangsonww/DocuThinker-AI-App.git
    cd DocuThinker-AI-App/frontend
    
  2. Install dependencies: Using npm:

    npm install
    

    or using Yarn:

    yarn install
    

Environment Variables

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)

Running the App

  1. Start the development server:

    npm start
    

    or if using yarn:

    yarn start
    
  2. Open your browser and navigate to http://localhost:3001 (or the port you configured).

Scripts

Here are the most important scripts available in the package.json:

Key Features

Screenshots

Here are some screenshots of the DocuThinker Frontend:

Landing Page

[Placeholder for Landing Page Screenshot - Centered]

Document Upload

[Placeholder for Document Upload Screenshot - Centered]

Login Page

[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.

Deployment

Deploying to Vercel

To deploy the app to Vercel, follow these steps:

  1. Create an account on Vercel if you don’t have one.
  2. Install the Vercel CLI:
    npm install -g vercel
    
  3. Link your project:
    vercel
    
  4. Deploy the project:
    vercel --prod
    

You can also configure the project in Vercel’s dashboard and trigger deployments from your GitHub repository.

Contributing

We welcome contributions from the community! If you’d like to contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch:
    git checkout -b feature/your-feature
    
  3. Make your changes and commit them:
    git commit -m "Add your feature"
    
  4. Push the changes to your forked repository:
    git push origin feature/your-feature
    
  5. Open a pull request to the main repository.

License

This project is licensed under the MIT License. See the LICENSE file for details.


Happy coding! πŸš€