Skip to content

konoh6/Privora

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

Privora

A distributed chat application with a C-based client/server and a Python (Flask) authentication system.

Lines of Code GitHub issues GitHub stars GitHub pull requests GitHub license

Directory Structure

  • client/ - C client code.
  • server/ - C server code.
  • flask_auth/ - Flask authentication system for user management.
  • include/ - Header files for the C application.
  • build/ - Compiled binaries.
  • logs/ - Log files (optional).
  • assets/ - Project assets (e.g., images, logos).
  • .gitignore - Specifies files and directories to ignore in Git.
  • README.md - This file.

How to Clone the Project

Run the following command to clone the repository:

git clone https://github.com/med1001/Privora.git
cd Privora

How to Build and Run the C Chat Application

Prerequisites

Ensure that you have GCC and Make installed. If not, install them using:

sudo apt update && sudo apt install build-essential

Before building the project, ensure that the libcurl is installed using the following command on Ubuntu-based systems:

sudo apt-get install libcurl4-openssl-dev

Building the Server & Client

  1. Navigate to the server/ directory and compile the server:
    cd server
    make  # Builds the server
  2. Navigate to the client/ directory and compile the client:
    cd ../client
    make  # Builds the client

Running the Chat Application

After building, you can run the client and server from the build/ directory in both client and server:

cd build 
./server &  # Start the server in the background
./client  # Start the client

Setting Up Flask Authentication

The Flask authentication system handles user account creation and private messaging authentication.

Prerequisites

Ensure you have Python 3.8+ installed. If not, install it using:

sudo apt install python3 python3-venv python3-pip

Setting Up the Virtual Environment

  1. Navigate to the flask_auth/ directory:
    cd flask_auth
  2. Create and activate a virtual environment:
    source venv/bin/activate  
  3. Install dependencies:
    pip install -r requirements.txt

Configuring the .env File

Before running the Flask authentication server, you need to properly set up the .env file. The .env file should contain the following environment variables:

SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587
SMTP_USERNAME=your_email@example.com
SMTP_PASSWORD=your_smtp_password
FROM_EMAIL=your_email@example.com
  • SMTP Credentials: These are necessary for sending confirmation emails and password recovery notifications.
  • Security Note: Do not push your .env file to any public repositories to protect sensitive information. Instead, add it to your .gitignore file and share it securely with your team if needed.
  • You can create a .env.example file without the sensitive values to demonstrate the expected structure of the .env file.

Running the Flask Server

Start the authentication server with:

python auth_server.py

By default, Flask runs on http://127.0.0.1:5000/.


How to Clean the C Build

To remove compiled binaries and build artifacts, run:

make clean

Run this command separately in both server/ and client/ directories if needed.


Next Steps

  • Add private chat functionality between two users.

Contributing

Feel free to contribute! Fork the repo, make your changes, and submit a pull request.


License

This project is open-source and available under the GNU General Public License v3.0.

About

a distributed chat application

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C 68.5%
  • Python 25.0%
  • Makefile 6.5%