Skip to content

Latest commit

 

History

History
230 lines (178 loc) · 7.36 KB

File metadata and controls

230 lines (178 loc) · 7.36 KB

🌟 AniWiki - A Community-Driven Anime Encyclopedia

Python CI/CD Pipeline

AniWiki is an open-source project designed to help anime fans search, explore, and track anime series. This project was developed as part of a DevOps class under Josh Lowe to apply best practices in CI/CD, automation, and containerization.


📌 Features

👉 Top Anime Ranking
👉 Seasonal New Releases
👉 Search by Name
👉 Search by Studio
👉 Search by Genre

📌 Backlog Features

👉 Upcoming Anime Section

👉 Manga Explorer


🛠️ Backlog Features (Future Enhancements)

  • Create a Watchlist for Favorite Anime
  • User Account System (Login & Registration)
  • Personalized Anime Recommendations
  • Community Ratings & Reviews

🏠 Installation & Setup (Local Deployment)

1️⃣ Install Python

Windows

Download and install Python from python.org.
Ensure Python is added to your system path by selecting "Add Python to PATH" during installation.
Verify installation:

python --version

Linux/macOS

Most Linux/macOS systems have Python pre-installed. To install/update, run:

sudo apt update && sudo apt install python3
sudo apt install python3-pip

Verify installation:

python3 --version

2️⃣ Clone the Repository

git clone https://github.com/Ontario-Tech-NITS/final-project-group-effort-group-3.git
cd final-project-group-effort-group-3

3️⃣ Set Up a Virtual Environment (Optional)

python -m venv env

Activate the virtual environment:

  • Windows:
    env\Scripts\activate
  • Linux/macOS:
    source env/bin/activate

4️⃣ Install Dependencies

pip install -r requirements.txt 

5️⃣ Run the Flask Server

python app.py | python3 app.py 

Then visit http://127.0.0.1:5000/ in your browser.


🚀 CI/CD Pipeline

This project uses a CI/CD pipeline to automatically test and ensure the quality of the code on every push, pull request, or manual trigger. Below are the steps that the pipeline performs:

Pipeline Steps

  1. Build:

    • The application is built using Python 3.10 to ensure the environment is correctly set up.
    • This ensures that no structural issues exist in the codebase.
    • The pipeline runs on Ubuntu as the enviroment based on the phase 2 requirments
    • Checks out the latest version of the repository
    • This ensures the enviroment is properly setup before running tests and validations
  2. Linting:

    • The code is analyzed using Pylint, a static code analysis tool.
    • This step ensures the code follows consistent coding practices and checks for potential errors. Line too long warnings are disabled
    • installs all project dependencies listed in the requirments.txt
    • detects coding errors, styling mismatches and overall consistency
  3. Tests:

    • Unit tests are run to verify the functionality of the code.
    • The tests are executed using the unittest framework to ensure that no new code introduces bugs.
    • It searches for test files inside the static/scripts/test directory and runs them to ensure they are all passing

Workflow Summary:

  • Trigger: The pipeline runs automatically on every push, pull request, or manual trigger.
  • Tasks:
    1. Set up Python 3.10: Prepares the environment.
    2. Install dependencies: Installs the required libraries.
    3. Lint the code: Ensures code quality and consistency.
    4. Run unit tests: Verifies the correctness of the code.

🛠 Troubleshooting & Common Issues:

❌ Pipeline Fails at Linting Step:

  • Run pylint locally before committing changes: pylint static/scripts/test
  • Check for syntax errors, unused variables, or formatting issues.

❌ Tests Fail in CI/CD but Pass Locally:

  • Ensure that all dependencies are correctly listed in requirements.txt.
  • Run tests locally before pushing


🏠 Project Structure

📁 final-project-group-effort-group-3
│── 📁 static  # Static assets (CSS, JS, Images)
│   │── 📁 images  # Image assets
│   │   │── 🌞 404.png    
│   │   │── 🌞 Factsheet.png
│   │   │── 🌞 Logo.png
│   │── 📁 scripts  # JavaScript files
|   │── │── 📁 tests # Unit tests
|   │── │── │── 📝 test_search_by_name.py
|   │── │── │── 📝 test_search_by_studio.py
|   │── │── │── 📝 test_search_by_genre.py
|   │── │── │── 📝 test_season_new_releases.py
|   │── │── │── 📝 test_top_anime.py
|   │── │── │── 📝 test_manga_explorer.py
|   │── │── │── 📝 test_upcoming_anime.py
│   |   |── 📝 search_by_name.py
│   |   |── 📝 search_by_studio.py
│   |   |── 📝 search_by_genre.py
│   |   |── 📝 season_new_releases.py
│   |   |── 📝 top_anime.py
│   |   |── 📝 manga_explorer.py
│   |   |── 📝 upcoming_anime.py
│   │── 📁 styles  # CSS Stylesheets
│   |   |── 📝 main.css
│   |   |── 📝 404.css
│   |   |── 📝 search_by_name.css
│   |   |── 📝 search_by_studio.css
│   |   |── 📝 search_by_genre.css
│   |   |── 📝 season_new_releases.css
│   |   |── 📝 top_anime.css
│   |   |── 📝 upcoming.css
│   |   |── 📝 manga_explorer.css
│── 📁 templates  # HTML templates
│   │── 📝 404.html       # Custom 404 Page
│   │── 📝 index.html     # Homepage
│   │── 📝 search_by_name.html
│   │── 📝 search_by_studio.html
│   │── 📝 search_by_genre.html
│   │── 📝 season_new_releases.html
│   │── 📝 upcoming_search.html
│   │── 📝 manga_explorer.html
│   │── 📝 top_anime.html
│── 📝 app.py             # Flask Backend Application
│── 📝 README.md          # Project Documentation
│── 📝 requirements.txt   # Python Dependencies
│── 📝 .github/workflows  # GitHub Actions CI/CD Pipeline

🚀 Running Unit Tests

To run the unit tests, navigate to the project directory and execute:

python -m unittest discover -s ./static/scripts/test

This will automatically discover and run all test cases inside the static/scripts/test directory.


💪 Contributing

We welcome contributions! Fork the repo, create a branch, and submit a PR.


📚 License

This project is licensed under the MIT License. You are free to use, modify, and distribute it.



🤝 Meet the Team | Group Effort

👨‍💻 Developers: Al, Yousif, Caleb, Faraz, Sam 📚 Instructor: Josh Lowe

Want to contribute? Fork the repo and send us a pull request! 🚀

👀 References


🌟 If you like the project, don't forget to star it on GitHub!