Lingo/README.md
A real-time chatting webapp built with Next.js (frontend) and Node.js with Socket.IO (backend).
lingo/
├── server.js # Backend server (Node.js + Express + Socket.IO + Supabase)
├── package.json # Dependencies and scripts
├── .env # Environment variables (Supabase credentials)
├── next.config.js # Next.js configuration
├── tailwind.config.js # TailwindCSS configuration
├── postcss.config.js # PostCSS configuration
├── requirements.txt # Python dependencies for translation service
├── sarvam_translate.py # Python script for Sarvam-Translate model
├── translationService.js # Node.js translation service wrapper
├── test_final_translation.js # Translation testing script
├── components/
│ └── VirtualKeyboard.js # Virtual keyboard component for regional languages
├── styles/
│ ├── globals.css # Global styles and TailwindCSS imports
│ └── virtual-keyboard.css # Virtual keyboard specific styles
├── pages/
│ ├── _app.js # Main app component with routing logic
│ ├── _document.js # HTML document structure
│ ├── index.js # Login page
│ ├── users.js # Online users list page
│ └── chat/
│ └── [id].js # Individual chat page
├── DATABASE.md # Database schema documentation
├── AGENTS.md # AI agents documentation
├── SARVAM_TRANSLATE_SETUP.md # Translation setup guide
└── README.md # This file
Clone the repository
git clone <repository-url>
cd lingo
Create and Activate a Virtual Environment
Create a virtual environment for the Python translation service:
python -m venv venv
Activate the virtual environment:
source venv/bin/activate
venv\Scripts\activate
Install Python Dependencies
With the virtual environment activated, install the required Python packages:
pip install -r requirements.txt
Test the Translation Handler
Test the Sarvam-Translate handler using the following command:
python sarvam_translate.py --text "സുഗ് ആൻ " --target-language "hi-IN" --source-language "ml-IN"
Replace the sample text and language codes as needed.
Install Node.js Dependencies
In a separate terminal (or after testing Python), install the Node.js packages:
npm install
Set up Supabase
.env file with your credentials:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
PORT=5000
Set up the Database
DATABASE.md to create the required tablesConfigure Translation Service (Optional)
usePythonScript = true in translationService.jsSARVAM_TRANSLATE_SETUP.md for detailed setup instructionsStart the Development Servers
In the project root, run:
npm run dev
This command will start both:
http://localhost:5000http://localhost:3000npm run server
npm run client
Open your browser and navigate to http://localhost:3000.
Login: Enter a username (minimum 3 characters) and click "Start Chatting".
View Online Users: You'll be redirected to the users page showing all online users.
Start Chatting: Click on any user to start a private conversation.
Use Translation: Select source and target languages to enable real-time translation.
Virtual Keyboard: Use the on-screen keyboard for typing in regional languages.
Test Multi-User: Open the app in multiple browser tabs with different usernames to test real-time messaging.
http://localhost:5000)GET /health - Server health checkuser_login - User login with usernameprivate_message - Send private messagetyping_start - Start typing indicatortyping_stop - Stop typing indicatortranslate_message - Request message translationset_language_preference - Set user's language preferencelogin_success - Login successfullogin_error - Login failedusers_list_update - Updated list of online usersuser_joined - New user joineduser_left - User leftprivate_message - Receive private messagemessage_sent - Message sent confirmationtyping_start - User started typingtyping_stop - User stopped typingtranslation_result - Translation responsesupported_languages - List of supported languagesLingo/README.md
A real-time chatting webapp built with Next.js (frontend) and Node.js with Socket.IO (backend).
lingo/
├── server.js # Backend server (Node.js + Express + Socket.IO + Supabase)
├── package.json # Dependencies and scripts
├── .env # Environment variables (Supabase credentials)
├── next.config.js # Next.js configuration
├── tailwind.config.js # TailwindCSS configuration
├── postcss.config.js # PostCSS configuration
├── requirements.txt # Python dependencies for translation service
├── sarvam_translate.py # Python script for Sarvam-Translate model
├── translationService.js # Node.js translation service wrapper
├── test_final_translation.js # Translation testing script
├── components/
│ └── VirtualKeyboard.js # Virtual keyboard component for regional languages
├── styles/
│ ├── globals.css # Global styles and TailwindCSS imports
│ └── virtual-keyboard.css # Virtual keyboard specific styles
├── pages/
│ ├── _app.js # Main app component with routing logic
│ ├── _document.js # HTML document structure
│ ├── index.js # Login page
│ ├── users.js # Online users list page
│ └── chat/
│ └── [id].js # Individual chat page
├── DATABASE.md # Database schema documentation
├── AGENTS.md # AI agents documentation
├── SARVAM_TRANSLATE_SETUP.md # Translation setup guide
└── README.md # This file
Clone the repository
git clone <repository-url>
cd lingo
Create and Activate a Virtual Environment
Create a virtual environment for the Python translation service:
python -m venv venv
Activate the virtual environment:
source venv/bin/activate
venv\Scripts\activate
Install Python Dependencies
With the virtual environment activated, install the required Python packages:
pip install -r requirements.txt
Test the Translation Handler
Test the Sarvam-Translate handler using the following command:
python sarvam_translate.py --text "സുഗ് ആൻ " --target-language "hi-IN" --source-language "ml-IN"
Replace the sample text and language codes as needed.
Install Node.js Dependencies
In a separate terminal (or after testing Python), install the Node.js packages:
npm install
Set up Supabase
.env file with your credentials:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
PORT=5000
Set up the Database
DATABASE.md to create the required tablesConfigure Translation Service (Optional)
usePythonScript = true in translationService.jsSARVAM_TRANSLATE_SETUP.md for detailed setup instructionsStart the Development Servers
In the project root, run:
npm run dev
This command will start both:
http://localhost:5000http://localhost:3000npm run server
npm run client
Open your browser and navigate to http://localhost:3000.
Login: Enter a username (minimum 3 characters) and click "Start Chatting".
View Online Users: You'll be redirected to the users page showing all online users.
Start Chatting: Click on any user to start a private conversation.
Use Translation: Select source and target languages to enable real-time translation.
Virtual Keyboard: Use the on-screen keyboard for typing in regional languages.
Test Multi-User: Open the app in multiple browser tabs with different usernames to test real-time messaging.
http://localhost:5000)GET /health - Server health checkuser_login - User login with usernameprivate_message - Send private messagetyping_start - Start typing indicatortyping_stop - Stop typing indicatortranslate_message - Request message translationset_language_preference - Set user's language preferencelogin_success - Login successfullogin_error - Login failedusers_list_update - Updated list of online usersuser_joined - New user joineduser_left - User leftprivate_message - Receive private messagemessage_sent - Message sent confirmationtyping_start - User started typingtyping_stop - User stopped typingtranslation_result - Translation responsesupported_languages - List of supported languages