Skip to content

Latest commit

 

History

History
83 lines (49 loc) · 5.93 KB

README.md

File metadata and controls

83 lines (49 loc) · 5.93 KB


NODE
Hatchat MVC Server

The Hatchat MVC server was created to support the Hatchat applications. Developed as a project for the Advanced Programming 2 course at Bar-Ilan University.

DescriptionImplementationInstalling And ExecutingAuthors

Description

The Hatchat MVC server serves as the robust foundation of our application, contains the Hatchat Mobile app (Android) and the Hatchat Web app , handling the backend logic and facilitating seamless communication with the database. It harnesses cutting-edge technologies and frameworks to ensure efficient and secure operation.

Implementation

At the core of our server lies Node.js, a powerful JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js enables us to develop scalable and high-performance server-side applications. Leveraging the flexibility and versatility of Node.js, our server delivers fast and reliable responses to client requests.

To streamline the development process and enhance the functionality of our server, we employ Express.js as the web application framework. Express.js simplifies the handling of HTTP requests and enables us to set up intuitive API routes effortlessly. With its lightweight and minimalist design, Express.js allows us to build robust and modular applications.

Socket

Real-time communication is a fundamental aspect of our application, and we achieve this by integrating Socket.IO into our server. Socket.IO enables bidirectional communication between the server and clients, empowering us to deliver real-time updates and notifications to our users. This technology facilitates seamless chat experiences, ensuring instant message delivery and synchronization across devices.

Socket

Ensuring efficient data storage and retrieval, our server connects to a MongoDB database. MongoDB, a powerful NoSQL database, provides flexibility and scalability, making it an ideal choice for our application. To simplify our interaction with the database, we utilize Mongoose as an Object Data Modeling (ODM) library. Mongoose offers a user-friendly and intuitive interface, allowing us to define and manipulate data schemas effortlessly.

ReactAPPMONGOGIT

Additionally, our server extends its capabilities by supporting Firebase services for communication with The Hatchat Android app. By leveraging Firebase, we can efficiently identify the type of device making a new message request. This information enables us to send messages using the appropriate service, utilizing Firebase for Android devices and Socket.IO for the web app. This seamless integration ensures a consistent and optimized user experience across different platforms.

serverWeb

Architecturally, our server follows the Model-View-Controller (MVC) design pattern. This pattern enhances code organization and separation of concerns, enabling easier maintenance and extensibility. The express module helps us structure our server-side code, allowing us to create an instance of the Express app to handle incoming HTTP requests effectively.

To facilitate communication between different components of our application, the server establishes a Socket.IO connection, enabling real-time communication with the Hatchat web app. This integration ensures smooth and responsive interactions, enhancing the user experience.

serverAndroid

Furthermore, we establish API routes for users, tokens, and chats using dedicated routers (users, authenticator, and chat). These routes streamline the flow of data and operations within our application, ensuring secure and efficient communication between the client and server.

To enable cross-origin resource sharing (CORS), our server incorporates CORS support, allowing requests from specified origins. This configuration ensures that our application can communicate with external resources securely and efficiently, while maintaining strict access control.

With meticulous implementation and integration of these technologies and frameworks, our MVC Hatchat server stands as a reliable and scalable solution, empowering our application to deliver an immersive and engaging chat experience to our users.

Installing And Executing

To clone and run the server, you'll need Git installed on your computer. From your command line:

# Clone this repository.
$ git clone https://github.com/TalMizrahii/MVC-HatChat-Server

# Go into the repository.
$ cd MVC-HatChat-Server
  
# Go into the project folder.
$ cd hatchat_server
  
# Install the needed libraries.
$ npm install
  
# Start the program.
$ npm start

Authors