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.
The DocuThinker Frontend is built using React and Material-UI to create a clean and responsive interface. It allows users to:
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
Navbar
, Footer
, and GoogleAnalytics
.Home
, LandingPage
, Login
).index.html
and other public files that arenβt processed by Webpack.Before you begin, ensure you have the following installed on your machine:
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.
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:
npm install -g vercel
vercel
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:
git checkout -b feature/your-feature
git commit -m "Add your feature"
git push origin feature/your-feature
This project is licensed under the MIT License. See the LICENSE file for details.
Happy coding! π