Certainly! Below is the revised version of the prompt, tailored to use Python for the backend instead of Node.js, and it integrates the necessary features you described:
Prompt for Full-Stack Web Application Development with Python Backend
Create a fully functional web-based platform using Python for the backend. The project should include a front-end, backend, database, and an integrated AI chatbot with a comprehensive training model. Each section should be fully functional and aligned with the described features.
Technology Stack
- Frontend: React.js with Tailwind CSS for responsive design and a user-friendly interface.
- Backend: Python with Flask or Django as the web framework to build the RESTful API and handle application logic.
- Database: MongoDB (or PostgreSQL) for scalable storage of admin, user, subscription, and chat data.
- Authentication: JWT (JSON Web Tokens) for secure user and admin authentication.
- Chatbot: GPT-based chatbot integrated with OpenAI API for question-answering functionality.
- Hosting & Deployment: Use AWS, Heroku, or DigitalOcean for hosting the application and ensuring scalability.
- Bot Training Model: Use uploaded documents (PDFs) for training the chatbot using fine-tuned GPT responses.
Required Functionalities
1. Super Admin Panel
- Dashboard:
- Display total admins (active/inactive), total end users, total subscriptions, and graphical representations of monthly income with date range selection.
- Show lists of recently joined organizations and recent payment transactions.
- Organization Management:
- List organizations with owner name, email ID, organization name, number of employees, subscription type, and status (active, inactive, restricted).
- Allow editing, deleting, and adding new organizations. Include a search bar for quick access.
- Organization Details:
- Show organization details like name, contact information, status, plan expiry date, number of employees, and uploaded documents.
- End User Management:
- List users with details like name, email, organization name, and status. Provide search functionality for easy access.
- Purchase Management:
- List subscriptions with owner name, type, billing cycle, amount, next payment, and status.
- Allow creation, updating, assigning, and managing subscription plans.
- Settings:
- Include configuration options for system settings.
2. Admin (Owner) Panel
- User Authentication:
- Allow admins to sign up, log in, and recover forgotten passwords.
- Dashboard:
- Show total users (restricted, active, inactive), total bot answers (liked, disliked, failed), PDFs uploaded, QnA generated, and recently joined users.
- Chat History:
- Display chat sessions with filters for failed, liked, and disliked answers. Include a search bar and export option.
- Edited Questions:
- Show a list of all edited questions with edit count, last updated date, and editor. Provide re-edit and delete options, search functionality, and date range filters.
- Upload Training Documents:
- Allow document uploads in various formats, set document privacy (protected/public), preview and download documents, and delete documents as needed.
- User Management:
- Add new users, display user details (name, email, role, status), and edit user profiles.
- Allow deleting users and updating roles and passwords.
- Manage Subscription:
- Show current subscription details, billing history, and allow admins to update, cancel, or change subscription plans.
3. End User Panel
- Chat Interaction:
- Provide a chatbot for users to send messages, start conversations using prompt starters, view chat history, and clear chat sessions.
- FAQ:
- Include frequently asked questions for quick reference.
- Settings:
- Allow users to update their name, contact number, email, profile picture, and password.
Development Requirements
Frontend Features:
- Develop a responsive, user-friendly interface with React.js and Tailwind CSS.
- Implement role-based navigation (Super Admin, Admin, and End User).
- Ensure dynamic updates for dashboards and lists using API calls.
Backend Features:
- Flask/Django Backend:
- Set up RESTful APIs to handle CRUD operations for users, subscriptions, documents, chat history, and more.
- Implement JWT authentication for user and admin login.
- Use Flask or Django views to manage the application logic and connect the frontend with the database.
- Integrate OpenAI’s GPT-based model for the chatbot, handling chat responses, document parsing, and fine-tuning.
- Bot Training Model:
- Use document uploads (PDFs, DOCs) for training the chatbot dynamically. Process the text data from documents, and feed it to the GPT model for contextual training.
- Implement a custom API endpoint for document uploads and bot fine-tuning.
- Store relevant metadata like document name, privacy setting, and user organization in the database.
- Subscription and Payment Integration:
- Implement subscription management and integrate payment systems (e.g., Stripe or PayPal) for processing payments.
- Manage different subscription tiers and restrict access based on payment status.
Database Schema:
- Users: Name, email, contact, role, status, password.
- Organizations: Name, owner details, employee count, contact info, and subscription details.
- Subscriptions: Type, owner, billing cycle, amount, and status.
- Documents: Name, format, privacy settings, associated organization, and training status.
- Chat History: User ID, chat session data, question-answer pairs, timestamps.
Testing & Security:
- Use Pytest or unittest for unit and integration tests.
- Ensure proper input validation and error handling.
- Use HTTPS and JWT for secure data transmission and user authentication.
- Ensure the backend is scalable, secure, and optimized for performance.
Deployment:
- Deploy the backend using AWS (EC2, Lambda, or Lightsail) or Heroku for simplicity.
- Use a CI/CD pipeline for smooth updates and maintenance.
- Host the frontend on Vercel or Netlify for optimal performance.
This updated prompt ensures that your backend is developed using Python, leveraging Flask or Django, with seamless integration of the chatbot, document management, and subscription systems.