<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl">
	<id>https://jak.mazovia.edu.pl/index.php?action=history&amp;feed=atom&amp;title=Prvn%C3%AD_kroky_s_API%3A_praktick%C3%BD_pr%C5%AFvodce_pro_za%C4%8D%C3%A1te%C4%8Dn%C3%ADky</id>
	<title>První kroky s API: praktický průvodce pro začátečníky - Historia wersji</title>
	<link rel="self" type="application/atom+xml" href="https://jak.mazovia.edu.pl/index.php?action=history&amp;feed=atom&amp;title=Prvn%C3%AD_kroky_s_API%3A_praktick%C3%BD_pr%C5%AFvodce_pro_za%C4%8D%C3%A1te%C4%8Dn%C3%ADky"/>
	<link rel="alternate" type="text/html" href="https://jak.mazovia.edu.pl/index.php?title=Prvn%C3%AD_kroky_s_API:_praktick%C3%BD_pr%C5%AFvodce_pro_za%C4%8D%C3%A1te%C4%8Dn%C3%ADky&amp;action=history"/>
	<updated>2026-09-13T22:41:29Z</updated>
	<subtitle>Historia wersji tej strony wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://jak.mazovia.edu.pl/index.php?title=Prvn%C3%AD_kroky_s_API:_praktick%C3%BD_pr%C5%AFvodce_pro_za%C4%8D%C3%A1te%C4%8Dn%C3%ADky&amp;diff=103201&amp;oldid=prev</id>
		<title>AlyssaCarbone o 18:58, 21 sie 2026</title>
		<link rel="alternate" type="text/html" href="https://jak.mazovia.edu.pl/index.php?title=Prvn%C3%AD_kroky_s_API:_praktick%C3%BD_pr%C5%AFvodce_pro_za%C4%8D%C3%A1te%C4%8Dn%C3%ADky&amp;diff=103201&amp;oldid=prev"/>
		<updated>2026-08-21T18:58:21Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;pl&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← poprzednia wersja&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Wersja z 18:58, 21 sie 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Linia 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při práci s více jazyky narazíte také &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rozdíly &lt;/del&gt;v &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;datech&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;číslech a měnách. Formát data „03/04/2025&quot; znamená v češtině 3. dubna&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;v angličtině 4. března. Proto nikdy netvrďte formát ručně&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale používejte funkce pro lokalizaci z vaší knihovny&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Stejně tak desetinná čárka&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mezery mezi tisíci &lt;/del&gt;nebo &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;symbol měny se liší&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Všechny &lt;/del&gt;tyto &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;hodnoty by měly být součástí lokalizačního systému, ne pevně zapsané v kódu&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Uživatele byste tím zmátli &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;v některých případech by mohli nesprávně interpretovat důležité údaje&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pro celkové rozvržení stránky sáhněte po Gridu&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Definujte si základní mřížku pomocí grid-template-columns: repeat(auto-fit, minmax(250px&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;1fr))&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tento trik zajistí&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že se sloupce automaticky přizpůsobí šířce obrazovky bez jediného media query&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Můžete tak mít tři sloupce na desktopu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dva na tabletu &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jeden na mobilu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aniž byste psali jediný řádek kódu navíc&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jen si dejte pozor, aby minimální šířka nebyla příliš velká &lt;/del&gt;– &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pak by na malých displejích zůstávaly jen jeden až dva sloupce&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;což nemusí být vždy žádoucí&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud &lt;/del&gt;jde o &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;strukturu projektu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;neházejte všechno do jednoho souboru&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Rozdělte kód &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;moduly – oddělte routes&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;controllers a služby pro práci &lt;/del&gt;s &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;daty. Tím získáte přehlednost a usnadníte si testování. Pro menší &lt;/del&gt;API &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;stačí i tři soubory&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale pro větší projekty &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dobré zavést složkovou strukturu. Důležité je taky myslet na CORS – pokud vaše &lt;/del&gt;API &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;budou volat prohlížeče z jiné domény&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;musíte povolit příslušné hlavičky, jinak požadavky skončí chybou&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při samotném psaní zdrojových textů myslete na délku&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Česká věta je často delší než anglická&lt;/del&gt;, a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pokud máte tlačítko &lt;/del&gt;s &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pevnou šířkou, text se ořízne&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vždy testujte&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jak se překlad chová v extrémních případech — nejdelší slovo&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nejdelší věta, nejdelší číslo s jednotkou&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Stejně tak pozor na složené výrazy. V češtině skloňujeme&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;takže věta „Máte 3 nové zprávy&quot; se nedá jednoduše poskládat &lt;/del&gt;z &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;částí „Máte&quot; + číslo + „nové zprávy&quot;&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Používejte raději celé věty &lt;/del&gt;s &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;placeholdery, než abyste spojovali kusy textu podle počtu&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dalším častým problémem &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kódování a speciální znaky&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud používáte soubory s překlady&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vždy &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ukládejte v UTF-8&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jinak se diakritika rozsype&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Stejně tak si dejte pozor &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;apostrofy a uvozovky — v některých formátech se musí escapovat&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;a pokud to uděláte špatně&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aplikace spadne&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Před nasazením si vždy spusťte automatizovaný test&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který ověří&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že všechny klíče existují ve všech jazycích a že žádný soubor neobsahuje syntaktickou chybu. Tím odhalíte problém dřív, než se dostane k uživatelům&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Když začnete do jednoho projektu přidávat druhý nebo třetí jazyk, rychle zjistíte, že chaos vzniká spíš z organizace než z překladu samotného&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejčastější chybou &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ukládat texty přímo do zdrojového kódu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ať už jde o web, mobilní aplikaci &lt;/del&gt;nebo &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;desktopový nástroj&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jakmile potřebujete změnit jednu větu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;musíte hledat v desítkách souborů &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;riskujete, že něco přehlédnete&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Mnohem lepší je oddělit veškeré texty od logiky aplikace &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;držet &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;v jednotném formátu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který podporuje klíče a hodnoty&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejprve &lt;/del&gt;si &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vyberte jedno jednoduché &lt;/del&gt;veřejné API, které &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vás zajímá – třeba pro počasí, kurzy měn &lt;/del&gt;nebo &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;seznam států&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;K tomu budete potřebovat &lt;/del&gt;nástroj pro &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;testování požadavků, jako je nástroj příkazové řádky nebo grafický klient. Klíčové je naučit se číst dokumentaci. Každé API má popis koncových bodů &lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;adres, na které se posílají požadavky), povolené metody (GET, POST, PUT, DELETE&lt;/del&gt;) a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;parametry&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vyzkoušejte si nejprve GET požadavek&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který pouze získává data – je nejbezpečnější a nezpůsobí žádné změny.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Na závěr – testujte. Není nutné psát stovky testů&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale pokryjte alespoň hlavní endpointy a ošetření chyb&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;K tomu se hodí nástroje &lt;/del&gt;jako &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Supertest, které vám umožní simulovat HTTP požadavky &lt;/del&gt;bez &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;spuštění serveru&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pozor si dejte na time-outy u asynchronních operací a na správné ukončení serveru po testech&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jinak &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vám procesy zablokují. S trochou disciplíny a dodržováním těchto zásad bude vaše REST API stabilní a &lt;/del&gt;snadno &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rozšiřitelné&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Třetí úskalí spočívá v tom&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že lidé často spouští kontejnery interaktivně bez náležitého přepínače&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud potřebujete vejít do běžícího kontejneru &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;prozkoumat ho&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;použijte docker exec -it název_kontajneru sh. Bez -it se nedostanete &lt;/del&gt;do &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;interaktivního shellu a budete jen bezradně koukat na výstup&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Také &lt;/del&gt;si &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zvykněte na pravidelný úklid: příkaz docker system prune smaže nepoužívané obrazy&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kontejnery &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sítě, čímž uvolní místo na disku&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Naopak &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vyvarujte mazání kontejnerů, které právě běží – vždy je nejprve zastavte příkazem docker stop&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Návrh routes a práce se status kódy Při návrhu routes se držte REST konvencí. Používejte podstatná jména v množném čísle (například /users)&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vyhněte se slovesům a akce odvozujte od HTTP metod. GET pro čtení&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;POST pro vytvoření&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;PUT nebo PATCH pro úpravu a DELETE &lt;/del&gt;pro &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mazání&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Zásadní je vracet správné HTTP status kódy – 200 pro úspěch&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;201 pro vytvoření&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;400 pro chybný požadavek&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;404 pro nenalezený zdroj &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;500 pro interní chybu. Častou chybou je vracet 200 i při chybě&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;což klientovi znemožní rozlišit úspěch od selhání&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Další důležitou oblastí jsou činnosti, které nejsou &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;první pohled vidět. Patří sem čtení dokumentace, hledání chyb &lt;/ins&gt;v &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;závislostech&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ladění konfigurace&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;optimalizace výkonu&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;řešení problémů s verzovacím systémem nebo komunikace s kolegy ohledně rozhraní&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Mnoho vývojářů tyto položky do odhadu nezahrnuje&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;protože je považuje za samozřejmost &lt;/ins&gt;nebo &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;si je neuvědomují&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Přitom právě &lt;/ins&gt;tyto &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;činnosti často způsobují zpoždění&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Stanovte si pravidlo: ke každému většímu úkolu připočítejte 20–30 % času navíc na neočekávané problémy &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;na činnosti, které nejsou vidět na první pohled&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jakmile máte první odpověď, zkuste si ji rozebrat&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;JSON vypadá jako vnořené objekty a pole&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kde ke každé hodnotě vede klíč&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Například u počasí to může být klíč pro teplotu&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vlhkost nebo popis&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Abyste s daty mohli pracovat&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;je vhodné je uložit do proměnné &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;postupně z ní vytahovat jednotlivé hodnoty. Většina moderních jazyků má pro JSON zabudovanou podporu&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;takže nemusíte psát žádný složitý parser&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Důležité je naučit se číst dokumentaci API &lt;/ins&gt;– &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tam najdete seznam dostupných endpointů&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;povinné parametry a strukturu odpovědí&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Když se řekne API, mnoho začátečníků si představí něco složitého, čemu rozumí jen programátoři. Přitom &lt;/ins&gt;jde o &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rozhraní&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které umožňuje dvěma aplikacím spolu komunikovat&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;V praxi to znamená, že můžete z vlastního kódu posílat požadavky &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vzdálený server a získávat z něj data, aniž byste museli rozumět tomu, jak server funguje uvnitř. Nejlepší způsob&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jak se &lt;/ins&gt;s API &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;naučit pracovat&lt;/ins&gt;, je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;začít s jednoduchým veřejným &lt;/ins&gt;API, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které nevyžaduje registraci ani autentizaci&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nakonec si osvojte pravidlo zpětné vazby&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Po dokončení úkolu si poznamenejte&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kolik času jste skutečně strávili &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které činnosti vám zabraly nejvíc. Porovnejte to &lt;/ins&gt;s &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;odhadem&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Postupně zjistíte&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kde jsou vaše slepá místa – jestli podceňujete testování&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dokumentaci nebo řešení závislostí&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tímto způsobem se odhady zlepšují přirozeně&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;bez stresu &lt;/ins&gt;z &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nesplněných termínů&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nezapomeňte, že odhad je vždy jen pravděpodobnostní – ale &lt;/ins&gt;s &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vědomým zahrnutím skrytých činností budete mnohem blíž realitě&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Častou chybou &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;také odhadování času pouze na základě „čisté&quot; práce, tedy bez přestávek, schůzek, e-mailů nebo řešení naléhavých požadavků&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;I když se snažíte být soustředění&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;realita &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;taková&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že váš pracovní den není jen programování. Zahrňte do odhadu i čas na přepínání kontextu&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud máte &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;úkol vyčleněné dva dny&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale každý den máte dvě hodiny schůzek&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;efektivní pracovní doba je jen šest hodin denně&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Odhad by měl vycházet z reálné kapacity&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ne z toho&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kolik hodin byste chtěli strávit&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Užitečné funkce a tipy pro efektivní testy Kromě základního použití pytest nabízí i pokročilejší funkce&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejužitečnější &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;fixture&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který umožňuje připravit data &lt;/ins&gt;nebo &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;objekty před testem a uklidit po něm. Fixture definujete dekorátorem @pytest.fixture a funkci pak použijete jako parametr testovací funkce&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Například pokud testujete databázi&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;fixture může vytvořit dočasnou databázi &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;po testu ji smazat&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;To udržuje testy nezávislé &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rychlé. Další užitečnou funkcí &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;parametrize&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;která umožňuje spustit stejný test s různými vstupními hodnotami – díky ní nemusíte psát mnoho podobných funkcí&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejlepší způsob, jak začít, je vyzkoušet &lt;/ins&gt;si veřejné API, které &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nevyžaduje registraci &lt;/ins&gt;nebo &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;klíč&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Otevři si &lt;/ins&gt;nástroj pro &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vývojáře v prohlížeči &lt;/ins&gt;(&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;klávesa F12&lt;/ins&gt;) a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;přejdi do záložky Konzole&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Do příkazového řádku napiš příkaz pro získání dat&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;třeba z API&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které poskytuje aktuální čas nebo počasí&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Použij metody &lt;/ins&gt;jako &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;fetch nebo axios – v konzoli prohlížeče funguje &lt;/ins&gt;bez &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dalšího nastavení&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Po odeslání požadavku uvidíš odpověď ve formátu JSON, což je strukturovaný text&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který &lt;/ins&gt;se snadno &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;čte i zpracovává&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Praktický tip: začněte s malým projektem&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který má jasný cíl&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Například aplikace, která načte seznam uživatelů &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zobrazí jejich jména. Postupně přidávejte funkce – filtrování, řazení&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zápis &lt;/ins&gt;do &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;souboru&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tím &lt;/ins&gt;si &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;osvojíte nejen volání API&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale i zpracování dat &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;práci s chybami&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vyhnete &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tak frustraci z příliš složitého zadání na začátku&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jak si vytvořit rezervu&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aniž byste vypadali neschopně Nejlepší způsob&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jak skryté činnosti zohlednit&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;je vytvořit si strukturovaný seznam „typických vedlejších činností&quot; &lt;/ins&gt;pro &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;svůj projekt&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Například: každá integrace s cizím API zabere navíc čas na testování chybových stavů&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;každá změna databázového schématu vyžaduje migraci a otestování starých dat&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;každé uživatelské rozhraní musí projít kontrolou v různých prohlížečích. Pokud máte tento seznam&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;můžete si ho projít při každém odhadu &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rychle doplnit položky&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které byste jinak opomněli&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>AlyssaCarbone</name></author>
	</entry>
	<entry>
		<id>https://jak.mazovia.edu.pl/index.php?title=Prvn%C3%AD_kroky_s_API:_praktick%C3%BD_pr%C5%AFvodce_pro_za%C4%8D%C3%A1te%C4%8Dn%C3%ADky&amp;diff=102995&amp;oldid=prev</id>
		<title>AlbertaMagoffin o 18:56, 21 sie 2026</title>
		<link rel="alternate" type="text/html" href="https://jak.mazovia.edu.pl/index.php?title=Prvn%C3%AD_kroky_s_API:_praktick%C3%BD_pr%C5%AFvodce_pro_za%C4%8D%C3%A1te%C4%8Dn%C3%ADky&amp;diff=102995&amp;oldid=prev"/>
		<updated>2026-08-21T18:56:51Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;pl&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← poprzednia wersja&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Wersja z 18:56, 21 sie 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Linia 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Samotné zpracování požadavku obvykle zahrnuje &lt;/del&gt;práci s &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;daty. Pokud nepoužíváte žádnou databázi, alespoň si data ukládejte do paměti nebo do souboru. V praxi ale &lt;/del&gt;narazíte na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;problém&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že po restartu serveru všechna &lt;/del&gt;data &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zmizí&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Proto je lepší od začátku použít nějakou perzistentní vrstvu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;třeba SQLite pro lokální vývoj&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při práci s daty nezapomínejte na validaci vstupů&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nikdy nevěřte datům&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;která přijdou &lt;/del&gt;z &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;venku&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Bez validace riskujete neošetřené chyby&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které mohou shodit celý server&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nebo dokonce umožnit neoprávněný přístup&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejčastější chyby při stavbě REST API Jednou z nejčastějších chyb je nesprávné nastavení stavových kódů&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Výchozí odpověď serveru je 200&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale to neznamená&lt;/del&gt;, že &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ji máte používat pro všechno. Pokud &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pokusíte vytvořit nový záznam, vraťte 201&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud požadovaný zdroj neexistuje&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vraťte 404. Při chybě &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;straně serveru pak 500. Správné kódy klientovi umožní rychle diagnostikovat problém &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vyhnout se zbytečnému pátrání v logách. Dalším častým problémem je zapomínání &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;middleware pro zpracování chyb. V Expressu stačí přidat speciální handler&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který se stará o chyby vzniklé v asynchronním &lt;/del&gt;kódu. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Bez něho se chyba projeví jako nečitelný stack trace&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který se dostane &lt;/del&gt;až &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;k uživateli&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejčastější chyby&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kterým se vyhnout Jednou z nejčastějších chyb je zapomenutí &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;hlavičky požadavku&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Mnoho &lt;/del&gt;API &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vyžaduje v hlavičce specifikovat formát odpovědi&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;obvykle Content-Type: application/json. Pokud to neuvedeš, můžeš dostat odpověď ve formátu XML nebo dokonce chybu&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Další častou chybou &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ignorování rychlostních limitů. Veřejná &lt;/del&gt;API &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mívají omezení na počet dotazů za minutu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;takže pokud budeš posílat &lt;/del&gt;požadavky &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;příliš rychle, server tě může dočasně zablokovat. Vždy si přečti sekci o limitech a respektuj je&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Na co si dát pozor při konfiguraci a prvních krocích Častým omylem &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;instalovat IDE &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;hned začít psát&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aniž byste nastavili správný interpret Pythonu&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;V důsledku pak narazíte na to&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že vám nefungují importy nebo &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nespouští skripty. Vždy si ověřte&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že IDE používá stejný Python jako váš projekt&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nejlépe ten z virtuálního prostředí&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Většina moderních nástrojů umí virtuální prostředí vytvořit a aktivovat samo&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale je třeba to v nastavení povolit&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ignorování této části vede k záhadným chybám&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které nemají s vaším kódem nic společného&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Když se řekne API, mnoho začátečníků si představí něco složitého &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nedostupného&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Přitom jde o jednoduchý koncept: API &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rozhraní&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které umožňuje dvěma programům spolu komunikovat&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Můžeš &lt;/del&gt;si &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ho představit jako číšníka &lt;/del&gt;v &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;restauraci – objednáš jídlo (pošleš požadavek) &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;on ti donese výsledek (odpověď)&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pro první kroky nemusíš mít žádné speciální nástroje&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;stačí ti prohlížeč &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;textový editor&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při práci s API se také vyvaruj tvrdému zakódování adres a klíčů &lt;/del&gt;přímo do kódu&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. Pro klíče používej proměnné prostředí&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které se nastavují mimo zdrojový kód. Jinak riskuješ, že se tvoje klíče dostanou na veřejnost&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pokud kód sdílíš &lt;/del&gt;nebo &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nahraješ na internet&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Stejně tak si zvykni na zpracování chyb – vždy ošetři situaci&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kdy API neodpovídá podle očekávání&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Používej bloky try-catch nebo .catch()&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;abys program nespadl při chybě sítě&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nakonec nezapomeňte licenci správně aplikovat &lt;/del&gt;– &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;obvykle vložením textu licence do repozitáře a komentáře do hlaviček zdrojových souborů&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Aktualizujte ji&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pokud &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;změní podmínky projektu&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;A vždy si ověřte&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zda licence&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kterou jste zvolili&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;je kompatibilní s knihovnami&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které sám používáte&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dobrý výběr na začátku ušetří mnoho nepříjemností později&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pozor na rozdíl mezi silným &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;slabým copyleftem&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Silný copyleft (GPL) &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vztahuje i na díla&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;která váš kód pouze propojují&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Slabý copyleft (LGPL) umožňuje použití v proprietárním softwaru za předpokladu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že úpravy samotné knihovny zůstanou volné&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tento rozdíl je zásadní zejména pro vývojáře knihoven &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;frameworků&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při výběru se zaměřte také na to&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jak snadno lze prostředí rozšířit&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Potřebujete&lt;/del&gt;-&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;li podporu pro jiné jazyky nebo nástroje, zkontrolujte, zda existují oficiální pluginy&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vyhněte &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale instalování desítek rozšíření hned &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;začátku&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;protože každé z nich zpomaluje start &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;může způsobovat konflikty&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Začněte s minimem a přidávejte jen to&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co skutečně využíváte. Ušetříte si starosti s nekompatibilitou a přehlednost si udržíte i ve složitějších projektech&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Praktické doporučení: použijte &lt;/del&gt;REST, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;když je vaše API jednoduché, málo &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mění &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;hlavním konzumentem je webový prohlížeč&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;GraphQL volte tehdy&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;když máte heterogenní klienty (mobil&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;desktop&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;IoT)&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;potřebujete agregovat data z mikroservis nebo chcete minimalizovat přenos dat u pomalých mobilních sítí&lt;/del&gt;. Častou chybou je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kombinovat obojí v jednom projektu bez jasného pravidla – pak ztrácíte výhody obou&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při &lt;/ins&gt;práci s &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;více jazyky &lt;/ins&gt;narazíte &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;také &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rozdíly v datech&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;číslech a měnách. Formát &lt;/ins&gt;data &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;„03/04/2025&quot; znamená v češtině 3&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dubna&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;v angličtině 4&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;března&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Proto nikdy netvrďte formát ručně&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale používejte funkce pro lokalizaci &lt;/ins&gt;z &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vaší knihovny&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Stejně tak desetinná čárka&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mezery mezi tisíci nebo symbol měny se liší. Všechny tyto hodnoty by měly být součástí lokalizačního systému&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ne pevně zapsané v kódu. Uživatele byste tím zmátli a v některých případech by mohli nesprávně interpretovat důležité údaje&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pro celkové rozvržení stránky sáhněte po Gridu&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Definujte si základní mřížku pomocí grid-template-columns: repeat(auto-fit, minmax(250px&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;1fr)). Tento trik zajistí&lt;/ins&gt;, že se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sloupce automaticky přizpůsobí šířce obrazovky bez jediného media query&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Můžete tak mít tři sloupce na desktopu&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dva &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tabletu &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jeden &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mobilu&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aniž byste psali jediný řádek &lt;/ins&gt;kódu &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;navíc&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jen si dejte pozor&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aby minimální šířka nebyla příliš velká – pak by na malých displejích zůstávaly jen jeden &lt;/ins&gt;až &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dva sloupce, což nemusí být vždy žádoucí&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud jde o strukturu projektu&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;neházejte všechno do jednoho souboru. Rozdělte kód &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;moduly – oddělte routes, controllers a služby pro práci s daty. Tím získáte přehlednost a usnadníte si testování&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pro menší &lt;/ins&gt;API &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;stačí i tři soubory&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale pro větší projekty je dobré zavést složkovou strukturu&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Důležité &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;taky myslet na CORS – pokud vaše &lt;/ins&gt;API &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;budou volat prohlížeče z jiné domény, musíte povolit příslušné hlavičky&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jinak &lt;/ins&gt;požadavky &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;skončí chybou&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při samotném psaní zdrojových textů myslete na délku. Česká věta &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;často delší než anglická, &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pokud máte tlačítko s pevnou šířkou&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;text se ořízne&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vždy testujte&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jak &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;překlad chová v extrémních případech — nejdelší slovo&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nejdelší věta&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nejdelší číslo s jednotkou. Stejně tak pozor na složené výrazy&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;V češtině skloňujeme&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;takže věta „Máte 3 nové zprávy&quot; se nedá jednoduše poskládat z částí „Máte&quot; + číslo + „nové zprávy&quot;&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Používejte raději celé věty s placeholdery&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;než abyste spojovali kusy textu podle počtu&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dalším častým problémem je kódování &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;speciální znaky&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud používáte soubory s překlady, vždy &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ukládejte v UTF-8&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jinak se diakritika rozsype&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Stejně tak &lt;/ins&gt;si &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dejte pozor na apostrofy a uvozovky — &lt;/ins&gt;v &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;některých formátech se musí escapovat, &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pokud to uděláte špatně, aplikace spadne&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Před nasazením si vždy spusťte automatizovaný test, který ověří&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že všechny klíče existují ve všech jazycích &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že žádný soubor neobsahuje syntaktickou chybu. Tím odhalíte problém dřív, než se dostane k uživatelům&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Když začnete do jednoho projektu přidávat druhý nebo třetí jazyk, rychle zjistíte, že chaos vzniká spíš z organizace než z překladu samotného. Nejčastější chybou je ukládat texty &lt;/ins&gt;přímo do &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zdrojového &lt;/ins&gt;kódu, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ať už jde o web&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mobilní aplikaci &lt;/ins&gt;nebo &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;desktopový nástroj&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jakmile potřebujete změnit jednu větu, musíte hledat v desítkách souborů a riskujete&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že něco přehlédnete&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Mnohem lepší je oddělit veškeré texty od logiky aplikace a držet je v jednotném formátu&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který podporuje klíče a hodnoty&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejprve si vyberte jedno jednoduché veřejné API, které vás zajímá &lt;/ins&gt;– &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;třeba pro počasí, kurzy měn nebo seznam států&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;K tomu budete potřebovat nástroj pro testování požadavků&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jako je nástroj příkazové řádky nebo grafický klient. Klíčové je naučit &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;číst dokumentaci&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Každé API má popis koncových bodů (adres, na které se posílají požadavky)&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;povolené metody (GET&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;POST&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;PUT&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;DELETE) a parametry&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vyzkoušejte si nejprve GET požadavek, který pouze získává data – je nejbezpečnější a nezpůsobí žádné změny&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Na závěr – testujte. Není nutné psát stovky testů, ale pokryjte alespoň hlavní endpointy &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ošetření chyb&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;K tomu &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;hodí nástroje jako Supertest&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které vám umožní simulovat HTTP požadavky bez spuštění serveru&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pozor si dejte na time-outy u asynchronních operací a na správné ukončení serveru po testech&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jinak se vám procesy zablokují&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;S trochou disciplíny a dodržováním těchto zásad bude vaše REST API stabilní &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;snadno rozšiřitelné&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Třetí úskalí spočívá v tom&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že lidé často spouští kontejnery interaktivně bez náležitého přepínače&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud potřebujete vejít do běžícího kontejneru a prozkoumat ho, použijte docker exec &lt;/ins&gt;-&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;it název_kontajneru sh&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Bez -it &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nedostanete do interaktivního shellu a budete jen bezradně koukat na výstup. Také si zvykněte &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pravidelný úklid: příkaz docker system prune smaže nepoužívané obrazy&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kontejnery &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sítě, čímž uvolní místo na disku&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Naopak se vyvarujte mazání kontejnerů&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které právě běží – vždy je nejprve zastavte příkazem docker stop&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Návrh routes a práce se status kódy Při návrhu routes se držte &lt;/ins&gt;REST &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;konvencí. Používejte podstatná jména v množném čísle (například /users)&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vyhněte &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;slovesům &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;akce odvozujte od HTTP metod&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;GET pro čtení&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;POST pro vytvoření, PUT nebo PATCH pro úpravu a DELETE pro mazání. Zásadní je vracet správné HTTP status kódy – 200 pro úspěch&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;201 pro vytvoření&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;400 pro chybný požadavek&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;404 pro nenalezený zdroj a 500 pro interní chybu&lt;/ins&gt;. Častou chybou je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vracet 200 i při chybě, což klientovi znemožní rozlišit úspěch od selhání&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>AlbertaMagoffin</name></author>
	</entry>
	<entry>
		<id>https://jak.mazovia.edu.pl/index.php?title=Prvn%C3%AD_kroky_s_API:_praktick%C3%BD_pr%C5%AFvodce_pro_za%C4%8D%C3%A1te%C4%8Dn%C3%ADky&amp;diff=102941&amp;oldid=prev</id>
		<title>Carmon7098 o 18:56, 21 sie 2026</title>
		<link rel="alternate" type="text/html" href="https://jak.mazovia.edu.pl/index.php?title=Prvn%C3%AD_kroky_s_API:_praktick%C3%BD_pr%C5%AFvodce_pro_za%C4%8D%C3%A1te%C4%8Dn%C3%ADky&amp;diff=102941&amp;oldid=prev"/>
		<updated>2026-08-21T18:56:24Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;pl&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← poprzednia wersja&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Wersja z 18:56, 21 sie 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Linia 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při psaní životopisu se vyhněte výčtu všech technologií&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které jste „zkusili&quot;&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Místo toho uveďte tři až pět jazyků nebo frameworků&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ve kterých se opravdu vyznáte&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ke každému přidejte konkrétní příklad&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kde jste ho použili&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Například: „Vytvořil jsem e-shop v Reactu &lt;/del&gt;s &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;napojením &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;REST API&quot; je mnohem přesvědčivější než „znám React&quot;&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Stejně tak zdůrazněte měkké dovednosti&lt;/del&gt;, které &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;firmy hledají: schopnost číst cizí kód&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;komunikovat v týmu &lt;/del&gt;nebo &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;se učit nové věci. Tyto dovednosti často rozhodují víc než samotná znalost jazyků&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dalším krokem &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vytvoření portfolia&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nemusí jít o rozsáhlé projekty – stačí tři až pět menších aplikací&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které ukážou&lt;/del&gt;, že &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;umíte pracovat s daty&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rozhraními a řešit běžné problémy&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Důležité je&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aby každý projekt byl dokončený a nasazený na veřejném hostingu&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Personalisté i techničtí vedoucí ocení, když si můžou aplikaci vyzkoušet online, ne jen prohlížet kód &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;GitHubu. Nezapomeňte ke každému projektu přidat krátký popis: co řeší, jaké technologie používáte a jaké výzvy jste překonali&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Jakmile si vyzkoušíš první dotaz, začni zkoumat dokumentaci daného API. Tam najdeš, jaké adresy (endpointy) používat, jaké parametry lze zadat &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jaké metody HTTP &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;používají&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pro začátečníky &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;klíčové pochopit rozdíl mezi GET (získání dat) a POST (odeslání dat). Začni pouze s GET požadavky, protože jsou bezpečné a nezpůsobí žádné změny &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;serveru&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Věnuj pozornost také stavovým kódům odpovědí – kód 200 znamená úspěch&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;404 stránka nenalezena, 500 chyba serveru.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Na pohovoru &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;připravte na to, že budete vysvětlovat své projekty&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Neříkejte jen, že jste je vytvořili – popište, jakou architekturu jste zvolili, s jakými problémy jste &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;setkali a jak jste je vyřešili. Očekávejte také otázky na základní algoritmy a datové struktury&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;třeba na třídění pole nebo složitost operací. Pokud něco nevíte, přiznejte to a vysvětlete, jak byste postupovali při hledání odpovědi – schopnost učit &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;je u juniorů důležitější než znalosti zpaměti&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nakonec vše změřte znovu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ideálně &lt;/del&gt;z &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;více zařízení a připojení. Nestačí se dívat &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rychlost z rychlého domácího internetu – otestujte si web i z mobilu s pomalejším připojením&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Buďte trpěliví&lt;/del&gt;: &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;optimalizace není jednorázová akce, ale průběžná péče&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Sledujte&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které změny přinesly největší efekt, a podle toho upravujte další postup. I malé zlepšení rychlosti může znamenat vyšší spokojenost uživatelů a lepší pozice &lt;/del&gt;ve &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;výsledcích vyhledávání&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Nejlepší způsob, jak začít, &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vyzkoušet si veřejné &lt;/del&gt;API, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které nevyžaduje registraci nebo klíč&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Otevři &lt;/del&gt;si &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nástroj pro vývojáře v prohlížeči (klávesa F12) &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;přejdi do záložky Konzole. Do příkazového řádku napiš příkaz pro získání dat, třeba z API, které poskytuje aktuální čas nebo počasí. Použij metody jako fetch nebo axios – v konzoli prohlížeče funguje bez dalšího nastavení. Po odeslání požadavku uvidíš odpověď ve formátu JSON, což &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;strukturovaný text, který se snadno čte i zpracovává&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Posledním tipem &lt;/del&gt;je začít &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;s malým projektem&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jako je jednoduchá aplikace, která zobrazí aktuální teplotu pro zadané město&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Postupně přidávej další funkce: ukládání historie&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;filtrování dat &lt;/del&gt;nebo &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;automatické obnovování&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tím &lt;/del&gt;si &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;osvojíš práci s API přirozenou cestou &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vyhneš se zbytečnému stresu&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Neboj se experimentovat a číst chybové hlášky – obsahují užitečné informace&lt;/del&gt;, které &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tě nasměrují k řešení&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Když se řekne API, mnoho začátečníků si představí něco složitého a nedostupného. Přitom jde o jednoduchý koncept: API je rozhraní, které umožňuje dvěma programům spolu komunikovat. Můžeš si ho představit jako číšníka v restauraci – objednáš jídlo (pošleš požadavek) a on ti donese výsledek (odpověď). Pro první kroky nemusíš mít žádné speciální nástroje, stačí ti prohlížeč a textový editor.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Mezi typické chyby patří nevyužití mezipaměti prohlížeče&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Když nastavíte správné hlavičky&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nemusí &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;opakovaně stahovat stejné logo&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;styly &lt;/del&gt;nebo &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;skripty&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;U dynamického obsahu &lt;/del&gt;si &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale rozmyslete&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co necháte ukládat &lt;/del&gt;– &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;například osobní údaje nebo košík by &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ukládat neměly&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pomocí atributů rel=&quot;preload&quot; &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rel=&quot;preconnect&quot; můžete prohlížeči napovědět&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co načíst přednostně&lt;/del&gt;, a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;urychlit tím vykreslení první obrazovky&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Při &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;psaní testů myslete &lt;/del&gt;na to, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že jsou to také kód&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Udržujte je čisté&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pojmenujte je podle toho&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co ověřují&lt;/del&gt;, a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nebojte se je refaktorovat&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dobrý test by měl být nezávislý na konkrétním pořadí spouštění&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;neměl by sdílet stav &lt;/del&gt;s &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jinými testy &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;měl by obsahovat jen jedno hlavní tvrzení&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vám daří udržet pyramidu stabilní&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;získáte rychlou zpětnou vazbu a bezpečí pro další změny&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Samotné zpracování požadavku obvykle zahrnuje práci s daty. Pokud nepoužíváte žádnou databázi&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;alespoň si data ukládejte do paměti nebo do souboru&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;V praxi ale narazíte na problém&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že po restartu serveru všechna data zmizí&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Proto je lepší od začátku použít nějakou perzistentní vrstvu&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;třeba SQLite pro lokální vývoj&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při práci &lt;/ins&gt;s &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;daty nezapomínejte &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;validaci vstupů. Nikdy nevěřte datům, která přijdou z venku&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Bez validace riskujete neošetřené chyby&lt;/ins&gt;, které &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mohou shodit celý server&lt;/ins&gt;, nebo &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dokonce umožnit neoprávněný přístup&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejčastější chyby při stavbě REST API Jednou z nejčastějších chyb &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nesprávné nastavení stavových kódů&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Výchozí odpověď serveru je 200&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale to neznamená&lt;/ins&gt;, že &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ji máte používat pro všechno. Pokud se pokusíte vytvořit nový záznam&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vraťte 201&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud požadovaný zdroj neexistuje&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vraťte 404&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při chybě &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;straně serveru pak 500&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Správné kódy klientovi umožní rychle diagnostikovat problém &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vyhnout &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zbytečnému pátrání v logách&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dalším častým problémem &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zapomínání &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;middleware pro zpracování chyb&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;V Expressu stačí přidat speciální handler&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;stará o chyby vzniklé v asynchronním kódu&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Bez něho &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;chyba projeví jako nečitelný stack trace&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dostane až k uživateli&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejčastější chyby&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kterým se vyhnout Jednou &lt;/ins&gt;z &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nejčastějších chyb je zapomenutí &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;hlavičky požadavku&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Mnoho API vyžaduje v hlavičce specifikovat formát odpovědi, obvykle Content-Type&lt;/ins&gt;: &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;application/json&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud to neuvedeš&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;můžeš dostat odpověď &lt;/ins&gt;ve &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;formátu XML nebo dokonce chybu&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Další častou chybou &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ignorování rychlostních limitů. Veřejná &lt;/ins&gt;API &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mívají omezení na počet dotazů za minutu, takže pokud budeš posílat požadavky příliš rychle&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;server tě může dočasně zablokovat&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vždy &lt;/ins&gt;si &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;přečti sekci o limitech &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;respektuj &lt;/ins&gt;je.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Na co si dát pozor při konfiguraci a prvních krocích Častým omylem &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;instalovat IDE a hned &lt;/ins&gt;začít &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;psát&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aniž byste nastavili správný interpret Pythonu&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;V důsledku pak narazíte na to&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že vám nefungují importy &lt;/ins&gt;nebo &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;se nespouští skripty&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vždy &lt;/ins&gt;si &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ověřte, že IDE používá stejný Python jako váš projekt, nejlépe ten z virtuálního prostředí. Většina moderních nástrojů umí virtuální prostředí vytvořit &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aktivovat samo, ale je třeba to v nastavení povolit&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ignorování této části vede k záhadným chybám&lt;/ins&gt;, které &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nemají s vaším kódem nic společného&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Když se řekne API, mnoho začátečníků si představí něco složitého a nedostupného. Přitom jde o jednoduchý koncept: API je rozhraní, které umožňuje dvěma programům spolu komunikovat. Můžeš si ho představit jako číšníka v restauraci – objednáš jídlo (pošleš požadavek) a on ti donese výsledek (odpověď). Pro první kroky nemusíš mít žádné speciální nástroje, stačí ti prohlížeč a textový editor.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při práci s API se také vyvaruj tvrdému zakódování adres a klíčů přímo do kódu. Pro klíče používej proměnné prostředí, které se nastavují mimo zdrojový kód&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jinak riskuješ&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tvoje klíče dostanou na veřejnost&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pokud kód sdílíš &lt;/ins&gt;nebo &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nahraješ na internet&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Stejně tak &lt;/ins&gt;si &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zvykni na zpracování chyb – vždy ošetři situaci, kdy API neodpovídá podle očekávání. Používej bloky try-catch nebo .catch()&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;abys program nespadl při chybě sítě.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Nakonec nezapomeňte licenci správně aplikovat &lt;/ins&gt;– &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;obvykle vložením textu licence do repozitáře a komentáře do hlaviček zdrojových souborů. Aktualizujte ji, pokud &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;změní podmínky projektu&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;A vždy si ověřte, zda licence, kterou jste zvolili, je kompatibilní s knihovnami, které sám používáte. Dobrý výběr na začátku ušetří mnoho nepříjemností později.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Pozor na rozdíl mezi silným &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;slabým copyleftem. Silný copyleft (GPL) se vztahuje i na díla&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;která váš kód pouze propojují. Slabý copyleft (LGPL) umožňuje použití v proprietárním softwaru za předpokladu&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že úpravy samotné knihovny zůstanou volné. Tento rozdíl je zásadní zejména pro vývojáře knihoven &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;frameworků&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Při &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;výběru se zaměřte také &lt;/ins&gt;na to, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jak snadno lze prostředí rozšířit&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Potřebujete-li podporu pro jiné jazyky nebo nástroje&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zkontrolujte&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zda existují oficiální pluginy. Vyhněte se ale instalování desítek rozšíření hned na začátku&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;protože každé z nich zpomaluje start &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;může způsobovat konflikty&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Začněte s minimem a přidávejte jen to&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co skutečně využíváte. Ušetříte si starosti &lt;/ins&gt;s &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nekompatibilitou &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;přehlednost si udržíte i ve složitějších projektech&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Praktické doporučení: použijte REST, když je vaše API jednoduché, málo &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mění a hlavním konzumentem je webový prohlížeč. GraphQL volte tehdy, když máte heterogenní klienty (mobil, desktop, IoT)&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;potřebujete agregovat data z mikroservis nebo chcete minimalizovat přenos dat u pomalých mobilních sítí. Častou chybou je kombinovat obojí v jednom projektu bez jasného pravidla – pak ztrácíte výhody obou&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Carmon7098</name></author>
	</entry>
	<entry>
		<id>https://jak.mazovia.edu.pl/index.php?title=Prvn%C3%AD_kroky_s_API:_praktick%C3%BD_pr%C5%AFvodce_pro_za%C4%8D%C3%A1te%C4%8Dn%C3%ADky&amp;diff=102557&amp;oldid=prev</id>
		<title>HenriettaBrownbi o 18:52, 21 sie 2026</title>
		<link rel="alternate" type="text/html" href="https://jak.mazovia.edu.pl/index.php?title=Prvn%C3%AD_kroky_s_API:_praktick%C3%BD_pr%C5%AFvodce_pro_za%C4%8D%C3%A1te%C4%8Dn%C3%ADky&amp;diff=102557&amp;oldid=prev"/>
		<updated>2026-08-21T18:52:50Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;pl&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← poprzednia wersja&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Wersja z 18:52, 21 sie 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Linia 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jak na první požadavek a běžné chyby Pro první pokus zkuste poslat jednoduchý GET požadavek&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;V jazyce Python to zvládnete s knihovnou requests&lt;/del&gt;, v &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;JavaScriptu pak &lt;/del&gt;s &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;fetch&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Například &lt;/del&gt;v &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pythonu stačí napsat příkaz, který odešle požadavek a vytiskne odpověď&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Důležité &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zpracovat odpověď jako JSON &lt;/del&gt;– &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;většinou pomocí metody .json(). Ujistěte se&lt;/del&gt;, že &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;máte přidělený API klíč&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pokud &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;potřeba&lt;/del&gt;, a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že ho posíláte v hlavičce&lt;/del&gt;, ne &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;v adrese&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Častou chybou je zapomenout na limit počtu požadavků – mnoho služeb má omezení&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;takže pokud testujete ve smyčce, snadno překročíte povolený počet &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dostanete blokaci&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Důležité je také sledovat historii&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Každý tým má jinou rychlost &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jiné schopnosti&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Proto si zaznamenávejte, kolik času jednotlivé typy úkolů zabraly v minulosti, &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tyto údaje používejte jako základ pro budoucí odhady&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud se vám to zdá zdlouhavé&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;začněte s jednoduchým seznamem úkolů &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;reálného času&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Po pár projektech uvidíte vzorce&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které vám pomohou přesněji plánovat. Vyhnete se tak opakovaným chybám a zároveň budete schopni lépe komunikovat s vedením či klienty&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Prakticky &lt;/del&gt;to &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vypadá tak&lt;/del&gt;, že &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pro funkci&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;která sčítá dvě čísla&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;napíšete test&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který ověří součet kladných čísel, ale také součet &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;záporným číslem &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;součet s nulou&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Každý scénář by měl být samostatný test. Tím získáte přehled o tom&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který konkrétní případ selhává&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Mnoho začátečníků dělá chybu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že testy píší až po dokončení funkce &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;snaží &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pokrýt všechno najednou. Lepší &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;psát testy průběžně, klidně dřív &lt;/del&gt;než &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;samotnou implementaci – pak vám testy ukazují, co má funkce dělat&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při práci s debuggerem se nebojte použít breakpointy místo tisku proměnných do konzole. Moderní IDE vám umožní procházet kód řádek po řádku&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sledovat hodnoty v reálném čase &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;podmíněně zastavit běh&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;To je zvlášť užitečné při hledání logických chyb&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Zároveň si dejte pozor na automatické formátování&lt;/del&gt;: &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pokud používáte nástroj jako je Black&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nastavte jej tak&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aby nesahalo do kódu proti vaší vůli&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Je &lt;/del&gt;lepší &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;formátovat vědomě než nechat IDE měnit strukturu bez vašeho vědomí, což vede ke zbytečným změnám v repositáři&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při práci s odpověďmi &lt;/del&gt;si &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;všímejte struktury dat. Často jsou data vnořená – třeba objekt obsahuje pole&lt;/del&gt;, které &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;obsahuje další objekty&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pomocí indexů a klíčů se k jednotlivým hodnotám dostanete, ale je snadné udělat chybu &lt;/del&gt;v &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;názvu klíče &lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;např. velká písmena&lt;/del&gt;)&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. Doporučuji si odpověď nejprve vytisknout v plném znění &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;prozkoumat ji&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jakmile víte&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co přesně &lt;/del&gt;API &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vrací&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;můžete data snadno zpracovat &lt;/del&gt;– &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;třeba &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;uložit do proměnné nebo vykreslit do šablony&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Na závěr si osvojte jednoduchou zásadu: když test poprvé spustíte&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;měl by selhat&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud hned projde&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pravděpodobně jste ho napsali špatně&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Zkuste test spustit &lt;/del&gt;s &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;očekávanou chybou, třeba s nulou místo čísla, &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sledujte, co &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;stane&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Až test projde, zkuste do funkce úmyslně vložit chybu &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ověřte, že test skutečně selže. Tento postup vám potvrdí, že test opravdu testuje to, co má. Psaní prvního unit testu není žádná věda &lt;/del&gt;– &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;stačí začít u malé&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;čisté funkce a postupně si osvojit pravidlo: jeden test, jedna kontrola, jedno očekávání&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nakonec si uvědomte, že odhad není závazek, ale nástroj pro plánování. &lt;/del&gt;Když se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;odhad liší od skutečnosti&lt;/del&gt;, je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;to příležitost ke zlepšení procesu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ne k obviňování&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pravidelně porovnávejte odhadnuté &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;skutečné časy a najděte příčiny odchylek&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Díky tomu se vaše odhady budou postupně zpřesňovat. S trochou trpělivosti a disciplíny se z odhadování stane dovednost&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;která vašemu týmu ušetří spoustu stresu &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;práce přesčas&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Další pastí je nedostatečné ošetření chyb&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;API nejsou vždy stabilní a odpověď &lt;/del&gt;nemusí &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;být vždy stejná. Vždy kontrolujte status kód – 200 znamená úspěch&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;404 znamená nenalezeno, 401 &lt;/del&gt;nebo &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;403 pak problém s autorizací&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Použijte podmínky, které na základě statusu zobrazí příslušné hlášení. Vyhnete se tak situaci, kdy se váš program zhroutí, protože měl očekávat data, &lt;/del&gt;ale &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;přišel jen chybový objekt. Začněte s jedním endpointem&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;otestujte různé vstupy a sledujte, jak &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mění výstup&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Prvním krokem je určit si, které funkce jsou pro vás klíčové. Pokud jste začátečník, potřebujete hlavně zvýraznění syntaxe, jednoduché spouštění kódu &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rychlé odhalení chyb. Naopak pokud pracujete na větším projektu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;oceníte integrovaný debugger&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;podporu verzovacích systémů &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;automatické dokončování kódu. Dejte si pozor na přehnané množství pluginů – každá instalace navíc zvyšuje nároky na výkon a může zpomalit prostředí. Začněte s čistou instalací a přidávejte jen to, co opravdu využijete&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Na co se zaměřit při plánování &lt;/del&gt;Při &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;plánování nezapomínejte &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;režii&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;která s vývojem přímo nesouvisí&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Patří sem schůzky&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;e-mailová komunikace&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code review&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;testování &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nasazování. Pokud tyto činnosti nezahrnete, odhad bude vždy nízký. Doporučuji si na ně vyhradit alespoň 20 % času navíc. Dalším faktorem &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tzv&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Bus faktor. Pokud &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;projektu pracuje &lt;/del&gt;jen &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jeden specialista na určitou oblast, jeho nepřítomnost může projekt zastavit&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Proto počítejte s tím&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že lidé mohou být nemocní, mít dovolenou nebo řešit jiné úkoly&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při psaní životopisu se vyhněte výčtu všech technologií, které jste „zkusili&quot;. Místo toho uveďte tři až pět jazyků nebo frameworků, ve kterých se opravdu vyznáte&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ke každému přidejte konkrétní příklad&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kde jste ho použili. Například: „Vytvořil jsem e-shop &lt;/ins&gt;v &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Reactu &lt;/ins&gt;s &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;napojením na REST API&quot; je mnohem přesvědčivější než „znám React&quot;&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Stejně tak zdůrazněte měkké dovednosti, které firmy hledají: schopnost číst cizí kód, komunikovat &lt;/ins&gt;v &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;týmu nebo se učit nové věci. Tyto dovednosti často rozhodují víc než samotná znalost jazyků&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Dalším krokem &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vytvoření portfolia. Nemusí jít o rozsáhlé projekty &lt;/ins&gt;– &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;stačí tři až pět menších aplikací, které ukážou&lt;/ins&gt;, že &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;umíte pracovat s daty&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rozhraními a řešit běžné problémy. Důležité &lt;/ins&gt;je, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aby každý projekt byl dokončený &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nasazený na veřejném hostingu. Personalisté i techničtí vedoucí ocení, když si můžou aplikaci vyzkoušet online&lt;/ins&gt;, ne &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jen prohlížet kód na GitHubu&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nezapomeňte ke každému projektu přidat krátký popis: co řeší&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jaké technologie používáte &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jaké výzvy jste překonali&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jakmile si vyzkoušíš první dotaz, začni zkoumat dokumentaci daného API&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tam najdeš, jaké adresy (endpointy) používat, jaké parametry lze zadat &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jaké metody HTTP se používají&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pro začátečníky je klíčové pochopit rozdíl mezi GET (získání dat) &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;POST (odeslání dat)&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Začni pouze s GET požadavky&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;protože jsou bezpečné &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nezpůsobí žádné změny na serveru&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Věnuj pozornost také stavovým kódům odpovědí – kód 200 znamená úspěch, 404 stránka nenalezena&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;500 chyba serveru&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Na pohovoru se připravte na &lt;/ins&gt;to, že &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;budete vysvětlovat své projekty. Neříkejte jen&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že jste je vytvořili – popište&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jakou architekturu jste zvolili&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;s jakými problémy jste &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;setkali &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jak jste je vyřešili&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Očekávejte také otázky na základní algoritmy a datové struktury&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;třeba na třídění pole nebo složitost operací&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud něco nevíte&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;přiznejte to &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vysvětlete, jak byste postupovali při hledání odpovědi – schopnost učit &lt;/ins&gt;se je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;u juniorů důležitější &lt;/ins&gt;než &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;znalosti zpaměti&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nakonec vše změřte znovu&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ideálně z více zařízení &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;připojení&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nestačí se dívat na rychlost z rychlého domácího internetu – otestujte si web i z mobilu s pomalejším připojením&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Buďte trpěliví&lt;/ins&gt;: &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;optimalizace není jednorázová akce, ale průběžná péče. Sledujte&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které změny přinesly největší efekt&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;a podle toho upravujte další postup&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;I malé zlepšení rychlosti může znamenat vyšší spokojenost uživatelů a &lt;/ins&gt;lepší &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pozice ve výsledcích vyhledávání&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejlepší způsob, jak začít, je vyzkoušet &lt;/ins&gt;si &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;veřejné API&lt;/ins&gt;, které &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nevyžaduje registraci nebo klíč&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Otevři si nástroj pro vývojáře &lt;/ins&gt;v &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;prohlížeči &lt;/ins&gt;(&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;klávesa F12&lt;/ins&gt;) a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;přejdi do záložky Konzole&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Do příkazového řádku napiš příkaz pro získání dat&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;třeba z &lt;/ins&gt;API, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které poskytuje aktuální čas nebo počasí. Použij metody jako fetch nebo axios &lt;/ins&gt;– &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;v konzoli prohlížeče funguje bez dalšího nastavení. Po odeslání požadavku uvidíš odpověď ve formátu JSON, což &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;strukturovaný text, který se snadno čte i zpracovává&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Posledním tipem je začít s malým projektem, jako je jednoduchá aplikace&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;která zobrazí aktuální teplotu pro zadané město&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Postupně přidávej další funkce: ukládání historie&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;filtrování dat nebo automatické obnovování&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tím si osvojíš práci &lt;/ins&gt;s &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;API přirozenou cestou &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vyhneš &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zbytečnému stresu&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Neboj se experimentovat &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;číst chybové hlášky &lt;/ins&gt;– &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;obsahují užitečné informace&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které tě nasměrují k řešení&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Když se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;řekne API&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mnoho začátečníků si představí něco složitého a nedostupného. Přitom jde o jednoduchý koncept: API &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rozhraní&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které umožňuje dvěma programům spolu komunikovat&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Můžeš si ho představit jako číšníka v restauraci – objednáš jídlo (pošleš požadavek) &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;on ti donese výsledek (odpověď)&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pro první kroky nemusíš mít žádné speciální nástroje&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;stačí ti prohlížeč &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;textový editor&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Mezi typické chyby patří nevyužití mezipaměti prohlížeče&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Když nastavíte správné hlavičky, &lt;/ins&gt;nemusí &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;se opakovaně stahovat stejné logo&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;styly &lt;/ins&gt;nebo &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;skripty&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;U dynamického obsahu si &lt;/ins&gt;ale &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rozmyslete&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co necháte ukládat – například osobní údaje nebo košík by &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ukládat neměly&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pomocí atributů rel=&quot;preload&quot; &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rel=&quot;preconnect&quot; můžete prohlížeči napovědět&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co načíst přednostně&lt;/ins&gt;, a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;urychlit tím vykreslení první obrazovky&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Při &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;psaní testů myslete &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;to&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že jsou to také kód&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Udržujte je čisté&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pojmenujte je podle toho&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co ověřují&lt;/ins&gt;, a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nebojte se &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;refaktorovat&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dobrý test by měl být nezávislý &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;konkrétním pořadí spouštění, neměl by sdílet stav s jinými testy a měl by obsahovat &lt;/ins&gt;jen &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jedno hlavní tvrzení&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud se vám daří udržet pyramidu stabilní&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;získáte rychlou zpětnou vazbu a bezpečí pro další změny&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>HenriettaBrownbi</name></author>
	</entry>
	<entry>
		<id>https://jak.mazovia.edu.pl/index.php?title=Prvn%C3%AD_kroky_s_API:_praktick%C3%BD_pr%C5%AFvodce_pro_za%C4%8D%C3%A1te%C4%8Dn%C3%ADky&amp;diff=101705&amp;oldid=prev</id>
		<title>SharronBrowning: Utworzono nową stronę &quot;Jak na první požadavek a běžné chyby Pro první pokus zkuste poslat jednoduchý GET požadavek. V jazyce Python to zvládnete s knihovnou requests, v JavaScriptu pak s fetch. Například v Pythonu stačí napsat příkaz, který odešle požadavek a vytiskne odpověď. Důležité je zpracovat odpověď jako JSON – většinou pomocí metody .json(). Ujistěte se, že máte přidělený API klíč, pokud je potřeba, a že ho posíláte v hlavičce, ne v adre…&quot;</title>
		<link rel="alternate" type="text/html" href="https://jak.mazovia.edu.pl/index.php?title=Prvn%C3%AD_kroky_s_API:_praktick%C3%BD_pr%C5%AFvodce_pro_za%C4%8D%C3%A1te%C4%8Dn%C3%ADky&amp;diff=101705&amp;oldid=prev"/>
		<updated>2026-08-21T18:45:29Z</updated>

		<summary type="html">&lt;p&gt;Utworzono nową stronę &amp;quot;Jak na první požadavek a běžné chyby Pro první pokus zkuste poslat jednoduchý GET požadavek. V jazyce Python to zvládnete s knihovnou requests, v JavaScriptu pak s fetch. Například v Pythonu stačí napsat příkaz, který odešle požadavek a vytiskne odpověď. Důležité je zpracovat odpověď jako JSON – většinou pomocí metody .json(). Ujistěte se, že máte přidělený API klíč, pokud je potřeba, a že ho posíláte v hlavičce, ne v adre…&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nowa strona&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Jak na první požadavek a běžné chyby Pro první pokus zkuste poslat jednoduchý GET požadavek. V jazyce Python to zvládnete s knihovnou requests, v JavaScriptu pak s fetch. Například v Pythonu stačí napsat příkaz, který odešle požadavek a vytiskne odpověď. Důležité je zpracovat odpověď jako JSON – většinou pomocí metody .json(). Ujistěte se, že máte přidělený API klíč, pokud je potřeba, a že ho posíláte v hlavičce, ne v adrese. Častou chybou je zapomenout na limit počtu požadavků – mnoho služeb má omezení, takže pokud testujete ve smyčce, snadno překročíte povolený počet a dostanete blokaci.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Důležité je také sledovat historii. Každý tým má jinou rychlost a jiné schopnosti. Proto si zaznamenávejte, kolik času jednotlivé typy úkolů zabraly v minulosti, a tyto údaje používejte jako základ pro budoucí odhady. Pokud se vám to zdá zdlouhavé, začněte s jednoduchým seznamem úkolů a reálného času. Po pár projektech uvidíte vzorce, které vám pomohou přesněji plánovat. Vyhnete se tak opakovaným chybám a zároveň budete schopni lépe komunikovat s vedením či klienty.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Prakticky to vypadá tak, že pro funkci, která sčítá dvě čísla, napíšete test, který ověří součet kladných čísel, ale také součet se záporným číslem a součet s nulou. Každý scénář by měl být samostatný test. Tím získáte přehled o tom, který konkrétní případ selhává. Mnoho začátečníků dělá chybu, že testy píší až po dokončení funkce a snaží se pokrýt všechno najednou. Lepší je psát testy průběžně, klidně dřív než samotnou implementaci – pak vám testy ukazují, co má funkce dělat.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Při práci s debuggerem se nebojte použít breakpointy místo tisku proměnných do konzole. Moderní IDE vám umožní procházet kód řádek po řádku, sledovat hodnoty v reálném čase a podmíněně zastavit běh. To je zvlášť užitečné při hledání logických chyb. Zároveň si dejte pozor na automatické formátování: pokud používáte nástroj jako je Black, nastavte jej tak, aby nesahalo do kódu proti vaší vůli. Je lepší formátovat vědomě než nechat IDE měnit strukturu bez vašeho vědomí, což vede ke zbytečným změnám v repositáři.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Při práci s odpověďmi si všímejte struktury dat. Často jsou data vnořená – třeba objekt obsahuje pole, které obsahuje další objekty. Pomocí indexů a klíčů se k jednotlivým hodnotám dostanete, ale je snadné udělat chybu v názvu klíče (např. velká písmena). Doporučuji si odpověď nejprve vytisknout v plném znění a prozkoumat ji. Jakmile víte, co přesně API vrací, můžete data snadno zpracovat – třeba je uložit do proměnné nebo vykreslit do šablony.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Na závěr si osvojte jednoduchou zásadu: když test poprvé spustíte, měl by selhat. Pokud hned projde, pravděpodobně jste ho napsali špatně. Zkuste test spustit s očekávanou chybou, třeba s nulou místo čísla, a sledujte, co se stane. Až test projde, zkuste do funkce úmyslně vložit chybu a ověřte, že test skutečně selže. Tento postup vám potvrdí, že test opravdu testuje to, co má. Psaní prvního unit testu není žádná věda – stačí začít u malé, čisté funkce a postupně si osvojit pravidlo: jeden test, jedna kontrola, jedno očekávání.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Nakonec si uvědomte, že odhad není závazek, ale nástroj pro plánování. Když se odhad liší od skutečnosti, je to příležitost ke zlepšení procesu, ne k obviňování. Pravidelně porovnávejte odhadnuté a skutečné časy a najděte příčiny odchylek. Díky tomu se vaše odhady budou postupně zpřesňovat. S trochou trpělivosti a disciplíny se z odhadování stane dovednost, která vašemu týmu ušetří spoustu stresu a práce přesčas.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Další pastí je nedostatečné ošetření chyb. API nejsou vždy stabilní a odpověď nemusí být vždy stejná. Vždy kontrolujte status kód – 200 znamená úspěch, 404 znamená nenalezeno, 401 nebo 403 pak problém s autorizací. Použijte podmínky, které na základě statusu zobrazí příslušné hlášení. Vyhnete se tak situaci, kdy se váš program zhroutí, protože měl očekávat data, ale přišel jen chybový objekt. Začněte s jedním endpointem, otestujte různé vstupy a sledujte, jak se mění výstup.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Prvním krokem je určit si, které funkce jsou pro vás klíčové. Pokud jste začátečník, potřebujete hlavně zvýraznění syntaxe, jednoduché spouštění kódu a rychlé odhalení chyb. Naopak pokud pracujete na větším projektu, oceníte integrovaný debugger, podporu verzovacích systémů a automatické dokončování kódu. Dejte si pozor na přehnané množství pluginů – každá instalace navíc zvyšuje nároky na výkon a může zpomalit prostředí. Začněte s čistou instalací a přidávejte jen to, co opravdu využijete.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Na co se zaměřit při plánování Při plánování nezapomínejte na režii, která s vývojem přímo nesouvisí. Patří sem schůzky, e-mailová komunikace, code review, testování a nasazování. Pokud tyto činnosti nezahrnete, odhad bude vždy nízký. Doporučuji si na ně vyhradit alespoň 20 % času navíc. Dalším faktorem je tzv. Bus faktor. Pokud na projektu pracuje jen jeden specialista na určitou oblast, jeho nepřítomnost může projekt zastavit. Proto počítejte s tím, že lidé mohou být nemocní, mít dovolenou nebo řešit jiné úkoly.&lt;/div&gt;</summary>
		<author><name>SharronBrowning</name></author>
	</entry>
</feed>