Giter Club home page Giter Club logo

njokoth / redmangomsg Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 17 KB

Mango Messenger is a messaging application built with Node.js, Express.js, and PostgreSQL. It allows users to create accounts, log in, send messages, and view their messages. The application provides an intuitive user interface, ensuring seamless communication between users.

License: MIT License

HTML 83.77% JavaScript 16.23%
account-creation bootstrap client-server-architecture cors css database-integration express-js full-stack-application html javascript

redmangomsg's Introduction

The Mango Messenger project is a messaging application that allows users to create accounts, log in, send messages, and view their messages. The project consists of both client-side and server-side code.

Client-Side: The client-side code includes HTML, CSS, and JavaScript that create the user interface for the messaging application.

  1. Account Creation: The account creation page allows users to create an account by providing their full name, username, password, and confirming the password. The client-side JavaScript code validates the form input and sends a POST request to the server to create the account.

  2. Login: The login page provides a form where users can enter their username and password to log into their Mango Messenger account. The client-side JavaScript code sends a POST request to the server with the login credentials and displays an alert indicating the success or failure of the login attempt.

  3. Sending Messages/Viewing Messages: The content page allows users to send messages to other users and view their own messages. The user can enter the sender's username, recipient's username, and the message text in a form. The JavaScript code sends a POST request to the server to send the message and updates the message display area with the received messages. The page also includes a sign-out button to log out the user.

Server-Side: The server-side code is implemented using Node.js, Express.js, and PostgreSQL to handle the backend functionality of the messaging application.

  1. Dependencies: The server-side code requires several dependencies, including Express.js, CORS, body-parser, pg, and Pool, to handle routing, middleware, and database interactions.

  2. Express Application: An Express application is created, and the necessary middleware for handling request bodies and enabling CORS is set up.

  3. PostgreSQL Connection Pool: A PostgreSQL connection pool is created to establish a connection with the PostgreSQL database.

  4. Account Creation: A route is defined to handle the creation of user accounts. It receives a POST request with user details, validates the input, and inserts the user data into the PostgreSQL database.

  5. Login: A route is defined to handle user login. It receives a POST request with login credentials, checks the credentials against the database, and responds with the result.

  6. Sending a Message: A route is defined to handle sending messages. It receives a POST request with the sender's username, recipient's username, and message text. It validates the recipient's username and inserts the message data into the PostgreSQL database.

  7. Fetching User Messages: A route is defined to fetch user messages. It receives a GET request with the recipient's username as a query parameter and retrieves the corresponding messages from the PostgreSQL database.

  8. Server Initialization: The server is started and listens on port 3000.

The combination of the client-side and server-side code enables users to create accounts, log in, send messages, and view their messages within the Mango Messenger application.

redmangomsg's People

Contributors

njokoth avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.