Skip to content

MLH Data Hackfest 2025 Project - Created by NicoleDev021 during the hackathon on July 27, 2025

License

CC-BY-4.0, GPL-3.0 licenses found

Licenses found

CC-BY-4.0
LICENSE.CC
GPL-3.0
LICENSE.GPL
Notifications You must be signed in to change notification settings

NicoleDev021/MLHDataHackfest25

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

48 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Personal Finance Coach

A Flask application that helps users manage their personal finances with Auth0 authentication.

Table of Contents

Quick Start

Local Development

# Clone and setup
git clone https://github.com/NicoleDev021/MLHDataHackfest25.git
cd MLHDataHackfest25/personal_finance_coach

# Create virtual environment and install dependencies
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate  
pip install -r requirements.txt

# Create .env file with your Auth0 credentials (see Environment Setup below)
# Start the application
python run.py

GitHub Codespaces

# After opening in Codespaces
cd personal_finance_coach
pip install -r requirements.txt
# Create .env file with Auth0 credentials
python run.py

Visit http://localhost:5000 (local) or use the forwarded port URL (Codespaces).

Features

  • πŸ” Secure Authentication: Auth0 integration for user management
  • 🎨 Modern UI: Bootstrap 5.3.0 responsive design
  • πŸ›‘οΈ Security: CSRF protection, secure sessions, and input validation
  • πŸ“± Responsive: Works on desktop, tablet, and mobile devices
  • πŸ” Code Quality: Comprehensive linting and formatting tools
  • πŸš€ Cloud Ready: Optimized for GitHub Codespaces deployment

Architecture

  • Backend: Flask 3.1.1 with modular blueprint architecture
  • Authentication: Auth0 OAuth2 integration with Authlib
  • Frontend: Jinja2 templates with Bootstrap CSS framework
  • Validation: Marshmallow for input validation and serialization
  • Session Management: Flask-Session with secure cookie configuration

Environment Setup

Auth0 Configuration

  1. Create an Auth0 account at auth0.com

  2. Create a new Application:

    • Go to Applications > Applications
    • Click "Create Application"
    • Name it "Personal Finance Coach"
    • Choose "Regular Web Application"
  3. Configure Application URLs:

    Allowed Callback URLs:
    http://localhost:5000/callback
    https://${CODESPACE_NAME}-5000.app.github.dev/callback
    
    Allowed Logout URLs:
    http://localhost:5000
    https://${CODESPACE_NAME}-5000.app.github.dev
    
    Allowed Web Origins:
    http://localhost:5000
    https://${CODESPACE_NAME}-5000.app.github.dev
    

Environment Variables

Create a .env file in the project root with the following variables:

# Auth0 Configuration
AUTH0_CLIENT_ID='your-client-id'
AUTH0_CLIENT_SECRET='your-client-secret'
AUTH0_DOMAIN='your-domain.us.auth0.com'
APP_SECRET_KEY='your-secret-key'

# GitHub Codespace Configuration```
CODESPACE_NAME='your-codespace-name'  # Optional: Only needed for Codespace development

Replace the placeholder values:

  • AUTH0_CLIENT_ID: Found in Auth0 Application Settings
  • AUTH0_CLIENT_SECRET: Found in Auth0 Application Settings
  • AUTH0_DOMAIN: Your Auth0 domain (e.g., dev-xxx.us.auth0.com)
  • APP_SECRET_KEY: Generate with python -c 'import secrets; print(secrets.token_hex())'
  • CODESPACE_NAME: Your GitHub Codespace name (only if using Codespaces)

Installation & Setup

Prerequisites

  • Python 3.8 or higher
  • Git

Installation Steps

  1. Clone the repository:

    git clone https://github.com/NicoleDev021/MLHDataHackfest25.git
    cd MLHDataHackfest25/personal_finance_coach
  2. Create a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Set up environment variables:

    • Create a .env file in the personal_finance_coach/ directory
    • Add the Auth0 configuration variables as shown above

Running the Application

Local Development

  1. Activate your virtual environment:

    source venv/bin/activate  # On Windows: venv\Scripts\activate
  2. Start the application:

    python run.py
  3. Access the application:

    • Open your browser and go to http://localhost:5000
    • The application will run in debug mode for development

Running in GitHub Codespaces

  1. Open the repository in Codespaces:

    • Click the green "Code" button on GitHub
    • Select "Codespaces" tab
    • Click "Create codespace on main"
  2. Install dependencies:

    cd personal_finance_coach
    pip install -r requirements.txt
  3. Set up environment variables:

    • Create a .env file with your Auth0 credentials
    • The CODESPACE_NAME environment variable is automatically set
  4. Start the application:

    python run.py
  5. Access the application:

    • Codespaces will automatically forward port 5000
    • Click on the "Ports" tab in the terminal panel
    • Click the globe icon next to port 5000 or visit https://${CODESPACE_NAME}-5000.app.github.dev

Environment Configuration

The application supports different environments:

  • Development (default): Debug mode enabled, detailed error messages
  • Production: Optimized for deployment, debug mode disabled
  • Testing: Configuration for running tests

Set the environment using:

export FLASK_ENV=development  # or production, testing
export FLASK_DEBUG=true       # Enable debug mode

Troubleshooting

Common Issues

1. Port 5000 already in use:

# Kill process using port 5000
sudo lsof -ti:5000 | xargs kill -9
# Or use a different port
python run.py --port 5001

2. Auth0 authentication errors:

  • Verify your .env file has correct Auth0 credentials
  • Check that your Auth0 application URLs match your environment
  • For Codespaces, ensure the callback URL includes your codespace name

3. Module not found errors:

  • Ensure your virtual environment is activated
  • Reinstall dependencies: pip install -r requirements.txt

4. Permission denied in Codespaces:

  • Codespaces may require you to run: chmod +x run.py

5. Template syntax errors:

  • If you see Jinja2 TemplateSyntaxError, check for unclosed block tags
  • Ensure all {% block %} tags have matching {% endblock %} tags
  • Verify template files don't have hidden characters or encoding issues
  • Common fix: Recreate templates with clean syntax if issues persist

Development Tools

Code formatting and linting:

# Format code with Black
black .

# Check code style with Flake8
flake8 .

# Run Pylint for code analysis
pylint app/

# Sort imports with isort
isort .

Running all linting tools:

./lint.sh  # Runs all linting tools at once

Code Quality Status

The codebase maintains PERFECT quality standards with comprehensive linting and security checks:

  • Code Quality Score: πŸ† 10.00/10 (Pylint) - PERFECT SCORE MAINTAINED!
  • Security: βœ… No vulnerabilities found in application code (Bandit: 0 issues in 631 lines)
  • Code Formatting: βœ… 100% compliant with Black formatter (7 files unchanged)
  • Style Guide: βœ… 100% PEP8 compliant (Flake8: 0 violations)
  • Dependency Security: βœ… No known vulnerabilities in 173 dependencies (Safety scan)
  • Template Security: βœ… XSS protection verified - no unsafe variables or dangerous JavaScript
  • Lines of Code: 851 total lines analyzed across 7 Python files and 7 HTML templates

Quality Assurance Tools:

  • Black: Automatic code formatting
  • Flake8: Style guide enforcement (PEP8)
  • Pylint: Static code analysis and quality metrics (configured via .pylintrc)
  • Bandit: Security vulnerability scanning
  • Safety: Dependency vulnerability checking

All quality checks are automated and enforced before code commits. The project includes a comprehensive .pylintrc configuration file that enables the perfect 10.00/10 score while maintaining strict quality standards.

Developer Documentation

πŸ“š For New Developers & Interns

If you're new to the project or web development, check out these comprehensive guides:

  • Junior Developer Guide - Perfect starting point for interns and junior developers
    • Development workflow and debugging tips
    • How to navigate the codebase effectively
    • Step-by-step feature development examples
    • Common issues and solutions

πŸ—οΈ Architecture & Technical Details

  • Architecture Documentation - Complete system design overview

    • Application structure and component relationships
    • Authentication flow diagrams
    • Configuration system explanation
    • Security features and implementation
  • Data Flow Documentation - Understanding how data moves through the system

    • Complete authentication data flow
    • Session management lifecycle
    • Error handling workflows
    • Template data binding

πŸ”§ Development Resources

These documents help you understand how everything connects together and provide practical guidance for adding new features or debugging issues.


Contributor Guidance

If you contribute to this repository, please make sure to review and follow the community standards and reference the following files:

  • CODE_OF_CONDUCT.md: Outlines the standards for behavior and participation in this community.
    Please read and follow the Code of Conduct to help maintain a welcoming environment for all contributors.

  • CONTRIBUTING.md: Provides detailed guidelines on how to contribute to this project, including how to submit issues and pull requests, coding standards, and commit message conventions.
    Please review these instructions before contributing to ensure your submissions align with the project's workflow and expectations.

  • SECURITY.md: Contains the process for reporting security vulnerabilities or concerns.
    If you discover a security issue, please follow the instructions in this file to report it responsibly.

We appreciate your attention to these documents to help keep the project collaborative, secure, and compliant.


License

Source code in this repository is licensed under the GNU General Public License v3.0 or later (GPL-3.0-or-later).

Documentation (including the README, all files in the docs/ directory, and all files in the .github directory) is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).

For code files, you may see the following SPDX identifier at the top:

SPDX-License-Identifier: GPL-3.0-or-later

For documentation files, you may see:

SPDX-License-Identifier: CC-BY-4.0

If you contribute, you agree that your contributions will be licensed under these terms.

About

MLH Data Hackfest 2025 Project - Created by NicoleDev021 during the hackathon on July 27, 2025

Topics

Resources

License

CC-BY-4.0, GPL-3.0 licenses found

Licenses found

CC-BY-4.0
LICENSE.CC
GPL-3.0
LICENSE.GPL

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •