Gudlft

Project information

  • GitHub URL: https://github.com/DoriDoro/Gudlft
  • create date: Sept. 27, 2023
  • evaluation date: Dec. 26, 2023
  • Skills:

    Python

    Flask

    Pytest

    Git

    GitHub

    Branching

    Flake8

    PEP8

    JSON database


Introduction

In this Flask project, I focused on building a robust web application while implementing best practices such as branching, TDD (Test-Driven Development), and addressing core functionality issues.

Key Highlights:

    • Branching: Clear branching structure for development, QA, and production.
    • Pytest: Comprehensive testing strategy with 99% test coverage.
    • TDD: Test-Driven Development approach for writing and validating code.
    • Error Handling: Graceful error messages and exception handling for debugging.
    • Pythonic Refactoring: Refactored variables to adhere to Python's snake_case convention.
    • JSON Database: Simplified database management using JSON.

This project exemplifies clean, tested code, robust debugging, and the implementation of features aimed at improving both user experience and system integrity.


Competences

    • flask
    • branching (different dev branch, QA branch, main branch)
    • pytest
    • bebug application/project
    • generate error messages and exception
    • TDD (Test-Driven Development)
    • pythonize the application, change camelCase variable to snake_case
    • on origianl GitHub repo there are 6 issues attached, corrected all 6 issues:
      • check email address when loggin in
      • verify the entered points of a club
      • a club can not book more than 12 places at once
      • verify the date of the competition is in the future
      • update points of a club after buying places at competition
      • add new feature: dashboard list clubs with their points
    • json database
    • create new folder for tests and create functional- and integration-test
    • min 60% coverage (I did: 99%)
    • twice as much functional tests than integration tests


Learning Experience

1. Branching Strategy

The project followed a clear branching strategy with separate branches for:

    • Development (dev branch): For ongoing development and feature implementation.
    • QA branch: Dedicated to testing and quality assurance.
    • Main branch: The stable branch for production-ready code.

This approach ensured a smooth workflow, allowing for iterative development and continuous integration without disrupting the main codebase.

2. Test-Driven Development (TDD) and Pytest

I adopted TDD to ensure the application was built with tests in mind from the beginning. Using pytest, I created both functional and integration tests, achieving a high test coverage of 99%. This was well above the 60% minimum requirement, with twice as many functional tests as integration tests. This comprehensive testing strategy ensured that both individual components and their interactions worked flawlessly.

3. Debugging and Error Handling

I implemented robust debugging tools, allowing the application to log error messages and handle exceptions gracefully. This ensured the application could recover from unexpected issues, and provided meaningful error messages to help trace the root causes of failures.

4. Pythonizing the Code

To follow Pythonic conventions, I refactored the code by changing camelCase variables to snake_case. This improved the readability and consistency of the codebase, adhering to Python’s best practices.

Issues Resolved from the Original GitHub Repository:

I addressed six major issues from the original GitHub repository:

    • Check email address when logging in: I implemented email validation during the login process to ensure only registered users could access the system.
    • Verify the entered points of a club: Added checks to ensure that clubs entered valid points when participating in competitions.
    • Club booking limit (max 12 places): Implemented a rule that prevents clubs from booking more than 12 places at any competition.
    • Verify competition date is in the future: Ensured that clubs can only register for competitions with future dates, preventing outdated event registrations.
    • Update club points after booking: The club’s points are automatically updated after booking places in a competition, ensuring the system always reflects the correct points balance.
    • Dashboard feature: Added a dashboard that lists all clubs and their current points, providing a clear and accessible overview of club standings.

5. JSON Database and Test Setup

The project uses a JSON database to manage data for clubs, competitions, and bookings. I also set up a dedicated tests folder, containing both functional and integration tests. This structure helped maintain clarity between different test types, with a clear distinction between unit tests for specific functions and broader integration tests that verified how the components worked together.

Designed by BootstrapMade and modified by DoriDoro