This project aims to provide a way to automate sending WhatsApp messages to contacts and groups using Python.
- installation
- usage
- API Documentation
- Database Backend
- Authentication
- technologies
- License Information
To get started with the Automate-WhatsApp-Messages project:
- Clone the repository to your local machine
git clone https://github.com/danaelshrbiny10/Automate-WhatsApp-Messages.git
- Create a virtual environment and activate it:
# install virtual enviroment
pip install virtualenv
# Create a virtual environment
virtualenv venv
# Activate the virtual environment
venv/source/activate
- Install the project dependencies:
pip install -r requirements.txt
python manage.py runserver
You can use this postman collection to learn more about the API usage
The API endpoints are documented using Swagger. To access the API documentation:
- Start the development server
python manage.py runserver
- Open your web browser and navigate to
http://localhost:8000/
orhttp://localhost:8000/redoc/
use PostgreSQL and update the DATABASES settings in ecommerce/settings.py
with your PostgreSQL database configuration.
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql_psycopg2",
"NAME": "Whatsapp API",
"USER": "postgres",
'PASSWORD': 'your_db_password',
"HOST": "127.0.0.1",
"PORT": "5432",
}
}
This project uses JWT (JSON Web Token) authentication for user authentication. JWT is a widely adopted standard for securing API endpoints and provides a stateless mechanism for authentication and involves the following components:
- Token-Based Authentication: Instead of traditional session-based authentication, JWT authentication relies on tokens. When a user logs in or registers, a JWT token is generated and returned to the client.
- Token Verification: On subsequent requests, the client includes the JWT token in the request headers to authenticate itself. The server verifies the token to authenticate and authorize the user.
- Token Expiration: JWT tokens have an expiration time, typically set to a short duration for security reasons. Once expired, the token is no longer valid and the client needs to obtain a new token.
To authenticate requests using JWT tokens, include the token in the request headers. The token should be included in the Authorization header using the Bearer scheme
Bearer <jwt-token>
The application is built with the following technologies:
- Django
- Django Rest Framework
- Docker
- Docker Compose
- Nginx
This project is licensed under the MIT License. For more details, see the LICENSE file.