{"id":24794890,"url":"https://github.com/cyprich/filamenty","last_synced_at":"2026-04-16T10:02:36.240Z","repository":{"id":274528023,"uuid":"916998281","full_name":"cyprich/filamenty","owner":"cyprich","description":"Semestrálna práca z predmetu Unix - Vývojové prostredie","archived":false,"fork":false,"pushed_at":"2025-11-25T14:27:00.000Z","size":26371,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-28T19:43:15.389Z","etag":null,"topics":["3dprinting","filament","flask","python","qrcode","react","restapi","school","sqlite","tailwindcss"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cyprich.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-15T06:47:25.000Z","updated_at":"2025-11-25T14:27:04.000Z","dependencies_parsed_at":"2025-01-27T21:40:43.964Z","dependency_job_id":null,"html_url":"https://github.com/cyprich/filamenty","commit_stats":null,"previous_names":["cyprich/filamenty"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cyprich/filamenty","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyprich%2Ffilamenty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyprich%2Ffilamenty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyprich%2Ffilamenty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyprich%2Ffilamenty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyprich","download_url":"https://codeload.github.com/cyprich/filamenty/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyprich%2Ffilamenty/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31880884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T09:23:21.276Z","status":"ssl_error","status_checked_at":"2026-04-16T09:23:15.028Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3dprinting","filament","flask","python","qrcode","react","restapi","school","sqlite","tailwindcss"],"created_at":"2025-01-29T23:18:41.012Z","updated_at":"2026-04-16T10:02:36.227Z","avatar_url":"https://github.com/cyprich.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Filamenty\n\nFullstack webová aplikácia na správu filamentov do 3D tlačiarne\n\nAplikácia umožňuje vytvoriť zoznam filamentov a následne v ňom upravovať, pridávať a odoberať filamenty  \nNavyše aplikácia generuje pre filamenty štítky s QR kódami, ktoré po naskenovaní umožňujú jednoducho spravovať dané\nfilamenty\n\n![](./preview1.png)  \n![](./preview2.png)  \n![](./preview3.png)\n\n**Obsah**\n\n\u003c!--toc:start--\u003e\n\n- [Filamenty](#filamenty)\n  - [Použité technológie](#použité-technológie)\n  - [Požiadavky a spúštanie aplikácie](#požiadavky-a-spúštanie-aplikácie)\n  - [Databáza](#databáza)\n    - [Štruktúra tabuľky `filaments`](#štruktúra-tabuľky-filaments)\n      - [Príklad záznamov](#príklad-záznamov)\n  - [API](#api)\n    - [`GET http://localhost:5000/api/v1/`](#get-httplocalhost5000api)\n    - [`GET http://localhost:5000/api/v1/filaments/`](#get-httplocalhost5000apifilaments)\n    - [`POST http://localhost:5000/api/v1/filaments/`](#post-httplocalhost5000apifilaments)\n    - [`GET http://localhost:5000/api/v1/filaments/\u003cint:id\u003e/`](#get-httplocalhost5000apifilamentsintid)\n    - [`PUT http://localhost:5000/api/v1/filaments/\u003cint:id\u003e/`](#put-httplocalhost5000apifilamentsintid)\n    - [`DELETE http://localhost:5000/api/v1/filaments/\u003cint:id\u003e/`](#delete-httplocalhost5000apifilamentsintid)\n    - [`GET http://locahost:5000/api/v1/filaments/random/`](#get-httplocahost5000apifilamentsrandom)\n    - [`GET http://locahost:5000/api/v1/info/`](#get-httplocahost5000apiinfo)\n  - [Použité zdroje](#použité-zdroje)\n  \u003c!--toc:end--\u003e\n\n## Použité technológie\n\n- Backend\n  - Python - Hlavný programovací jazyk\n  - Flask - Webový framework na vytvorenie API a obsluhu požiadaviek\n  - SQLite - Databáza na uchovávanie informácií o filamentoch\n  - qrcode - Python knižnica na generovanie QR kódov\n- Frontend\n  - React a JavaScript - Tvorba dynamického používateľského rozhrania\n  - Tailwind CSS - CSS framework na vizuálne formátovanie webovej aplikácie\n  - Axios - Vykonávanie HTTP požiadaviek\n- Ostatné\n  - Docker a docker-compose - Kontajnerizácia pre jednoduchšie nasadenie aplikácie\n\n## Požiadavky a spúštanie aplikácie\n\n1. Klonovanie Git repozitára\n   - Repozitár je verejne dostupný na [GitHub](https://github.com/cyprich/filamenty)\n   - Uistite sa, že máte nainštalovaný _git_, a spustite nasledovný príkaz\n     - `git clone https://github.com/cyprich/filamenty filamenty`\n   - Následne sa presuňte do priečinku klonovaného repozitára\n     - `cd filamenty`\n1. Inštalácia potrebných balíčkov\n   - `docker`\n   - `docker-compose`\n   - Konkrétny príkaz na inštaláciu balíčkov závisí od vašej Linux distribúcie, napr.:\n     - `sudo apt install docker docker-compose` pre Ubunutu-based distribúcie\n     - `sudo pacman -Syu docker docker-compose` pre Arch-based distribúcie\n1. Spustenie systémových procesov pre Docker\n   - `sudo systemctl start docker`\n   - `sudo systemctl enable docker` - _nepovinné_ - automaticky spustí proces pri bootovaní zariadenia\n1. Pridanie používateľa do skupiny _docker_\n   - `sudo usermod -aG docker ${USER}`\n1. Používateľ sa musí odhlásiť a znova prihlásiť pre aplikovanie zmien\n1. Inicializácia pred prvým spustením na novom zariadení\n   - Inicializáciu je možné vykonať spustením súboru _init.sh_ príkazom `./init.sh`\n   - Vykonávajú sa tieto 2 kroky:\n     - Nastavenie IP adresy\n       - Zistite IP adresu vášho zariadenia cez GUI (v nastaveniach) alebo pomocou príkazu `ip -c address`\n       - IP adresa by mala vyzerať nejak takto: _192.168.1.100_\n     - _Nepovinné_ - naplnenie databázy počiatočnými hodnotami\n       - **Pozor!** - spustenie súboru vymaže všetky údaje v terajšej databáze bez možnosti návratu!\n       - Na spustenie súboru je potrebné mať nainštalovaný balíček _python3_\n1. Spustenie aplikácie pomocou súboru _run.sh_\n   - `./run.sh`\n1. Príkazový riadok nechajte otvorený\n1. Aplikáciu zobrazíte vo webovom prehliadači na adrese `http://vaša_IP_adresa:3000` alebo `http://localhost:3000`\n1. Pre zastavenie aplikácie použite klávesovú skratku `ctrl + c` v príkazovom riadku\n\n## Databáza\n\n### Štruktúra tabuľky `filaments`\n\n| Názov hodnoty      | Typ       | Popis                                                                                                               |\n| ------------------ | --------- | ------------------------------------------------------------------------------------------------------------------- |\n| `id`               | `INTEGER` | Jednoznačný číselný identifikátor filamentu, určuje sa automaticky                                                  |\n| `vendor`           | `TEXT`    | Výrobca filamentu                                                                                                   |\n| `meterial`         | `TEXT`    | Materiál filamentu (napr. PLA, TPU)                                                                                 |\n| `price`            | `REAL`    | Cena filamentu                                                                                                      |\n| `color_hex`        | `TEXT`    | Farba filamentu reprezentovaná hexadecimálnym kódom farby (napr. `#111111`)                                         |\n| `color_second_hex` | `TEXT`    | Sekundárna farba filamentu reprezentovaná hexadecimálnym kódom farby (nepovinné, iba pri viacfarebných filamentoch) |\n| `weight`           | `INT`     | Aktuálne zostávajúca hmotnosť filamentu + hmotnosť cievky, na ktorej je filament navinutý (v gramoch)               |\n| `weight_orig`      | `INT`     | Pôvodná hmotnosť filamentu (v gramoch)                                                                              |\n| `weight_spool`     | `INT`     | Hmotnosť cievky, na ktorej je filament navinutý (v gramoch)                                                         |\n| `temp_min`         | `INT`     | Minimálna odporúčaná teplota tlače (v stupňoch Celzia)                                                              |\n| `temp_max`         | `INT`     | Maximálna odporúčaná teplota tlače (v stupňoch Celzia)                                                              |\n| `temp_bed_min`     | `INT`     | Minimálna odporúčaná teplota podložky (v stupňoch Celzia)                                                           |\n| `temp_bed_max`     | `INT`     | Maximálna odporúčaná teplota podložky (v stupňoch Celzia)                                                           |\n| `image_url`        | `TEXT`    | URL adresa obrázku filamentu                                                                                        |\n\n- Stĺpec `id` je **primárny kľúč** databázy\n- Kombinácia stĺpcov `vendor`, `material` a `color_hex` je **unikátna** (v databáze nemôžu existovať dva filamenty s\n  rovnakým výrobcom, materiálom a farbou)\n\n#### Príklad záznamov\n\n| id  | vendor    | material | price | color_hex | color_second_hex | weight | weight_orig | weight_spool | temp_min | temp_max | temp_bed_min | temp_bed_max | image_url                                             |\n| --- | --------- | -------- | ----- | --------- | ---------------- | ------ | ----------- | ------------ | -------- | -------- | ------------ | ------------ | ----------------------------------------------------- |\n| 1   | Bambu Lab | PLA      | 29.99 | #111111   | NULL             | 290    | 1000        | 250          | 190      | 230      | 45           | 65           | [http://192.168.1.10/api/v1/images/filaments/1.png]() |\n| 2   | eSun      | Silk PLA | 25.99 | #e41e95   | #123cea          | 876    | 1000        | 220          | 190      | 230      | 45           | 60           | [http://192.168.1.10/api/v1/images/filaments/2.png]() |\n| 3   | Fiberlogy | TPU 40D  | 25.30 | #222222   | NULL             | 438    | 500         | 250          | 200      | 220      | 50           | 70           | [http://192.168.1.10/api/v1/images/filaments/3.png]() |\n\n## API\n\nBase URL: `http://localhost:5000/api/v1/`\n\n### `GET http://localhost:5000/api/v1/`\n\nVráti uvítaciu správu od backendu\n\n_Response_\n\n```json\n{\n  \"message\": \"Hello from backend!\"\n}\n```\n\n### `GET http://localhost:5000/api/v1/filaments/`\n\nVráti informácie o všetkých filamentoch\n\n_Response_\n\n```json\n{\n{\n  \"filaments\": [\n    {\n      \"color_hex\": \"#111\",\n      \"color_second_hex\": null,\n      \"id\": 1,\n      \"image_url\": \"http://192.168.1.10:5000/api/v1/images/filaments/1.png\",\n      \"material\": \"PLA\",\n      \"price\": 29.99,\n      \"temp_bed_max\": 65,\n      \"temp_bed_min\": 45,\n      \"temp_max\": 230,\n      \"temp_min\": 190,\n      \"vendor\": \"Bambu Lab\",\n      \"weight\": 0,\n      \"weight_orig\": 1000,\n      \"weight_spool\": 250\n    },\n    {\n      \"color_hex\": \"#c12e1f\",\n      \"color_second_hex\": null,\n      \"id\": 2,\n      \"image_url\": \"http://192.168.1.10:5000/api/v1/images/filaments/2.png\",\n      \"material\": \"PLA\",\n      \"price\": 29.99,\n      \"temp_bed_max\": 65,\n      \"temp_bed_min\": 45,\n      \"temp_max\": 230,\n      \"temp_min\": 190,\n      \"vendor\": \"Bambu Lab\",\n      \"weight\": 290,\n      \"weight_orig\": 1000,\n      \"weight_spool\": 250\n    }\n  ]\n}\n}\n```\n\n### `POST http://localhost:5000/api/v1/filaments/`\n\nPridá nový filament do databázy\n\n_Body (form data)_\n\n```\nvendor: \"ABC\"\nmaterial: \"XYZ\"\nprice: \"19.99\"\ncolor_hex: \"#ffffff\"\nweight: \"500\"\nweight_orig: \"1000\"\nweight_spool: \"250\"\ntemp_min: \"200\"\ntemp_max: \"220\"\ntemp_bed_min: \"50\"\ntemp_bed_max: \"60\"\nimage: \u003cfile\u003e\n```\n\n_Response_\n\n```json\n{\n  \"filaments\": {\n    \"color_hex\": \"#ffffff\",\n    \"color_second_hex\": null,\n    \"id\": 3,\n    \"image_url\": \"http://192.168.1.10:5000/api/v1/images/filaments/3.png\",\n    \"material\": \"XYZ\",\n    \"price\": 19.99,\n    \"temp_bed_max\": 60,\n    \"temp_bed_min\": 50,\n    \"temp_max\": 220,\n    \"temp_min\": 200,\n    \"vendor\": \"ABC\",\n    \"weight\": 500,\n    \"weight_orig\": 1000,\n    \"weight_spool\": 250\n  }\n}\n```\n\n### `GET http://localhost:5000/api/v1/filaments/\u003cint:id\u003e/`\n\nVráti informácie o konkrétnom filamente na základe `id`\n\n_Response_\n\n```json\n{\n  \"filaments\": {\n    \"color_hex\": \"#73bab5\",\n    \"color_second_hex\": null,\n    \"id\": 4,\n    \"image_url\": \"http://192.168.1.10:5000/api/v1/images/filaments/4.png\",\n    \"material\": \"PLA+\",\n    \"price\": 23.9,\n    \"temp_bed_max\": null,\n    \"temp_bed_min\": 60,\n    \"temp_max\": 210,\n    \"temp_min\": 190,\n    \"vendor\": \"Filament PM\",\n    \"weight\": 870,\n    \"weight_orig\": 1000,\n    \"weight_spool\": 216\n  }\n}\n```\n\n### `PUT http://localhost:5000/api/v1/filaments/\u003cint:id\u003e/`\n\nAktualizuje informáciu o konkrétnom filamente na základe `id`\n\n_Body (JSON)_\n\n```json\n{\n  \"key\": \"weight\",\n  \"value\": \"199\"\n}\n```\n\n_Response_\n\n```json\n{\n  \"filaments\": {\n    \"color_hex\": \"#111111\",\n    \"color_second_hex\": null,\n    \"id\": 1,\n    \"image_url\": \"http://192.168.1.10:5000/api/v1/images/filaments/1.png\",\n    \"material\": \"PLA\",\n    \"price\": 29.99,\n    \"temp_bed_max\": 65,\n    \"temp_bed_min\": 45,\n    \"temp_max\": 230,\n    \"temp_min\": 190,\n    \"vendor\": \"Bambu Lab\",\n    \"weight\": 199,\n    \"weight_orig\": 1000,\n    \"weight_spool\": 250\n  }\n}\n```\n\n### `DELETE http://localhost:5000/api/v1/filaments/\u003cint:id\u003e/`\n\nVymaže konkrétny filament na základe `id`\n\n_Response_\n\n```json\n{\n  \"filaments\": {\n    \"color_hex\": \"#111111\",\n    \"color_second_hex\": null,\n    \"id\": 1,\n    \"image_url\": \"http://192.168.1.10:5000/api/v1/images/filaments/1.png\",\n    \"material\": \"PLA\",\n    \"price\": 29.99,\n    \"temp_bed_max\": 65,\n    \"temp_bed_min\": 45,\n    \"temp_max\": 230,\n    \"temp_min\": 190,\n    \"vendor\": \"Bambu Lab\",\n    \"weight\": 199,\n    \"weight_orig\": 1000,\n    \"weight_spool\": 250\n  }\n}\n```\n\n### `GET http://locahost:5000/api/v1/filaments/random/`\n\nVráti informácie o filamente\n\n_Response_\n\n```json\n{\n  \"filaments\": {\n    \"color_hex\": \"#111111\",\n    \"color_second_hex\": null,\n    \"id\": 1,\n    \"image_url\": \"http://192.168.1.10:5000/api/v1/images/filaments/1.png\",\n    \"material\": \"PLA\",\n    \"price\": 29.99,\n    \"temp_bed_max\": 65,\n    \"temp_bed_min\": 45,\n    \"temp_max\": 230,\n    \"temp_min\": 190,\n    \"vendor\": \"Bambu Lab\",\n    \"weight\": 199,\n    \"weight_orig\": 1000,\n    \"weight_spool\": 250\n  }\n}\n```\n\n### `GET http://locahost:5000/api/v1/info/`\n\nVráti všeobecné informácie of filamentoch v databáze\n\n_Response_\n\n```json\n{\n  \"filament_count\": 15,\n  \"ids\": [2, 4, 6, 7, 8],\n  \"invalid_ids\": [1, 3, 5]\n}\n```\n\n## Použité zdroje\n\n| Popis                                                                    | Autor                                                                                             | Súbor                                                                | Link                                                                                                                                                                                                                       |\n| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Dokumentácia Python knižnice _qrcode_                                    | Lincoln Loop                                                                                      | `backend/generate_qrcodes.py` riadky 45 - 50                         | [https://pypi.org/project/qrcode/](https://pypi.org/project/qrcode/)                                                                                                                                                       |\n| Dokumentácia Tailwind CSS                                                | Tailwind Labs Inc.                                                                                | `frontend/src/Filaments.jsx` riadky 27 - 89                          | [https://tailwindcss.com/](https://tailwindcss.com/)                                                                                                                                                                       |\n| Článok _\"How to use Axios With React\"_                                   | Reed                                                                                              | `frontend/src/Filaments.jsx` riadky 18 - 24                          | [https://www.freecodecamp.org/news/how-to-use-axios-with-react/](https://www.freecodecamp.org/news/how-to-use-axios-with-react/)                                                                                           |\n| Článok _\"How to upload files in React app using Axios?\"_                 | Ushna Ijaz                                                                                        | `frontend/src/AddFilament.jsx` riadky 31 - 65                        | [https://rapidapi.com/guides/upload-files-react-axios](https://rapidapi.com/guides/upload-files-react-axios)                                                                                                               |\n| Príspevok _\"Get the data received in a Flask request\"_ na Stack Overflow | bkoiki950                                                                                         | `backend/main.py` riadok 118                                         | [https://stackoverflow.com/a/69941645](https://stackoverflow.com/a/69941645)                                                                                                                                               |\n| Hlavná ikonka stránky                                                    | Freepik                                                                                           | `frontend/src/images/icon.png` \u003c/br\u003e`frontend/public/favicon.ico`    | [https://www.flaticon.com/free-icon/3d-printing-filament_2442882](https://www.flaticon.com/free-icon/3d-printing-filament_2442882)                                                                                         |\n| Ikonka pre chýbajúci obrázok                                             | Vectorink                                                                                         | `backend/images/filaments/unknown.png`                               | [https://en.m.wikipedia.org/wiki/File:Icon-round-Question_mark.svg](https://en.m.wikipedia.org/wiki/File:Icon-round-Question_mark.svg)                                                                                     |\n| Ostatné použité ikonky                                                   | Ilham Fitroutul Hayat                                                                             | `frontend/src/images/edit.png` \u003c/br\u003e`frontend/src/images/delete.png` | [https://www.flaticon.com/search?author_id=448\u0026style_id=1223](https://www.flaticon.com/search?author_id=448\u0026style_id=1223)                                                                                                 |\n| Obrázky filamentov                                                       | Bambu Lab EU \u003c/br\u003ePlasty Mladeč \u003c/br\u003eeSun \u003c/br\u003eMajkl3D-Technology s.r.o. \u003c/br\u003ePrusa Research a.s. | Všetky súbory v priečinku `backend/images/filaments`                 | [eu.store.bambulab.com](eu.store.bambulab.com) \u003c/br\u003e [www.filament-pm.cz](www.filament-pm.cz) \u003c/br\u003e [esun3dstoreeu.com](esun3dstoreeu.com) \u003c/br\u003e [www.majkl3d.sk](www.majkl3d.sk) \u003c/br\u003e [www.prusa3d.com](www.prusa3d.com) |\n\n---\n\n**Upozornenie**\n\nTento repozitár obsahuje moje riešenia zadaní, prípadne semestrálnej práce  \nKód je zverejnený výhradne na vzdelávacie účely ako inšpirácia pre ostatných  \n**Použitie tohto kódu na odovzdanie ako vlastné riešenie (plagiátorstvo) je prísne zakázané** a môže viesť k disciplinárnym opatreniam  \nAk si z tohto repozitára beriete inšpiráciu, uistite sa, že rozumiete riešeniam a vytvorte si vlastnú implementáciu  \nAutor nenesie zodpovednosť za akékoľvek následky vyplývajúce z nesprávneho použitia tohto materiálu, vrátane prípadných obvinení z plagiátorstva\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyprich%2Ffilamenty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyprich%2Ffilamenty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyprich%2Ffilamenty/lists"}