An advanced NLP-based chatbot developed using Flask, integrated with a MySQL database, and enhanced with encryption for data security.
- The main server is set up using Flask.
- Configuration is managed through environment variables from
values.env
.
- User details are stored securely in a MySQL database.
- Passwords are hashed using
bcrypt
before storage, ensuring data security. - Functions to insert users and retrieve users by username are encapsulated in
controllers.py
.
- Utilizes SQLAlchemy for Object-Relational Mapping (ORM).
- The
User
model is defined with attributes such asusername
,name
,email
,card_number
, andpassword
. - Database connection and CRUD operations are managed in
database.py
.
- Employs the
cryptography
library for robust encryption and decryption mechanisms. - Public and private keys (
public_key.pem
andprivate_key.pem
) are utilized for these operations. - Functions for encryption and decryption are housed in
security.py
.
- Clone the Repository:
git clone https://github.com/Nik-code/nlp-chatbot.git cd nlp-chatbot
- Dependencies: Install the required Python packages:
pip install -r requirements.txt
- Environment Variables: Ensure your values.env file is set up with the necessary configurations:
- SECRET_KEY: Secret key for Flask.
- DB_HOST: Database host.
- DB_USER: Database user.
- DB_PASSWORD: Database password.
- DB_NAME: Database name.
Start the Flask server using the following command:
python main.py
By default, the server will run on port 6000. Navigate to http://localhost:6000 in your browser to access the chatbot.
The project relies on several Python packages for its functionality. Some of the primary dependencies include:
- Flask
- bcrypt
- cryptography
- SQLAlchemy
... and many more. Refer to
requirements.txt
for the complete list.
Contributions are always welcome! Please fork the repository and submit a pull request with your changes.
This project is open-source and available under the MIT License.