This is a Flask-based web application that helps you manage and send birthday messages to friends via Instagram. This project demonstrates basic CRUD operations with SQLAlchemy for managing friends and integrates with the Instagram API (via instagrapi) to send birthday messages.
- Add friends with their username and birthday.
- View the list of friends with their birthdays.
- Send birthday messages to friends via Instagram.
- Basic error handling for adding friends and sending messages.
To run this project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/your-username/friend-birthday-reminder.git cd friend-birthday-reminder
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
Create a
.env
file in the root directory with the following content:FLASK_APP=app.py FLASK_ENV=development SECRET_KEY=your_secret_key_here INSTAGRAM_USERNAME=your_instagram_username INSTAGRAM_PASSWORD=your_instagram_password
Replace
your_secret_key_here
,your_instagram_username
, andyour_instagram_password
with appropriate values. -
Initialize the database:
Run the following commands to set up the database schema:
flask db init flask db migrate flask db upgrade
-
Run the application:
flask run
Open your web browser and go to
http://localhost:5000
to view the application.
-
Add a Friend:
- Navigate to the homepage.
- Fill out the "Add Friend" form with the friend's Instagram username and birthday.
- Click on "Add Friend" to add them to your friend list.
-
Send Birthday Messages:
- Click on the "Send Birthday Messages" button to send birthday messages to friends whose birthday matches the current date.
FLASK_APP
: The entry point of your Flask application (e.g.,app.py
).FLASK_ENV
: The environment in which Flask is running (development
orproduction
).SECRET_KEY
: A secret key used by Flask to secure sessions and other things.INSTAGRAM_USERNAME
: Your Instagram username.INSTAGRAM_PASSWORD
: Your Instagram password.
Make sure to keep your .env
file secure and do not expose it publicly (e.g., by adding it to .gitignore
).
Contributions are welcome! If you have any suggestions, improvements, or issues, feel free to open a pull request or report an issue in the GitHub repository.
- Fork the project.
- Create your feature branch (
git checkout -b feature/YourFeature
). - Commit your changes (
git commit -am 'Add some feature'
). - Push to the branch (
git push origin feature/YourFeature
). - Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.