Lowkey is a real-time chat application built using Node.js and WebSockets. Developed as part of my 2019 final year project, it allows users to engage in live conversations via a responsive and lightweight interface. The application requires a database service running on a separate port for proper data handling.
- Real-time messaging with WebSockets
- Secure password hashing
- Event-driven communication
- Simple and easy-to-use interface
Ensure you have the following installed:
- Node.js – Core framework for backend development
- Nodemon – Automatically restarts the server on file changes
- A running MySQL database instance
Ensure Node.js is installed by running:
node -vFollow these steps to set up the project locally:
-
Clone the Repository:
git clone <repository-link> cd lowkey
-
Install Dependencies:
npm install
-
Set Environment Variables:
Copy the
.env.examplefile and rename it to.env:cp .env.example .env
Update the
.envfile with your configuration. Here’s an example configuration:# Database Configuration MYSQL_HOST = 'localhost' MYSQL_USER = 'root' MYSQL_PASSWORD = 'password' MYSQL_DATABASE = 'lowkey-db' MYSQL_CONNECTION_LIMIT = 100 MYSQL_MULTISTATEMENTS = true # Authentication Keys AUTH_SALT = 10 AUTH_SECRET_KEY = 'abcdefghijklmnopqrstuvwxyz' # Mailer Authentication MAILER_SERVICE = 'gmail' MAILER_AUTH_USER = '[email protected]' MAILER_AUTH_PASS = 'password'
Ensure the MySQL database is running and accessible with the credentials you provide.
-
Start the Database:
Make sure your MySQL database is running with the necessary configurations as set in your
.envfile. -
Start the Application:
Use the following command to start the application:
npm run dev
This will launch the application on
http://localhost:3000using Nodemon, which automatically restarts the server when file changes are detected.
- Node.js – Backend server
- ExpressJS – Web application framework
- BCryptJS – Password hashing
- Socket.io – Real-time communication
- Morgan – HTTP request logging
- DotEnv – Environment variable management
Once the application is running, visit http://localhost:3000 to start interacting with the chat interface. You can open multiple browser windows or devices to simulate multiple users.
- Database connection issues: Ensure MySQL is running with the correct host and credentials as specified in the
.envfile. - Server errors: Check logs for detailed error messages and review your environment variable setup.
- Improve the front-end for a more user-friendly experience
- Implement OAuth or JWT-based authentication for more secure user sessions