A distributed chat application with a C-based client/server and a Python (Flask) authentication system.
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.
Run the following command to clone the repository:
git clone https://github.com/med1001/Privora.git
cd Privora
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
- Navigate to the
server/
directory and compile the server:cd server make # Builds the server
- Navigate to the
client/
directory and compile the client:cd ../client make # Builds the client
After building, you can run the client and server from the build/
directory in both client and server:
cd build # cd to the server build repo (Privora/server/build)
./server & # Start the server in the background
./client # Start the client # after cd to the client build repo (Privora/client/build)
The Flask authentication system handles user account creation and private messaging authentication.
Ensure you have Python 3.8+ installed. If not, install it using:
sudo apt install python3 python3-venv python3-pip
- Navigate to the
flask_auth/
directory:cd flask_auth
- Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
Before running the Flask authentication server, you need to properly set up the .env
file. This file contains important environment variables required for the application to work, such as SMTP credentials for sending confirmation emails.
-
Locate the
.env.example
File: In thePrivora/flask_auth
directory, there is a hidden file named.env.example
. This file contains an example structure for the.env
file, but without sensitive values. -
Create the
.env
File: Copy.env.example
to create your actual.env
file:cp .env.example .env
-
Edit the
.env
File: Open the.env
file and replace the placeholder values with your actual SMTP credentials. The required environment variables are:SMTP_SERVER=smtp.gmail.com SMTP_PORT=587 [email protected] SMTP_PASSWORD=your_smtp_password [email protected]
- SMTP_SERVER: The address of your SMTP server (e.g.,
smtp.gmail.com
for Gmail). - SMTP_PORT: The port to use for the SMTP connection (e.g.,
587
for Gmail). - SMTP_USERNAME: Your email address used to send emails.
- SMTP_PASSWORD: Your SMTP password (or App Password if using Gmail with two-factor authentication).
- FROM_EMAIL: The email address to appear as the sender for confirmation and recovery emails.
- SMTP_SERVER: The address of your SMTP server (e.g.,
-
Security Note:
- Do not push the
.env
file to public repositories to protect sensitive information like your SMTP credentials. - Make sure that the
.env
file is added to your.gitignore
file to prevent accidental commits:.env
- Do not push the
Start the authentication server with:
python auth_server.py
By default, Flask runs on http://127.0.0.1:5000/
.
To remove compiled binaries and build artifacts, run:
make clean
Run this command separately in both server/
and client/
directories if needed.
- Add private chat functionality between two users.
Feel free to contribute! Fork the repo, make your changes, and submit a pull request.
This project is open-source and available under the GNU General Public License v3.0.