Giter Site home page Giter Site logo

chat-web-application-in-jinja's Introduction

Chat Web Application in Jinja

Overview

The Chat Web Application in Jinja is a web-based platform where users can create chatrooms and communicate with each other. It utilizes Flask for the server-side application, Jinja for templating, and WebSockets for real-time communication. The application supports user authentication, friend management, and article posting with comments.

Features

  • User Authentication: Sign up, log in, and log out functionalities.
  • Chatrooms: Create and join chatrooms to communicate with friends in real-time.
  • Friend Management: Send, approve, reject, and remove friend requests.
  • Articles and Comments: Users can post articles and comments.
  • Admin Controls: Mute and unmute users, manage user roles.

Getting Started

Prerequisites

  • Python 3.x
  • SQLite (for database)
  • Node.js (for dependency management if needed)

Installation

  1. Clone the repository:

    git clone https://github.com/ap539813/Chat-Web-Application-in-Jinja
    cd Chat-Web-Application-in-Jinja
  2. Create a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install dependencies:

    pip install -r requirements.txt
  4. Generate encryption keys:

    python -c "from encryption import get_encryption_key; get_encryption_key()"
  5. Run the application:

    python app.py

File Structure

  • app.py: Contains the main Flask application and request handlers.
  • db.py: Contains the logic to interface with the SQL database.
  • encryption.py: Handles encryption key generation and management.
  • models.py: Defines SQLAlchemy models for the database.
  • socket_routes.py: Contains all the routes related to socket.io.
  • templates/: Contains Jinja templates for the web pages.
  • static/css/: Contains CSS stylesheets.
  • static/js/: Contains JavaScript files.

Running the Application

To run the application, navigate to the project directory and execute the following command:

python app.py

The application will be available at https://localhost:443.

Usage

User Authentication

  • Sign Up: Navigate to /signup and create a new account.
  • Login: Navigate to /login and enter your credentials.
  • Logout: Click the logout button in the navigation bar.

Chatrooms

  • Join Chatroom: Enter a friend’s username and click "Chat" to join a room.
  • Send Message: Type a message and press "Enter" or click "Send".

Friend Management

  • Send Friend Request: Enter a username and click "Send Friend Request".
  • Approve/Reject Requests: Manage incoming friend requests from the Friend Requests section.

Articles and Comments

  • Post Article: Navigate to the Articles section and submit a new article.
  • Comment: Add comments to articles.

Dependencies

  • Flask
  • Flask-SocketIO
  • SQLAlchemy
  • cryptography
  • Jinja2

Check requirements.txt for the full list of dependencies.

Contributing

  1. Fork the repository.
  2. Create your feature branch (git checkout -b feature/fooBar).
  3. Commit your changes (git commit -am 'Add some fooBar').
  4. Push to the branch (git push origin feature/fooBar).
  5. Create a new Pull Request.

chat-web-application-in-jinja's People

Contributors

ap539813 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.