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.
- 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.
- Python 3.x
- SQLite (for database)
- Node.js (for dependency management if needed)
-
Clone the repository:
git clone https://github.com/ap539813/Chat-Web-Application-in-Jinja cd Chat-Web-Application-in-Jinja
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Generate encryption keys:
python -c "from encryption import get_encryption_key; get_encryption_key()"
-
Run the application:
python app.py
- 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.
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
.
- 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.
- 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".
- Send Friend Request: Enter a username and click "Send Friend Request".
- Approve/Reject Requests: Manage incoming friend requests from the Friend Requests section.
- Post Article: Navigate to the Articles section and submit a new article.
- Comment: Add comments to articles.
- Flask
- Flask-SocketIO
- SQLAlchemy
- cryptography
- Jinja2
Check requirements.txt
for the full list of dependencies.
- Fork the repository.
- Create your feature branch (
git checkout -b feature/fooBar
). - Commit your changes (
git commit -am 'Add some fooBar'
). - Push to the branch (
git push origin feature/fooBar
). - Create a new Pull Request.