A modern, responsive personal portfolio built with Flask and Bootstrap, featuring smooth animations, a projects section, and a secure contact form with Google reCAPTCHA and Gmail SMTP.
- Responsive UI: Mobile‑first layout using Bootstrap 5
- Smooth Animations: AOS, Swiper, GLightbox, and Typed.js integrations
- Contact Form: Server‑side email delivery via Gmail (yagmail)
- Spam Protection: Google reCAPTCHA v2/v3 verification
- SEO Friendly: Clean HTML, metadata‑ready templates
- Deploy Ready: Works with Gunicorn on Render/Heroku/any WSGI host
- Backend: Flask 3.1, Jinja2 templates
- WSGI Server: Gunicorn
- Styling: Bootstrap 5, custom CSS
- Animations/UX: AOS, GLightbox, Swiper, Typed.js
- Email: yagmail (Gmail SMTP)
- Config: python‑dotenv for environment variables
- Python 3.8+ (project uses
python-3.8.6by default viaruntime.txt) - pip (or pipx) and virtualenv
- A Gmail account with an App Password (2FA enabled)
- Google reCAPTCHA Secret Key
- Clone the repository
git clone https://github.com/Aakarsh-Kumar/portfolio.git
cd portfolio- Create and activate a virtual environment (Windows)
py -3.8 -m venv .venv
.\.venv\Scripts\activate- Install dependencies
python -m pip install --upgrade pip
pip install -r requirements.txt- Configure environment variables
Create a .env file in the project root:
# Google reCAPTCHA
RECAPTCHA_VERIFICATION_URL=https://www.google.com/recaptcha/api/siteverify
RECAPTCHA_SECRET_KEY=your_recaptcha_secret_key
# Gmail SMTP (yagmail)
GMAIL_ID_SENDER=your_sender@gmail.com
GMAIL_APP_PASSWORD=your_16_char_app_password
GMAIL_ID_RECIEVER=your_receiver@gmail.comNotes:
- Generate a Gmail App Password from your Google Account (Security → App passwords). Regular passwords will not work.
- Keep
.envout of version control.
Using the built‑in server with auto‑reload enabled in app.py:
python app.py- App runs by default at: http://127.0.0.1:5000
Optionally, with Flask CLI:
set FLASK_APP=app.py && set FLASK_ENV=development && flask rungunicorn app:app --bind 0.0.0.0:8000 --workers 2- Adjust workers/port as needed for your host.
app.py
requirements.txt
runtime.txt
static/
assets/
css/
style.css
img/
js/
main.js
vendor/
aos/
bootstrap/
bootstrap-icons/
boxicons/
glightbox/
isotope-layout/
php-email-form/
purecounter/
swiper/
typed.js/
waypoints/
templates/
index.html
# (portfolio-details.html is also rendered if present)
/– Main landing page/portfolio-details– Portfolio/project details page (template optional)
- POST
/api/contact– Sends a contact message via email- Form fields:
name,email,subject,message,g-recaptcha-response - Validates reCAPTCHA at
RECAPTCHA_VERIFICATION_URLusingRECAPTCHA_SECRET_KEY - Uses Gmail SMTP (yagmail) to deliver messages to
GMAIL_ID_RECIEVER - Responses:
200 OKon success;400on validation errors
- Form fields:
- RECAPTCHA_VERIFICATION_URL: Typically
https://www.google.com/recaptcha/api/siteverify - RECAPTCHA_SECRET_KEY: Server secret from Google reCAPTCHA
- GMAIL_ID_SENDER: Gmail address used to send emails
- GMAIL_APP_PASSWORD: 16‑character app password (with 2FA)
- GMAIL_ID_RECIEVER: Destination address for incoming messages
This app is WSGI‑ready and runs well on services like Render, Railway, Fly.io, or Heroku.
- Gunicorn:
gunicorn app:app - Python Runtime: specified in
runtime.txt(python-3.8.6) - Recommended: create a
Procfilewithweb: gunicorn app:appfor Heroku - Set all environment variables in your hosting provider’s dashboard
Contributions, issues, and feature requests are welcome!
- Fork the repo
- Create a feature branch:
git checkout -b initials/feat/YourFeature - Commit:
git commit -m "feat: add YourFeature" - Push:
git push origin initials/feat/YourFeature - Open a Pull Request
Aakarsh Kumar
- GitHub: @Aakarsh-Kumar
- Website: aakarsh.is-a.dev
- Email: aakarsh2504@gmail.com
Made with ❤️ by Aakarsh