Skip to content

Aakarsh-Kumar/portfolio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aakarsh Portfolio – Flask App

Python Flask Gunicorn

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.

🌟 Features

  • 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

🚀 Tech Stack

  • 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

📋 Prerequisites

  • Python 3.8+ (project uses python-3.8.6 by default via runtime.txt)
  • pip (or pipx) and virtualenv
  • A Gmail account with an App Password (2FA enabled)
  • Google reCAPTCHA Secret Key

🛠️ Installation

  1. Clone the repository
git clone https://github.com/Aakarsh-Kumar/portfolio.git
cd portfolio
  1. Create and activate a virtual environment (Windows)
py -3.8 -m venv .venv
.\.venv\Scripts\activate
  1. Install dependencies
python -m pip install --upgrade pip
pip install -r requirements.txt
  1. 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.com

Notes:

  • Generate a Gmail App Password from your Google Account (Security → App passwords). Regular passwords will not work.
  • Keep .env out of version control.

▶️ Run Locally (Development)

Using the built‑in server with auto‑reload enabled in app.py:

python app.py

Optionally, with Flask CLI:

set FLASK_APP=app.py && set FLASK_ENV=development && flask run

📦 Run with Gunicorn (Production‑like)

gunicorn app:app --bind 0.0.0.0:8000 --workers 2
  • Adjust workers/port as needed for your host.

🗂️ Project Structure

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)

🎨 Available Pages

  • / – Main landing page
  • /portfolio-details – Portfolio/project details page (template optional)

🔌 API Endpoints

  • POST /api/contact – Sends a contact message via email
    • Form fields: name, email, subject, message, g-recaptcha-response
    • Validates reCAPTCHA at RECAPTCHA_VERIFICATION_URL using RECAPTCHA_SECRET_KEY
    • Uses Gmail SMTP (yagmail) to deliver messages to GMAIL_ID_RECIEVER
    • Responses: 200 OK on success; 400 on validation errors

🔐 Environment & Secrets

  • 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

🚀 Deployment

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 Procfile with web: gunicorn app:app for Heroku
  • Set all environment variables in your hosting provider’s dashboard

🤝 Contributing

Contributions, issues, and feature requests are welcome!

  1. Fork the repo
  2. Create a feature branch: git checkout -b initials/feat/YourFeature
  3. Commit: git commit -m "feat: add YourFeature"
  4. Push: git push origin initials/feat/YourFeature
  5. Open a Pull Request

👥 Author

Aakarsh Kumar


Made with ❤️ by Aakarsh

About

Portfolio website of Aakarsh

Topics

Resources

Stars

Watchers

Forks

Contributors