NexTalk is a modern, real-time chat application built with PHP and JavaScript, featuring a sleek "glassmorphism" UI and powerful communication features. It delivers instant messaging capabilities, AI-powered assistance, and community management tools.
- Real-Time Communication: Seamless live chat experience using Server-Sent Events (SSE) for instant message delivery without manual refreshing.
- AI-Powered Assistance (Google Gemini):
- Smart Replies: Context-aware, one-click smart reply suggestions to incoming messages.
- Instant Translation: On-the-fly message translation across multiple languages.
- Communities & Group Chats: Create public or private rooms, manage participants, and organize conversations.
- Role-Based Access Control (RBAC): Flexible user roles (
User,Moderator,Admin) to manage permissions, moderate messages, and oversee communities. - Interactive Polls: Create and vote on polls directly within chat rooms.
- Modern User Interface: Premium, responsive glassmorphism aesthetic with engaging micro-animations and intuitive navigation.
- Secure Authentication: Robust user registration and login system.
- Frontend: HTML5, Vanilla CSS (Custom Design System), Vanilla JavaScript
- Backend: PHP 8+ (PDO for secure database interactions)
- Database: MySQL
- Real-Time Engine: Server-Sent Events (SSE) & Fetch API
- AI Integration: Google Gemini API
NexTalk/
├── api/ # Backend API endpoints (PHP)
│ ├── chat/ # Chat-specific endpoints (messages, polls, SSE, AI)
│ ├── check_auth.php # Session validation
│ ├── db.php # Database connection configuration
│ ├── login.php # Authentication handling
│ ├── register.php # User registration
│ ├── roles.php # Role & permission definitions
│ └── setup.php # Initial setup scripts
├── database/ # SQL schema definitions
│ └── nextalk_full.sql # Complete database structure
├── html_pages/ # Frontend views and assets
│ ├── auth.html # Login/Registration UI
│ ├── dashboard.html # Main chat interface
│ ├── index.html # Landing page
│ ├── dashboard.js # Frontend logic & API integration
│ └── style.css # Styling and design system
├── uploads/ # User-uploaded media
└── .env # Environment variables (API keys)
Follow these steps to run NexTalk locally on your machine.
- A local web server stack like XAMPP, WAMP, or MAMP.
- PHP 8.0 or higher.
- MySQL / MariaDB.
- A Google Gemini API Key to enable AI features.
-
Clone the repository into your local web server's document root (e.g.,
C:\xampp\htdocs\for XAMPP):git clone https://github.com/MuhammadAnas4774/NexTalk.git cd NexTalk -
Database Setup:
- Open phpMyAdmin or your preferred MySQL client.
- Create a new database named
nextalk. - Import the
database/nextalk_full.sqlfile into the newly created database to set up the tables.
-
Configure Database Connection:
- Open
api/db.php. - Ensure the database credentials match your local setup (default XAMPP credentials usually work: User
root, empty password).
- Open
-
Environment Variables (.env):
- Create a file named
.envin the root directory of the project. - Add your Gemini API key:
GEMINI_API_KEY="your_api_key_here" GEMINI_MODEL="gemini-1.5-flash"
- Create a file named
- Start your Apache and MySQL services.
- Navigate to
http://localhost/NexTalk/html_pages/index.htmlin your web browser. - Create an account, log in, and start chatting!