Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hoangsonww/docuthinker-ai-app
π DocuThinker: A FERN-Stack, AI-powered app for document analysis, summarization, and real-time chat based on document content. Currently deployed live with Vercel & Render. Say goodbye to long reads - get the insights you need in seconds!
https://github.com/hoangsonww/docuthinker-ai-app
ai-ml artificial-intelligence chatbot document express expressjs fern-stack firebase firebase-auth firebase-database firebase-firestore jenkins kubernetes machine-learning mongodb nginx node-js nodejs react reactjs
Last synced: 3 months ago
JSON representation
π DocuThinker: A FERN-Stack, AI-powered app for document analysis, summarization, and real-time chat based on document content. Currently deployed live with Vercel & Render. Say goodbye to long reads - get the insights you need in seconds!
- Host: GitHub
- URL: https://github.com/hoangsonww/docuthinker-ai-app
- Owner: hoangsonww
- License: other
- Created: 2024-10-06T00:38:27.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2024-10-23T20:42:23.000Z (3 months ago)
- Last Synced: 2024-10-24T09:47:11.413Z (3 months ago)
- Topics: ai-ml, artificial-intelligence, chatbot, document, express, expressjs, fern-stack, firebase, firebase-auth, firebase-database, firebase-firestore, jenkins, kubernetes, machine-learning, mongodb, nginx, node-js, nodejs, react, reactjs
- Language: JavaScript
- Homepage: https://docuthinker.vercel.app/
- Size: 7.76 MB
- Stars: 13
- Watchers: 11
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# **DocuThinker - AI-Powered Document Analysis and Summarization App**
Welcome to **DocuThinker**! This is a full-stack **(FERN-Stack)** application that integrates an AI-powered document processing backend with a React-based frontend. The app allows users to upload documents for summarization, generate key insights, and chat with an AI based on the document's content.
## **π Table of Contents**
- [**π Overview**](#-overview)
- [**π Live Deployments**](#live-deployments)
- [**β¨ Features**](#features)
- [**βοΈ Technologies**](#technologies)
- [**πΌοΈ User Interfaces**](#user-interface)
- [**π Complete File Structure**](#complete-file-structure)
- [**π οΈ Getting Started**](#getting-started)
- [**Prerequisites**](#prerequisites)
- [**Frontend Installation**](#frontend-installation)
- [**Backend Installation**](#backend-installation)
- [**Running the Mobile App**](#running-the-mobile-app)
- [**π API Endpoints**](#api-endpoints)
- [**API Documentation**](#api-documentation)
- [**API Architecture**](#api-architecture)
- [**API Testing**](#api-testing)
- [**Error Handling**](#error-handling)
- [**Example Request to Register a User**](#example-request-to-register-a-user)
- [**π± Mobile App**](#mobile-app)
- [**π¦ Containerization**](#containerization)
- [**π Deployment**](#deployment)
- [**Frontend Deployment (Vercel)**](#frontend-deployment-vercel)
- [**Backend Deployment (Render)**](#backend-deployment-render)
- [**Important Note about Backend Deployment (Please Read)**](#important-note-about-backend-deployment)
- [**βοΈ Load Balancing & Caching**](#load-balancing)
- [**π Jenkins Integration**](#jenkins)
- [**π’ Kubernetes Integration**](#kubernetes)
- [**π§ Contributing**](#contributing)
- [**π License**](#license)
- [**π Additional Documentation**](#alternative-docs)
- [**π¨βπ» Author**](#author)π Overview
The **DocuThinker** app is designed to provide users with a simple, AI-powered document management tool. Users can upload PDFs or Word documents and receive summaries, key insights, and discussion points. Additionally, users can chat with an AI using the document's content for further clarification.
**DocuThinker** is created using the **FERN-Stack** architecture, which stands for **Firebase, Express, React, and Node.js**. The backend is built with Node.js and Express, integrating Firebase for user authentication and MongoDB for data storage. The frontend is built with React and Material-UI, providing a responsive and user-friendly interface.
It is currently deployed live on **Vercel** and **Render**. You can access the live app **[here](https://docuthinker-fullstack-app.vercel.app/)**.
[![Deployed with Vercel](https://img.shields.io/badge/Deployed%20with-Vercel-green)](https://docuthinker-fullstack-app.vercel.app)
[![Render Success](https://img.shields.io/badge/Render-Success-green)](https://docuthinker-ai-app.onrender.com/)
[![Netlify Backup Deployed](https://img.shields.io/badge/Netlify-Backup%20Deployed-green)](https://docuthinker-ai-app.netlify.app)
[![Firebase Functional](https://img.shields.io/badge/Firebase-Functional-green)](https://firebase.google.com)
[![MongoDB Atlas Connected](https://img.shields.io/badge/MongoDB%20Atlas-Connected-green)](https://www.mongodb.com/cloud/atlas)π Live Deployments
We have deployed the entire app on **Vercel** and **Render**. You can access the live app **[here](https://docuthinker-fullstack-app.vercel.app/)**.
- **Frontend**: Deployed on **Vercel**.
- **Backend**: Deployed on **Render**. You can access the live backend **[here](https://docuthinker-ai-app.onrender.com/)**.Feel free to explore the live app and test the functionalities. You can upload documents, generate summaries, and chat with an AI using the live app.
**Note**: The backend server may take a few seconds to wake up if it has been inactive for a while. The first API call may take a bit longer to respond. Subsequent calls should be faster as the server warms up. Additionally, the app is currently on the **Free Tier** of **Render**, so it may take longer to process your request since we are only allocated **512MB and 0.1 CPU**.
**Also:** We are using **Netlify** for backups and testing. You can access the backup app **[here](https://docuthinker-ai-app.netlify.app/)**.
β¨ Features
**DocuThinker** offers a wide range of features to help users manage and analyze their documents effectively. Here are some of the key features of the app:
- **Document Upload & Summarization**: Upload PDFs or Word documents for AI-generated summaries.
- **Key Insights & Discussion Points**: Generate important ideas and topics for discussion from your documents.
- **AI Chat Integration**: Chat with an AI using your documentβs original context.
- **User Authentication**: Secure registration, login, and password reset functionality.
- **Responsive Design**: Seamless experience across both desktop and mobile devices.
- **Profile Management**: Update email, password, and view document history.
- **Document History**: View all uploaded documents and their details.
- **Document Deletion**: Delete individual documents or all documents associated with your account.
- **Mobile App Integration**: React Native mobile app for on-the-go document management.
- **Dark Mode Support**: Toggle between light and dark themes.
- **How To Use Guide**: Detailed instructions on how to use the app effectively.
- **API Documentation**: Swagger documentation for all API endpoints.
- **Authentication Middleware**: Secure routes with Firebase authentication middleware.
- **Containerization**: Dockerized the app for easy deployment and scaling.
- **Continuous Integration**: Automated testing and deployment with GitHub Actions & Jenkins.βοΈ Technologies
- **Frontend**:
- **React**: JavaScript library for building user interfaces.
- **Material-UI**: React components for faster and easier web development.
- **Axios**: Promise-based HTTP client for making API requests.
- **React Router**: Declarative routing for React applications.
- **Context API**: State management for React applications.
- **Tailwind CSS**: Utility-first CSS framework for styling.
- **Craco**: Create React App Configuration Override for customizing Webpack.
- **Webpack**: Module bundler for JavaScript applications.
- **Backend**:
- **Express**: Web application framework for Node.js.
- **Redis**: In-memory data structure store for caching.
- **Firebase Admin SDK**: Firebase services for server-side applications.
- **Node.js**: JavaScript runtime for building scalable network applications.
- **Firebase Authentication**: Secure user authentication with Firebase.
- **Firebase Auth JWT**: Generate custom tokens for Firebase authentication.
- **OAuth2**: Authentication framework for securing API endpoints.
- **Middleware**: Firebase authentication middleware for securing routes.
- **AI/ML Services**:
- **Google Cloud Natural Language API**: Machine learning models for text analysis.
- **Google Gemini API**: AI-powered chatbot for conversational interfaces and document summarization.
- **Google AI Studio**: Tools for building and deploying machine learning models.
- **NLP**: Natural Language Processing for customized chat/text analysis and summarization models.
- **NER**: Named Entity Recognition for identifying entities in text.
- **POS Tagging**: Part-of-Speech Tagging for analyzing word types in text.
- **Database**:
- **MongoDB**: NoSQL database for storing user data and documents.
- **Firestore**: Cloud Firestore for storing user data and documents.
- **Redis**: In-memory data structure store for caching.
- **Mobile App**:
- **React Native**: JavaScript framework for building mobile applications.
- **Expo**: Framework and platform for universal React applications.
- **Firebase SDK**: Firebase services for mobile applications.
- **React Navigation**: Routing and navigation for React Native apps.
- **API Documentation**:
- **Swagger**: OpenAPI documentation for all API endpoints.
- **Containerization**:
- **Docker**: Containerization platform for building, shipping, and running applications.
- **Kubernetes**: Container orchestration for automating deployment, scaling, and management.
- **Load Balancing & Caching**:
- **NGINX**: Web server for load balancing, reverse proxying, and caching.
- **CI/CD & Deployment**:
- **GitHub Actions**: Automated workflows for testing and deployment.
- **Jenkins**: Automation server for continuous integration and deployment.
- **Render**: Cloud platform for hosting and scaling web applications. (Used to deploy the backend)
- **Vercel**: Cloud platform for hosting and deploying web applications. (Used to deploy the frontend)
- **Netlify**: Cloud platform for hosting and deploying web applications. (Used as a backup)πΌοΈ User Interface
**DocuThinker** features a clean and intuitive user interface designed to provide a seamless experience for users. The app supports both light and dark themes, responsive design, and easy navigation. Here are some screenshots of the app:
### **Landing Page**
### **Landing Page - Dark Mode**
### **Document Upload Page**
### **Document Upload Page - Dark Mode**
### **Document Upload Page - Document Uploaded**
### **Google Drive Document Selection**
### **Google Drive Document Selection - Dark Mode**
### **Home Page**
### **Home Page - Dark Mode**
### **Chat Modal**
### **Chat Modal - Dark Mode**
### **Documents Page**
### **Documents Page - Dark Mode**
### **Document Page - Search Results**
### **Profile Page**
### **Profile Page - Dark Mode**
### **How To Use Page**
### **How To Use Page - Dark Mode**
### **Login Page**
### **Login Page - Dark Mode**
### **Registration Page**
### **Registration Page - Dark Mode**
### **Forgot Password Page**
### **Forgot Password Page - Dark Mode**
### **Responsive Design Example**
### **Navigation Drawer**
### **404 Not Found Page**
### **404 Not Found Page - Dark Mode**
### **Footer**
π Complete File Structure
The **DocuThinker** app is organized into separate subdirectories for the frontend, backend, and mobile app. Each directory contains the necessary files and folders for the respective components of the app. Here is the complete file structure of the app:
```
DocuThinker-AI-App/
βββ backend/
β βββ ai_ml/
β β βββ perform_ner_pos.py # Named Entity Recognition and Part-of-Speech Tagging
β β βββ sen_analysis.py # Sentiment analysis for document text
β β βββ chat.js # Chatbot integration for AI chat functionality
β β βββ analyzer.js # Document analyzer for generating key ideas and discussion points
β β βββ textStatistics.js # Text statistics for analyzing document content
β β βββ documentClassifier.js # Document classifier for categorizing documents
β β βββ summarizer.js # Document summarizer for generating summaries
β β βββ (and many more files...) # Additional AI/ML services
β βββ controllers.js # Controls the flow of data and logic
β βββ models.js # Models for interacting with database and AI/ML services
β βββ views.js # Output formatting for success and error responses
β βββ .env # Environment variables (git-ignored)
β βββ firebase-admin-sdk.json # Firebase Admin SDK credentials (git-ignored)
β βββ index.js # Main entry point for the server
β βββ Dockerfile # Docker configuration file
β βββ README.md # Backend README file
β
βββ 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
β βββ craco.config.js # Craco configuration file
β βββ Dockerfile # Docker configuration file
β βββ README.md # Frontend README file
β βββ package.lock # Lock file for dependencies
β
βββ mobile-app/ # Mobile app directory
β βββ app/ # React Native app directory
β βββ .env # Environment variables file for the mobile app
β βββ app.json # Expo configuration file
β βββ components/ # Reusable components for the mobile app
β βββ assets/ # Static assets for the mobile app
β βββ constants/ # Constants for the mobile app
β βββ hooks/ # Custom hooks for the mobile app
β βββ scripts/ # Scripts for the mobile app
β βββ babel.config.js # Babel configuration file
β βββ package.json # Project dependencies and scripts
β βββ tsconfig.json # TypeScript configuration file
β
βββ kubernetes/ # Kubernetes configuration files
β βββ manifests/ # Kubernetes manifests for deployment, service, and ingress
β βββ backend-deployment.yaml # Deployment configuration for the backend
β βββ backend-service.yaml # Service configuration for the backend
β βββ frontend-deployment.yaml # Deployment configuration for the frontend
β βββ frontend-service.yaml # Service configuration for the frontend
β βββ firebase-deployment.yaml # Deployment configuration for Firebase
β βββ firebase-service.yaml # Service configuration for Firebase
β βββ configmap.yaml # ConfigMap configuration for environment variables
β
βββ nginx/
β βββ nginx.conf # NGINX configuration file for load balancing and caching
β βββ Dockerfile # Docker configuration file for NGINX
β
βββ images/ # Images for the README
βββ .env # Environment variables file for the whole app
βββ docker-compose.yml # Docker Compose file for containerization
βββ jsconfig.json # JavaScript configuration file
βββ package.json # Project dependencies and scripts
βββ package-lock.json # Lock file for dependencies
βββ postcss.config.js # PostCSS configuration file
βββ tailwind.config.js # Tailwind CSS configuration file
βββ render.yaml # Render configuration file
βββ vercel.json # Vercel configuration file
βββ .gitignore # Git ignore file
βββ LICENSE.md # License file for the project
βββ README.md # Comprehensive README for the whole app
βββ (and many more files...) # Additional files and directories not listed here
```π οΈ Getting Started
### **Prerequisites**
Ensure you have the following tools installed:
- **Node.js** (between v14 and v20)
- **npm** or **yarn**
- **Firebase Admin SDK** credentials
- **Redis** for caching
- **MongoDB** for data storage
- **RabbitMQ** for handling asynchronous tasks
- **Docker** for containerization (optional)
- **Postman** for API testing (optional)
- **Expo CLI** for running the mobile app
- **React Native CLI** for building the mobile app
- **Firebase SDK** for mobile app integration
- **Firebase API Keys and Secrets** for authentication
- **Expo Go** app for testing the mobile app on a physical device
- **Tailwind CSS** for styling the frontend
- **.env** file with necessary API keys (You can contact me to get the `.env` file - but you should obtain your own API keys for production).Additionally, **basic fullstack development knowledge and AI/ML concepts** are recommended to understand the app's architecture and functionalities.
### **Frontend Installation**
1. **Clone the repository**:
```bash
git clone https://github.com/hoangsonww/DocuThinker-AI-App.git
cd DocuThinker-AI-App/backend
```2. **Navigate to the frontend directory**:
```bash
cd frontend
```3. **Install dependencies**:
```bash
npm install
```4. **Start the Frontend React app**:
```bash
npm start
```
5. **Build the Frontend React app (for production)**:```bash
npm run build
```6. **Alternatively, you can use `yarn` to install dependencies and run the app**:
```bash
yarn install
yarn start
```
7. **Or, for your convenience, if you have already installed the dependencies, you can directly run the app in the root directory using**:```bash
npm run frontend
```This way, you don't have to navigate to the `frontend` directory every time you want to run the app.
8. **The app will run on `http://localhost:3000`**. You can access it in your browser.
### **Backend Installation**
Note that this is optional since we are deploying the backend on **Render**. However, you can (and should) run the backend locally for development purposes.
1. **Navigate to the root (not `backend`) directory**:
```bash
cd backend
```2. **Install dependencies**:
```bash
npm install
```3. **Start the backend server**:
```bash
npm run server
```
4. **The backend code is in the `backend` directory**. Feel free to explore the API endpoints and controllers.**Note:** Be sure to use Node v.20 or earlier to avoid compatibility issues with Firebase Admin SDK.
### **Running the Mobile App**
1. **Navigate to the mobile app directory**:
```bash
cd mobile-app
```
2. **Install dependencies**:
```bash
npm install
```
3. **Start the Expo server**:
```bash
npx expo start
```
4. **Run the app on an emulator or physical device**: Follow the instructions in the terminal to run the app on an emulator or physical device.π API Endpoints
The backend of **DocuThinker** provides several API endpoints for user authentication, document management, and AI-powered insights. These endpoints are used by the frontend to interact with the backend server:
| **Method** | **Endpoint** | **Description** |
| ---------- | ------------------------------------ | --------------------------------------------------------------------------------------------------- |
| POST | `/register` | Register a new user in Firebase Authentication and Firestore, saving their email and creation date. |
| POST | `/login` | Log in a user and return a custom token along with the user ID. |
| POST | `/upload` | Upload a document for summarization. If the user is logged in, the document is saved in Firestore. |
| POST | `/generate-key-ideas` | Generate key ideas from the document text. |
| POST | `/generate-discussion-points` | Generate discussion points from the document text. |
| POST | `/chat` | Chat with AI using the original document text as context. |
| POST | `/forgot-password` | Reset a user's password in Firebase Authentication. |
| POST | `/verify-email` | Verify if a user's email exists in Firestore. |
| GET | `/documents/{userId}` | Retrieve all documents associated with the given `userId`. |
| GET | `/documents/{userId}/{docId}` | Retrieve a specific document by `userId` and `docId`. |
| GET | `/document-details/{userId}/{docId}` | Retrieve document details (title, original text, summary) by `userId` and `docId`. |
| DELETE | `/delete-document/{userId}/{docId}` | Delete a specific document by `userId` and `docId`. |
| DELETE | `/delete-all-documents/{userId}` | Delete all documents associated with the given `userId`. |
| POST | `/update-email` | Update a user's email in both Firebase Authentication and Firestore. |
| POST | `/update-password` | Update a user's password in Firebase Authentication. |
| GET | `/days-since-joined/{userId}` | Get the number of days since the user associated with `userId` joined the service. |
| GET | `/document-count/{userId}` | Retrieve the number of documents associated with the given `userId`. |
| GET | `/user-email/{userId}` | Retrieve the email of a user associated with `userId`. |
| POST | `/update-document-title` | Update the title of a document in Firestore. |
| PUT | `/update-theme` | Update the theme of the app. |
| GET | `/user-joined-date/{userId}` | Get date when the user associated with `userId` joined the service. |
| GET | `/social-media/{userId}` | Get the social media links of the user associated with `userId`. |
| POST | `/update-social-media` | Update the social media links of the user associated with `userId`. |
| POST | `/update-profile` | Update the user's profile information. |
| POST | `/update-document/{userId}/{docId}` | Update the document details in Firestore. |
| POST | `/update-document-summary` | Update the summary of a document in Firestore. |
| POST | `/sentiment-analysis` | Analyzes the sentiment of the provided document text |
| POST | `/bullet-summary` | Generates a summary of the document text in bullet points |
| POST | `/summary-in-language` | Generates a summary in the specified language |
| POST | `/content-rewriting` | Rewrites or rephrases the provided document text based on a style |
| POST | `/actionable-recommendations` | Generates actionable recommendations based on the document text |More API endpoints will be added in the future to enhance the functionality of the app. Feel free to explore the existing endpoints and test them using **Postman** or **Insomnia**.
### API Documentation
- **Swagger Documentation**: You can access the Swagger documentation for all API endpoints by running the backend server and navigating to `http://localhost:5000/api-docs`.
- **Redoc Documentation**: You can access the Redoc documentation for all API endpoints by running the backend server and navigating to `http://localhost:5000/api-docs/redoc`.For example, our API endpoints documentation looks like this:
### **API Architecture**
- We use **Node.js** and **Express** to build the backend server for **DocuThinker**.
- The backend API is structured using **Express** and **Firebase Admin SDK** for user authentication and data storage.
- We use the MVC (Model-View-Controller) pattern to separate concerns and improve code organization.
- The API endpoints are designed to be RESTful and follow best practices for error handling and response formatting.
- The **Microservices Architecture** is also used to handle asynchronous tasks and improve scalability.
- The API routes are secured using Firebase authentication middleware to ensure that only authenticated users can access the endpoints.
- The API controllers handle the business logic for each route, interacting with the data models and formatting the responses.### **API Testing**
- You can test the API endpoints using **Postman** or **Insomnia**. Simply make a POST request to the desired endpoint with the required parameters.
- For example, you can test the `/upload` endpoint by sending a POST request with the document file as a form-data parameter.
- Feel free to test all the API endpoints and explore the functionalities of the app.
#### Example Request to Register a User:
```bash
curl --location --request POST 'http://localhost:3000/register' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "[email protected]",
"password": "password123"
}'
```#### Example Request to Upload a Document:
```bash
curl --location --request POST 'http://localhost:3000/upload' \
--header 'Authorization: Bearer ' \
--form 'File=@"/path/to/your/file.pdf"'
```### **Error Handling**
The backend APIs uses centralized error handling to capture and log errors. Responses for failed requests are returned with a proper status code and an error message:
```json
{
"error": "An internal error occurred",
"details": "Error details go here"
}
```π± Mobile App
The **DocuThinker** mobile app is built using **React Native** and **Expo**. It provides a mobile-friendly interface for users to upload documents, generate summaries, and chat with an AI. The mobile app integrates with the backend API to provide a seamless experience across devices.
Currently, it is in development and will be released soon on both the **App Store** and **Google Play Store**.
Stay tuned for the release of the **DocuThinker** mobile app!
Below is a screenshot of the mobile app (in development):
π¦ Containerization
The **DocuThinker** app can be containerized using **Docker** for easy deployment and scaling. Follow these steps to containerize the app:
1. Run the following command to build the Docker image:
```bash
docker compose up --build
```
2. The app will be containerized and ready to run on port 3000.You can also view the image in the **Docker Hub** repository **[here](https://hub.docker.com/repository/docker/hoangsonw/docuthinker-ai-app/)**.
π Deployment
### **Frontend Deployment (Vercel)**
1. **Install the Vercel CLI**:
```bash
npm install -g vercel
```2. **Deploy the frontend**:
```bash
vercel
```3. **Follow the instructions in your terminal to complete the deployment**.
### **Backend Deployment (Render)**
- The backend can be deployed on platforms like **Heroku**, **Render**, or **Vercel**.
- Currently, we are using **Render** to host the backend. You can access the live backend **[here](https://docuthinker-ai-app.onrender.com/)**.
### **Important Note about Backend Deployment**
- Please note that we are currently on the **Free Tier** of **Render**. This means that the backend server may take a few seconds to wake up if it has been inactive for a while.
- Therefore, the first API call may take a bit longer to respond. Subsequent calls should be faster as the server warms up. It is completely normal to take up to 2 minutes for the first API call to respond.
- Also, the **Free Tier** of **Render** only allocates **512MB and 0.1 CPU**. This may result in slower response times for API calls and document processing.
- Additionally, during high traffic periods, the server may take longer to respond, although we have employed [NGINX](#load-balancing) for load balancing and caching.
βοΈ Load Balancing & Caching
- We are using **NGINX** for load balancing and caching to improve the performance and scalability of the app.
- The **NGINX** configuration file is included in the repository for easy deployment. You can find the file in the `nginx` directory.
- Feel free to explore the **NGINX** configuration file and deploy it on your own server for load balancing and caching.
- **NGINX** can also be used for SSL termination, reverse proxying, and serving static files. More advanced configurations can be added to enhance the performance of the app.
- You can also use **Cloudflare** or **AWS CloudFront** for content delivery and caching to improve the speed and reliability of the app, but we are currently using **NGINX** for load balancing and caching due to costs and simplicity.
- We are also using **Docker** with **NGINX** to deploy the **NGINX** configuration file and run the server in a containerized environment. The server is deployed and hosted on **Render**.
- Additionally, we are using **Redis** for in-memory caching to store frequently accessed data and improve the performance of the app.
- **Redis** can be used for caching user sessions, API responses, and other data to reduce the load on the database and improve response times.
- You can set up your own **Redis** server or use a managed service like **Redis Labs** or **AWS ElastiCache** for caching.π Jenkins Integration
- We are using **Jenkins** for continuous integration and deployment. The Jenkins pipeline is set up to automatically test and deploy the app whenever changes are pushed to the main branch.
- The pipeline runs the tests, builds the app, and deploys it to **Vercel** and **Render**. Feel free to visit the pipeline at **[`Jenkinsfile`](Jenkinsfile)**.
- The pipeline is triggered automatically whenever a new commit is pushed to the main branch.
- You can set up your own Jenkins pipeline to automate testing and deployment for your projects by following these commands and steps:1. **Install Jenkins**:
```bash
brew install jenkins
```
2. **Start Jenkins**:
```bash
brew services start jenkins
```
3. **Access Jenkins**:
Open your browser and go to `http://localhost:8080` to access the Jenkins dashboard.4. **Follow the instructions to set up Jenkins and create a new pipeline**.
If successful, you should see the Jenkins pipeline running and deploying the app automatically whenever changes are pushed to the main branch. Here is an example:
π’ Kubernetes Integration
- We are using **Kubernetes** for container orchestration and scaling. The app can be deployed on a Kubernetes cluster for high availability and scalability.
- The Kubernetes configuration files are included in the repository for easy deployment. You can find the files in the `kubernetes` directory.
- Feel free to explore the Kubernetes configuration files and deploy the app on your own Kubernetes cluster.
- You can also use **Google Kubernetes Engine (GKE)**, **Amazon EKS**, or **Azure AKS** to deploy the app on a managed Kubernetes cluster.π§ Contributing
We welcome contributions from the community! Follow these steps to contribute:
1. **Fork the repository**.
2. **Create a new branch**:
```bash
git checkout -b feature/your-feature
```
3. **Commit your changes**:
```bash
git commit -m "Add your feature"
```
4. **Push the changes**:
```bash
git push origin feature/your-feature
```
5. **Submit a pull request**: Please submit a pull request from your forked repository to the main repository. I will review your changes and merge them into the main branch shortly.Thank you for contributing to **DocuThinker**! π
π License
This project is licensed under the **Creative Commons Attribution-NonCommercial License**. See the [LICENSE](LICENSE.md) file for details.
The **DocuThinker** open-source project is for educational purposes only and should not be used for commercial applications. Feel free to use it for learning and personal projects!
π Additional Documentation
- **[Alternative General Documentations](https://hoangsonww.github.io/DocuThinker-AI-App/)**
- **[Backend README](backend/README.md)**
- **[Frontend README](frontend/README.md)**
- **[Mobile App README](mobile-app/README.md)**π¨βπ» Author
- **[Son Nguyen](https://github.com/hoangsonww)** - An aspiring Software Developer & Data Scientist
- Feel free to connect with me on **[LinkedIn](https://www.linkedin.com/in/hoangsonw/)**.
- If you have any questions or feedback, please feel free to reach out to me at **[[email protected]](mailto:[email protected])**.
- Also, check out my **[portfolio](https://sonnguyenhoang.com/)** for more projects and articles.
- If you find this project helpful or you learned something from the source code, consider giving it a star βοΈ. I would greatly appreciate it! π---
**Happy Coding and Analyzing! π**
**Created with β€οΈ by [Son Nguyen](https://github.com/hoangsonww) in 2024.**
---
[π Back to Top](#docuthinker---ai-powered-document-analysis-and-summarization-app)