Welcome to the Authentication project! This Django REST Framework project offers a comprehensive set of features for user authentication, user profiles, and security measures. It empowers users to handle account creation, email verification, signin, password reset, and manage their profiles efficiently. Moreover, the project integrates various security options to ensure data integrity and user authentication.
- Signup: Enables users to register new accounts securely. ✅
- Email Verification: Verifies the authenticity of user emails to enhance security. ✅
- Signin: Provides a secure login mechanism for registered users. ✅
- Password Reset: Offers a secure process for users to reset their passwords. ✅
- Social Media Authentication: Allows users to authenticate using their social media accounts.
- Profile Image: Allows users to upload and update their profile images effortlessly. ✅
- Bio: Enables users to add, modify, or delete their biography information. ✅
- Username: Provides the flexibility for users to change their usernames as needed. ✅
- Remove Full Account: Users can remove all their data from the database from their account.
- Attribute-based Authorization: Controls access to resources based on user attributes. ✅
- Django-cryptography: Utilizes cryptographic functionalities to ensure data security.
- Django-honeypot: Implements honeypot techniques for threat detection and mitigation.
- Input Validation and Output Encoding: Protects against common web vulnerabilities by validating user inputs and encoding outputs securely.
- Multi-factor Authentication: Enhances security by requiring users to authenticate through multiple methods.
Before starting the project, ensure PostgreSQL is installed on your system. You can follow the instructions below to set up PostgreSQL and create a database:
Arch Linux:
sudo pacman -S postgresql
Debian Linux:
sudo apt-get install postgresql
Start and enable PostgreSQL:
sudo systemctl start postgresql
sudo systemctl enable postgresql
To create a database user and password in PostgreSQL, follow these steps:
- Log in to the PostgreSQL database server with the
postgres
user: - Create a new database user with a password. Replace
<username>
with the desired username and<password>
with the desired password: - Grant the user privileges on the database. Replace
<database>
with the name of your database and<username>
with the username you just created: - Exit the PostgreSQL prompt:
sudo -u postgres psql
CREATE USER <username> WITH PASSWORD '<password>';
GRANT ALL PRIVILEGES ON DATABASE <database> TO <username>;
\q
Here's an example:
sudo -u postgres psql
CREATE USER myuser WITH PASSWORD 'mypassword';
GRANT ALL PRIVILEGES ON DATABASE authenticat TO myuser;
\q
Replace myuser
with your desired username and mypassword
with your desired password. Also, replace authenticat
with the name of your database.
You can download and install PostgreSQL from the official website: PostgreSQL Official Website.
Before installing Kafka on your Linux system, you need to install Java, specifically JDK. You can use the following commands to install JDK on your Linux distribution:
For Arch Linux:
sudo pacman -S jdk-openjdk
For Debian Linux:
sudo apt install openjdk-17-jdk
After installing Java, you can verify the installation by running:
java --version
In the next step, you should install Kafka. You can download your desired version from this link and then configure it for your project:
Extract:
tar -xzf kafka_2.13–3.5.0.tgz
cd kafka_2.13–3.5.0
Start:
- Generate a Cluster UUID:
KAFKA_CLUSTER_ID="$(bin/kafka-storage.sh random-uuid)"
- Format Log Directories:
bin/kafka-storage.sh format -t $KAFKA_CLUSTER_ID -c config/kraft/server.properties
- Start the Kafka Server:
bin/kafka-server-start.sh config/kraft/server.properties
- Create a topic:
bin/kafka-console-consumer.sh --topic topic_user_created --bootstrap-server localhost:9092 --from-beginning
To configure the email app password, please follow the instructions provided by Google at the following link: Google Support.
After configuring the database and email app password, you can proceed with migrations and running the server:
Run migrations:
python manage.py makemigrations
python manage.py migrate
Run the server:
python manage.py runserver
The project includes a Dockerfile, facilitating the deployment of the application within Docker containers. This simplifies the deployment process and ensures consistent behavior across various environments.
Before running the application with Docker, ensure that Docker and docker-compose are installed on your system. If not, you can install them by following the official documentation.
To start Docker, use the following commands:
sudo systemctl start docker
sudo systemctl enable docker
after install Docker and Run docker on your ststem, move in project directory and up docker-compose file:
sudo docker-compose up
To connect to the frontend, you can follow these steps:
- Clone the Frontend Repository:
- Guidance for Setting Up the Frontend:
- Startup Project:
You can clone the frontend from the Vue.js_authentication repository.
Refer to the instructions provided in the frontend repository to set up and configure the frontend application.
Once the frontend is set up and configured, you can integrate it with the backend authentication project and start both projects simultaneously.
Thank you for choosing the Authentication project! Should you have any inquiries or require further assistance, please do not hesitate to contact us. We're committed to providing support and ensuring your experience with our project is smooth and successful.