This project is an authentication program developed using Python and MongoDB (pyMongo). It enables users to either log in to an existing account or create a new account, with all account information being stored securely in a MongoDB database.
To get a local copy up and running, follow these simple steps.
Make sure you have the following installed:
- Python 3.8+
- pyMongo
- python-dotenv
- Clone the repository
git clone https://github.com/getHamad/UserAuth-MongoDB.git
- Navigate to the project directory
cd UserAuth-MongoDB
- Create a virtual environment
python -m venv env
- Activate the virtual environment
- Windows
.\env\Scripts\activate
- MacOS
source env/bin/activate
- Windows
- Install dependencies
pip install -r requirements.txt
- Set up your .env file with the database connection string:
database_connection_string=mongodb://username:password@host:port/database
- To run the application, execute the following command:
python main.py
- Here is an example of how to use the AuthenticatorApp in your code:
from authenticator import Authenticator def main(): if Authenticator(): print('Login successful!') else: print('Login failed.') if __name__ == "__main__": main()
- Login: Allows users to log in to their existing accounts.
- Account Creation: Enables users to create new accounts, which will be recorded in the connected MongoDB database.
- Boolean Return Values: Functions such as login() and create_new_account() return a boolean indicating whether the process was successful or not. This feature makes it easy to integrate this authentication program into various scenarios and use cases.
- Secure Password Encryption (Soon..)
- Profile/Record Management (Later..)
Distributed under the MIT License. See LICENSE for more information.
Note: This project is developed by an early-stage developer, and it represents one of my initial projects. As such, it may contain bugs, errors, or unexpected behavior. While I have made efforts to ensure the functionality and reliability of the authentication process, there may still be areas that require improvement or refinement.
Use at Your Own Risk: Please be aware that using this authentication program in production environments or critical systems is not recommended without thorough testing and validation. It is advisable to evaluate the program's performance and security features before deploying it in sensitive applications.
Contributions and Feedback: I welcome contributions, suggestions, and feedback from the community to enhance and improve this project. If you encounter any issues or have ideas for enhancements, please feel free to open an issue or submit a pull request on GitHub.
Thank you for your understanding and cooperation.