diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..730016f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,107 @@ +name: CI + +on: + push: + branches: + - develop + pull_request: + +concurrency: + group: develop-quickdo-${{ github.event.number }} + cancel-in-progress: true + +jobs: + tests: + runs-on: ubuntu-latest + strategy: + fail-fast: false + name: Server + + services: + redis-cache: + image: redis:alpine + ports: + - 13000:6379 + redis-queue: + image: redis:alpine + ports: + - 11000:6379 + mariadb: + image: mariadb:10.6 + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306:3306 + options: --health-cmd="mariadb-admin ping" --health-interval=5s --health-timeout=2s --health-retries=3 + + steps: + - name: Clone + uses: actions/checkout@v3 + + - name: Find tests + run: | + echo "Finding tests" + grep -rn "def test" > /dev/null + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18 + check-latest: true + + - name: Cache pip + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml', '**/setup.py', '**/setup.cfg') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: 'echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT' + + - uses: actions/cache@v4 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install MariaDB Client + run: | + sudo apt update + sudo apt-get install mariadb-client + + - name: Setup + run: | + pip install frappe-bench + bench init --skip-redis-config-generation --skip-assets --python "$(which python)" ~/frappe-bench + mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL character_set_server = 'utf8mb4'" + mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'" + + - name: Install + working-directory: /home/runner/frappe-bench + run: | + bench get-app quickdo $GITHUB_WORKSPACE + bench setup requirements --dev + bench new-site --db-root-password root --admin-password admin test_site + bench --site test_site install-app quickdo + bench build + env: + CI: 'Yes' + + - name: Run Tests + working-directory: /home/runner/frappe-bench + run: | + bench --site test_site set-config allow_tests true + bench --site test_site run-tests --app quickdo + env: + TYPE: server \ No newline at end of file diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 0000000..94488c1 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,60 @@ +name: Linters + +on: + pull_request: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + linter: + name: 'Frappe Linter' + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: pip + - uses: pre-commit/action@v3.0.0 + + - name: Download Semgrep rules + run: git clone --depth 1 https://github.com/frappe/semgrep-rules.git frappe-semgrep-rules + + - name: Run Semgrep rules + run: | + pip install semgrep + semgrep ci --config ./frappe-semgrep-rules/rules --config r/python.lang.correctness + + deps-vulnerable-check: + name: 'Vulnerable Dependency Check' + runs-on: ubuntu-latest + + steps: + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - uses: actions/checkout@v4 + + - name: Cache pip + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml', '**/setup.py') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + + - name: Install and run pip-audit + run: | + pip install pip-audit + cd ${GITHUB_WORKSPACE} + pip-audit --desc on . \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d58ce6f..dff099d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,16 +1,15 @@ exclude: 'node_modules|.git' -default_stages: [commit] +default_stages: [pre-commit] fail_fast: false repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v5.0.0 hooks: - id: trailing-whitespace files: "quickdo.*" exclude: ".*json$|.*txt$|.*csv|.*md|.*svg" - - id: check-yaml - id: check-merge-conflict - id: check-ast - id: check-json @@ -19,14 +18,17 @@ repos: - id: debug-statements - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.2.0 + rev: v0.8.1 hooks: - id: ruff - name: "Run ruff linter and apply fixes" - args: ["--fix"] + name: "Run ruff import sorter" + args: ["--select=I", "--fix"] + + - id: ruff + name: "Run ruff linter" - id: ruff-format - name: "Format Python code" + name: "Run ruff formatter" - repo: https://github.com/pre-commit/mirrors-prettier rev: v2.7.1 @@ -64,4 +66,4 @@ repos: ci: autoupdate_schedule: weekly skip: [] - submodules: false + submodules: false \ No newline at end of file diff --git a/README.md b/README.md index 26e60ad..49446de 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,60 @@ -### QuickDo +# **QuickDo** 🚀 -Introducing our to-do management app, built with React and the Frappe framework. Simplify your task creation and management with an intuitive interface that allows you to categorize and organize your to-dos efficiently. Boost your productivity and stay on top of your tasks with ease. +QuickDo is a **lightweight, professional, and fast task management** solution built with **React and Frappe**. Designed for simplicity and efficiency, QuickDo offers an intuitive **UI for seamless task entry, categorization, and organization**. -### Installation +With a **fully responsive design**, it ensures an optimal user experience across devices, helping you **boost productivity and streamline task management effortlessly**. -You can install this app using the [bench](https://github.com/frappe/bench) CLI: +## ✨ **Key Features** +✔ **Blazing Fast Task Management** – Quickly add, edit, and manage tasks with minimal effort. +✔ **Smart Filtering & Categorization** – Organize your tasks efficiently with custom categories and filters. +✔ **Sleek & Professional UI** – A distraction-free interface designed for **speed and usability**. +✔ **Fully Responsive Design** – Access QuickDo on desktop, tablet, or mobile with a consistent experience. +✔ **Optimized Performance** – Built with **React & Frappe**, ensuring a smooth and robust experience. + +## 📸 **Screenshots** +![Screenshot 2025-03-12 234400](https://github.com/user-attachments/assets/71546927-e804-4819-af9b-bd872bef8ca0) +![Screenshot 2025-03-12 234442](https://github.com/user-attachments/assets/ddcf4fdc-9e09-4c85-9b88-a93f12e22ca5) +![Screenshot 2025-03-12 234454](https://github.com/user-attachments/assets/24239cb5-3ba0-44f3-80bc-274dfcf03a94) +![Screenshot 2025-03-12 234601](https://github.com/user-attachments/assets/73df4a45-2c68-4b68-a252-6faec4284178) +![Screenshot 2025-03-12 234634](https://github.com/user-attachments/assets/6678b4b9-2b8a-400b-bbd7-04eb9fba6cbc) +![Screenshot 2025-03-12 234649](https://github.com/user-attachments/assets/cb9bf421-2832-4e9c-bbad-406507a27b4e) +![Screenshot 2025-03-12 234714](https://github.com/user-attachments/assets/1e5baecb-736f-47ad-8bb8-4490c1734300) +![Screenshot 2025-03-12 234723](https://github.com/user-attachments/assets/2c3b4897-afd6-4b3a-ade7-0b8f7ba6724d) +![Screenshot 2025-03-12 234736](https://github.com/user-attachments/assets/bbcc56ad-3e08-4f7e-b819-f926806e5dfd) + + +--- + +## 🔧 **Installation** + +To install QuickDo as a Frappe app, use the [bench](https://github.com/frappe/bench) CLI: ```bash cd $PATH_TO_YOUR_BENCH -bench get-app $URL_OF_THIS_REPO --branch develop +bench get-app $URL_OF_THIS_REPO --branch main bench install-app quickdo ``` -### Contributing +--- + +## 🤝 **Contributing** + +We welcome contributions to QuickDo! 🎉 -This app uses `pre-commit` for code formatting and linting. Please [install pre-commit](https://pre-commit.com/#installation) and enable it for this repository: +### **Setup Pre-commit Hooks** +This project uses **pre-commit** for code formatting and linting. To get started: ```bash cd apps/quickdo pre-commit install ``` +--- -Pre-commit is configured to use the following tools for checking and formatting your code: +## 📜 **License** +QuickDo is licensed under **AGPL-3.0**. -- ruff -- eslint -- prettier -- pyupgrade +🚀 **Start managing your tasks faster and smarter with QuickDo today!** -### License +--- -agpl-3.0 +Let me know if you want any further refinements or additional sections! 😊 diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js index 092408a..20b1f8c 100644 --- a/frontend/eslint.config.js +++ b/frontend/eslint.config.js @@ -1,28 +1,25 @@ -import js from '@eslint/js' -import globals from 'globals' -import reactHooks from 'eslint-plugin-react-hooks' -import reactRefresh from 'eslint-plugin-react-refresh' -import tseslint from 'typescript-eslint' +import js from "@eslint/js"; +import globals from "globals"; +import reactHooks from "eslint-plugin-react-hooks"; +import reactRefresh from "eslint-plugin-react-refresh"; +import tseslint from "typescript-eslint"; export default tseslint.config( - { ignores: ['dist'] }, - { - extends: [js.configs.recommended, ...tseslint.configs.recommended], - files: ['**/*.{ts,tsx}'], - languageOptions: { - ecmaVersion: 2020, - globals: globals.browser, - }, - plugins: { - 'react-hooks': reactHooks, - 'react-refresh': reactRefresh, - }, - rules: { - ...reactHooks.configs.recommended.rules, - 'react-refresh/only-export-components': [ - 'warn', - { allowConstantExport: true }, - ], - }, - }, -) + { ignores: ["dist"] }, + { + extends: [js.configs.recommended, ...tseslint.configs.recommended], + files: ["**/*.{ts,tsx}"], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + }, + plugins: { + "react-hooks": reactHooks, + "react-refresh": reactRefresh, + }, + rules: { + ...reactHooks.configs.recommended.rules, + "react-refresh/only-export-components": ["warn", { allowConstantExport: true }], + }, + } +); diff --git a/frontend/postcss.config.js b/frontend/postcss.config.js index 2e7af2b..7b75c83 100644 --- a/frontend/postcss.config.js +++ b/frontend/postcss.config.js @@ -1,6 +1,6 @@ export default { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, -} + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +}; diff --git a/frontend/src/components/layout/navbar.tsx b/frontend/src/components/layout/navbar.tsx index 41ea70f..f75d604 100644 --- a/frontend/src/components/layout/navbar.tsx +++ b/frontend/src/components/layout/navbar.tsx @@ -36,7 +36,7 @@ const Navbar = () => { return ( <> {/* NAVBAR */} -
+