Node CLI chat App

August 18, 2023


I recently embarked on a journey to develop a Node CLI chat application. This endeavor was primarily motivated by my intention to get acquainted with JavaScript's intricacies and the foundational mechanics of the web. For this project,

I relied heavily on socket.io, a renowned npm package known for enabling real-time bidirectional communication. It seamlessly catered to both the server and client facets of the application. In tandem, the express framework proved instrumental in setting up the server environment, ensuring a smooth development process.

One of the pivotal decisions during this development was to sidestep data persistence. The goal was to center the project around fundamental learning, without the complexities of database integration. However, every project has its set of challenges. Utilizing the readline package to capture user input introduced some unanticipated user interface hiccups, slightly hampering the chat flow's fluidity.

To navigate through the development and ensure a structured approach, I leaned on ChatGPT for guidance. This tool was invaluable in streamlining the coding process. In retrospect, while the application was basic and had its fair share of hurdles, it fulfilled its main objective: providing a hands-on introduction to JavaScript and core web functionalities.

If you want this project running locally,

git clone https://github.com/vpgits/node-cli-chat.git

As usual this is me being lazy, the post is AI generated.

On a more serious note, use AI more often... (here's the project structure i got from ChatGPT)

chat-cli-app/

├── client/ # Client-related code and assets
│ ├── src/ # Source files for the client
│ │ ├── index.js # Main entry point for the client
│ │ └── ... # Other client-related utilities and modules
│ └── package.json # Dependencies and scripts specific to the client

├── server/ # Server-related code and assets
│ ├── src/ # Source files for the server
│ │ ├── index.js # Main entry point for the server
│ │ ├── routes/ # (Optional) Route handlers if using Express.js or similar
│ │ └── ... # Other server-related utilities and modules (e.g., database setup)
│ ├── package.json # Dependencies and scripts specific to the server
│ └── .env # (Optional) Environment variables (ensure this is in .gitignore)

├── node_modules/ # Node.js modules (should be ignored in .gitignore)

├── .gitignore # Git ignore file to exclude files/directories from Git
├── README.md # Project documentation and instructions
└── package.json # Root package file, primarily for project-wide configurations or scripts