Skip to content

GeoChat is a simple, anonymous, real-time web chat application that connects users based on their geographic location. It's built with PHP, MySQL, and vanilla JavaScript, making it easy to deploy on standard web hosting.

Notifications You must be signed in to change notification settings

ricvale/geochat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GeoChat - Real-Time Location-Based Chat

GeoChat is a simple, anonymous, real-time web chat application that connects users based on their geographic location. It's built with PHP, MySQL, and vanilla JavaScript, making it easy to deploy on standard web hosting.

Screenshot

GeoChat

Features

  • Anonymous Chat: No registration required. Just pick a temporary username and start chatting.
  • Location-Based: See and chat with other users within a configurable radius (1-50 km).
  • Real-Time Communication: Uses Server-Sent Events (SSE) for instant message and user list updates.
  • Private Messaging: Click on a user to start a one-on-one private conversation.
  • Interactive Map: View nearby users on an interactive map powered by Leaflet.js and OpenStreetMap.
  • Image Sharing: Share images directly in the chat.
  • Typing Indicators: See when another user is typing a message.
  • Light & Dark Mode: Automatic theme detection with a manual toggle.

Tech Stack

  • Backend: PHP 8+
  • Database: MySQL
  • Frontend: HTML5, CSS3, Vanilla JavaScript (ES6+)
  • Real-Time: Server-Sent Events (SSE)
  • Mapping: Leaflet.js with OpenStreetMap

Getting Started

Follow these instructions to get a copy of the project up and running on your local machine.

Prerequisites

  • A web server environment (e.g., Apache or Nginx) or a local development stack like XAMPP, MAMP, etc.
  • PHP 8.2 or higher with the PDO MySQL extension enabled.
  • MySQL 8.0 or MariaDB 10.11+.

Run with Docker (Recommended)

The easiest way to run GeoChat is using Docker. This will automatically set up PHP, MySQL, and phpMyAdmin.

  1. Clone the repository:

    git clone https://github.com/ricvale/geochat.git
    cd geochat
  2. Start the application:

    docker compose up -d --build
  3. Access the app:

Note: The database is automatically initialized and configured on the first run.

Manual Installation

Follow these instructions if you prefer to set up the project manually on a local server like XAMPP, MAMP, etc.

  1. Clone the repository:

    git clone https://github.com/ricvale/geochat.git
    cd geochat
  2. Create the database:

    • Create a new database named geo_chat.
    • Import the schema from includes/database.sql.
  3. Configure the application:

    • Copy includes/config.example.php to includes/config.php.
    • Update the database credentials to match your local environment.
  4. Set up the web server:

    • Point your web server's document root to the project directory.
    • Open the application in your browser.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

GeoChat is a simple, anonymous, real-time web chat application that connects users based on their geographic location. It's built with PHP, MySQL, and vanilla JavaScript, making it easy to deploy on standard web hosting.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published