{"id":486337,"date":"2026-07-06T11:33:40","date_gmt":"2026-07-06T11:33:40","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=486337"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=486337","title":{"rendered":"Query\u2011first \u043f\u043e\u0434\u0445\u043e\u0434 \u0438\u043b\u0438\u00a0\u043a\u0430\u043a\u00a0\u0438\u0437\u00a0SQL \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u043b\u0438\u00a0MongoDB \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u043e\u0435 REST API"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/47b\/0a5\/1ad\/47b0a51ad6b0095233213f222b5274fe.png\" width=\"1542\" height=\"725\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/47b\/0a5\/1ad\/47b0a51ad6b0095233213f222b5274fe.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/47b\/0a5\/1ad\/47b0a51ad6b0095233213f222b5274fe.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u042f \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u0434\u0443\u043c\u0430\u043b \u043e\u0431\u00a0\u043e\u0434\u043d\u043e\u0439 \u0432\u0440\u043e\u0434\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439, \u043d\u043e\u00a0\u043d\u0430\u00a0\u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0438\u0437\u0440\u044f\u0434\u043d\u043e, \u043f\u043e\u00a0\u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u043c\u0435\u043d\u044f, \u0434\u043e\u0441\u0442\u0430\u0432\u0448\u0435\u0439 backend\u2011\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435.<\/p>\n<p>\u0412\u00a0\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442\u00a0\u043f\u043e\u0434\u0445\u043e\u0434\u0430, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u043e\u00a0\u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e, \u043c\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u0441\u00a0\u043a\u0430\u043a\u0438\u043c\u0438 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f REST \u0441\u0435\u0440\u0432\u0438\u0441. \u041d\u043e\u00a0\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a\u00a0\u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u00a0\u043b\u0438\u0448\u044c \u043a\u0430\u043a\u00a0\u043e\u0434\u0438\u043d \u0438\u0437\u00a0\u044d\u0442\u0430\u043f\u043e\u0432 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043b\u043e\u0438\u0441\u0442\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\/\u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430\u00a0\u043e\u043f\u044b\u0442, \u0432\u0441\u0451\u00a0\u0436\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u0440\u0443\u0447\u043d\u0443\u044e \u0441\u0431\u043e\u0440\u043a\u0443 \u043e\u0434\u043d\u0438\u0445 \u0438 \u0442\u0435\u0445\u00a0\u0436\u0435 \u0441\u043b\u043e\u0451\u0432 \u043f\u043e\u00a0\u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0434\u043e\u043c\u0435\u043d\u0443, \u043d\u0435\u00a0\u0433\u043e\u0432\u043e\u0440\u044f \u0443\u0436\u0435 \u043e\u00a0\u043d\u0435\u0439\u043c\u0438\u043d\u0433\u0435 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432, \u0445\u0435\u043d\u0434\u043b\u0435\u0440\u043e\u0432, \u0445\u0435\u043b\u043f\u0435\u0440\u043e\u0432 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435&#8230; <\/p>\n<p>\u041f\u043e\u0447\u0442\u0438 \u0434\u043b\u044f\u00a0\u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0432\u043e\u0439 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442\u00a0\u0436\u0435 \u043f\u0443\u0442\u044c:<\/p>\n<p>\u2014 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f;<\/p>\n<p>\u2014 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0441\u043b\u043e\u0439;<\/p>\n<p>\u2014 \u0441\u043e\u0437\u0434\u0430\u0442\u044c HTTP handlers;<\/p>\n<p>\u2014 \u043e\u043f\u0438\u0441\u0430\u0442\u044c request \u0438 response \u043c\u043e\u0434\u0435\u043b\u0438;<\/p>\n<p>\u2014 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c auth \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u00a0\u0440\u043e\u043b\u044f\u043c\u0438 \u0434\u043b\u044f\u00a0\u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432;<\/p>\n<p>\u2014 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c\/\u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c OpenAPI spec;<\/p>\n<p>\u2014 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c curl\u2011\u043f\u0440\u0438\u043c\u0435\u0440\u044b; \/\/ \u043f\u043e\u00a0\u0436\u0435\u043b\u0430\u043d\u0438\u044e, \u043d\u043e\u00a0\u043c\u043d\u0435 \u0447\u0430\u0441\u0442\u043e \u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u00a0\u043d\u0438\u043c\u0438<\/p>\n<p>\u2014 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b;<\/p>\n<p>\u2014 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, Docker, health checks, auth \u0438 \u043a\u0443\u0447\u043a\u0443 middleware.<\/p>\n<p>\u0411\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u0438\u0437\u00a0\u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u00a0\u043f\u0440\u043e\u0435\u043a\u0442. \u0411\u0435\u0440\u044f \u0437\u0430\u00a0\u043e\u0441\u043d\u043e\u0432\u0443 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043c\u044b \u0434\u043e\u043b\u0433\u043e \u0442\u043e\u043f\u0447\u0435\u043c\u0441\u044f \u043d\u0430\u0434 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u0440\u044b\u0433\u0430\u044f \u043f\u043e\u00a0\u044d\u0442\u043e\u043c\u0443 snakeCase, \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0440\u0443\u044f \u043d\u0430\u0434 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0430, \u0445\u0435\u043b\u043f\u0435\u0440\u0430&#8230; \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u044f \u0443\u0436\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0441\u044c:).<\/p>\n<p>\u041f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u043a\u00a0\u043d\u0430\u0447\u0430\u043b\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f REST \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043a\u0430\u043a\u00a0\u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u043d\u0435\u043c\u043d\u043e\u0433\u043e:<\/p>\n<p>\u2014 spec\u2011first<\/p>\n<p>\u2014 code\u2011first<\/p>\n<p>\u2014 whateverIusedToDo\u2011first\u00a0\u2014 \u043a\u0430\u043a\u00a0\u043f\u0440\u0438\u0432\u044b\u043a, \u0442\u0430\u043a \u043f\u0438\u0448\u0443 + \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442\u00a0\u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0433\u043e\u0434\u044b \/\/ \u0441\u0430\u043c\u044b\u0439 \u0447\u0430\u0441\u0442\u044b\u0439 \u043d\u0435\u00a0\u043f\u0440\u0438\u0437\u043d\u0430\u043d\u043d\u044b\u0439, \u043d\u043e\u00a0\u0432\u0441\u0435\u043c\u0438 \u043b\u044e\u0431\u0438\u043c\u044b\u0439<\/p>\n<p>\u2014 <strong>query\u2011first<\/strong>\u00a0\u2014 \u043c\u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u043c\u043f\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043b, \u043d\u043e\u00a0\u0434\u0430\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u0445\u043e\u0434\u0443 (\u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u0432\u00a0\u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u0435 \u043d\u0435\u00a0\u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b \u0441\u0430\u043c\u00a0\u2014 \u043d\u0438 \u043d\u0430\u00a0\u0447\u0442\u043e\u00a0\u043d\u0435\u00a0\u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u044e \u0438 \u0433\u043e\u0442\u043e\u0432 \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u044c, \u043a\u043e\u043b\u0438 \u0443\u043a\u0430\u0436\u0435\u0442\u0435, \u0447\u0442\u043e\u00a0\u0442\u0430\u043a\u043e\u0435 \u0435\u0441\u0442\u044c) \u0432\u0434\u0440\u0443\u0433 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0432\u00a0\u044d\u0442\u043e\u043c \u0433\u043e\u0434\u0443&#8230;\u0430 \u043f\u043e\u0442\u043e\u043c \u0434\u043e\u043b\u0433\u043e \u043f\u0438\u0441\u0430\u043b \u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u043a \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430, \u0434\u0430-\u0434\u0430, \u043b\u044e\u0431\u043b\u044e \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0430\u043c&#8230;\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0434\u043e\u043b\u0433\u043e:).<\/p>\n<p><strong>\u0427\u0442\u043e\u00a0\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u044e query\u2011first<\/strong><\/p>\n<p>\u0418\u0434\u0435\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f: \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u00a0\u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0443\u0436\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e\u00a0\u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u00a0\u0442\u0435\u043c \u0438\u043b\u0438\u00a0\u0438\u043d\u044b\u043c json, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e (\u043f\u043e\u0447\u0442\u0438) \u0432\u0441\u0435\u0433\u043e REST \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f&#8230; \u041d\u0435\u00a0\u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u044e\u00a0\u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u043c \u043a\u0442\u043e \u044d\u0442\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b, \u0430\u00a0\u043c\u043e\u0436\u0435\u0442 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b, \u043d\u0443 \u0440\u0430\u0437\u0432\u0435 \u0447\u0442\u043e 1001\u044b\u043c:).<\/p>\n<p>\u0414\u043b\u044f\u00a0SQL \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">PostgreSQL schema + SQLC queries        \u2193Generated endpoint inventory        \u2193Repository \u2192 Service \u2192 HTTP handlers        \u2193http server \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \"\u043f\u0440\u0438\u043c\u043e\u0447\u043a\u0430\u043c\u0438\" + logging + OpenAPI + auth policies + tests + observability + docker + docker compose + ci\/cd<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0414\u043b\u044f\u00a0MongoDB \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438\u0434\u0435\u044f \u043f\u043e\u0445\u043e\u0436\u0430\u044f, \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043c\u0435\u0441\u0442\u043e SQLC \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u044f\u0432\u043d\u044b\u0435 YAML\u2011\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u044b:<\/p>\n<pre><code class=\"bash\">MongoDB collection contracts        \u2193Generated endpoint inventory        \u2193Repository \u2192 Service \u2192 HTTP handlers        \u2193http server \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \"\u043f\u0440\u0438\u043c\u043e\u0447\u043a\u0430\u043c\u0438\" + logging + OpenAPI + auth policies + tests + observability + docker + docker compose + ci\/cd<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>endpoint inventory\u00a0\u2014 \u044d\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u043d\u0430\u0435\u0442:<\/p>\n<p>\u2014 HTTP method \u0438 path;<\/p>\n<p>\u2014 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 SQL query \u0438\u043b\u0438\u00a0Mongo method;<\/p>\n<p>\u2014 path\/query\/body \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b;<\/p>\n<p>\u2014 auth policy;<\/p>\n<p>\u2014 \u0440\u043e\u043b\u0438;<\/p>\n<p>\u2014 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 routes \u0432\u0440\u043e\u0434\u0435 health, readiness, Swagger \u0438 metrics.<\/p>\n<p>\u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0437\u00a0\u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u043f\u0440\u0430\u0432\u0434\u044b. Handler, OpenAPI operation, curl\u2011\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0435\u0441\u0442 \u0438 auth policy \u043d\u0435\u00a0\u0434\u043e\u043b\u0436\u043d\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0443\u0433\u0430\u0434\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e\u00a0\u0442\u0430\u043a\u043e\u0435 endpoint. \u041e\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u0442\u0440\u043e\u0438\u0442\u044c\u0441\u044f \u0438\u0437\u00a0\u043e\u0434\u043d\u043e\u0433\u043e inventory.<\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u044f \u044d\u0442\u0443 \u0438\u0434\u0435\u044e \u0432\u00a0open\u2011source Go CLI \u043f\u043e\u0434\u00a0\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <a href=\"https:\/\/github.com\/repomz\/rest\" rel=\"noopener noreferrer nofollow\">rest<\/a>. \u041d\u0435\u00a0\u043c\u043e\u0433\u0443 \u043d\u0435\u00a0\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e\u00a0\u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0438\u043b \u043c\u0435\u043d\u044f \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0434\u0430\u0432\u043d\u0438\u0439 \u0437\u0430\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u0432\u0448\u0438\u0439 \u0441\u0435\u0431\u044f \u043f\u0440\u043e\u0435\u043a\u0442 <a href=\"https:\/\/sqlc.dev\/\" rel=\"noopener noreferrer nofollow\">sqlc<\/a>. <\/p>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0438\u043b \u043c\u0435\u043d\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0447\u0430\u0442\u044c, \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c, \u043d\u0430\u0447\u0430\u0442\u043e\u0435 \u0434\u0430\u0432\u043d\u043e \u0438 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0435\u043b\u0438\u0437. SQLC \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 SQL \u0432\u00a0type\u2011safe Go \u043a\u043e\u0434. <code>rest<\/code> \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433: \u0431\u0435\u0440\u0451\u0442 SQLC output \u0438\u043b\u0438\u00a0MongoDB contracts \u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u0445 \u0432\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u043e\u0435 \u0441\u043b\u043e\u0438\u0441\u0442\u043e\u0435 REST \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0426\u0435\u043b\u044c \u043d\u0435\u00a0\u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0442. \u0426\u0435\u043b\u044c \u043f\u0440\u043e\u0441\u0442\u0430\u044f\u00a0\u2014 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u00a0\u2014 \u0443\u0431\u0440\u0430\u0442\u044c \u0441\u043a\u0443\u0447\u043d\u0443\u044e \u0438 \u0441\u043a\u043b\u043e\u043d\u043d\u0443\u044e \u043a\u00a0\u043e\u0448\u0438\u0431\u043a\u0430\u043c \u0440\u0443\u0442\u0438\u043d\u0443, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u043b \u043d\u0435\u00a0\u0441\u00a0\u043f\u0443\u0441\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0438, \u0430\u00a0\u0441\u00a0\u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u043a\u0430\u0440\u043a\u0430\u0441\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u0438\u0441\u0430\u043b \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0443\u044e \u0431\u0438\u0437\u043d\u0435\u0441\u2011\u043b\u043e\u0433\u0438\u043a\u0443. \u0412\u00a0\u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0442\u044c \u043f\u043e\u0447\u0442\u0438 \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0412\u00a0\u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445\u00a0\u2014 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0441\u043d\u044f\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0435 80\u201390% \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0435\u0439\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u044b.<\/p>\n<h2>SQL \u043f\u0440\u0438\u043c\u0435\u0440<\/h2>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443:<\/p>\n<pre><code class=\"sql\">CREATE TABLE studies (    id              UUID PRIMARY KEY DEFAULT gen_random_uuid(),    created_at      TIMESTAMPTZ NOT NULL DEFAULT now(),    patient         TEXT NOT NULL,    study_type      TEXT NOT NULL,    time_beginning  TIMESTAMP,    surgeon         TEXT NOT NULL,    deleted         BOOLEAN NOT NULL DEFAULT FALSE);<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0418 sqlc query:<\/p>\n<pre><code class=\"sql\">-- name: GetStudies :manySELECT * FROM studiesWHERE deleted = false  AND (    sqlc.narg('type')::text IS NULL    OR study_type = sqlc.narg('type')  )  AND (    sqlc.narg('surgeon')::text IS NULL    OR surgeon = sqlc.narg('surgeon')  )ORDER BY time_beginning DESC;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0438\u0434\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>sqlc generate<\/code> \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u043b\u0438\u00a0\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u00a0\u0440\u0430\u043c\u043a\u0430\u0445 \u0441\u0430\u043c\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>rest gen<\/code> \u043f\u0440\u0438\u00a0\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043e\u043f\u0446\u0438\u0438 auto_sqlc: enable \u0432\u00a0\u0444\u0430\u0439\u043b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a rest.yaml<\/p>\n<p>SQLC \u0441\u043e\u0437\u0434\u0430\u0451\u0442 type\u2011safe Go \u043a\u043e\u0434 \u0434\u043b\u044f\u00a0\u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430. <code>rest<\/code> \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u00a0\u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 endpoint \u0432\u0440\u043e\u0434\u0435: <\/p>\n<pre><code class=\"markdown\">GET \/studies?type=CT&amp;surgeon=Ivanov<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 <code>sqlc.narg(...)<\/code> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f optional query parameters. Result type \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e response model \u0438 OpenAPI schema.<\/p>\n<h2>MongoDB \u043f\u0440\u0438\u043c\u0435\u0440<\/h2>\n<p>\u0414\u043b\u044f\u00a0MongoDB \u043d\u0435\u0442 \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0430 SQLC, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u044f\u0432\u043d\u044b\u0435 YAML\u2011\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u044b. Mongo contracts \u043b\u0435\u0436\u0430\u0442 \u0437\u0434\u0435\u0441\u044c: rest_config\/rest_mongo\/*.yaml.<\/p>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 entity file \u043c\u043e\u0436\u0435\u0442 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c:<\/p>\n<p>\u2014 collection name;<\/p>\n<p>\u2014 fields;<\/p>\n<p>\u2014 indexes;<\/p>\n<p>\u2014 CRUD methods;<\/p>\n<p>\u2014 custom methods \u0432\u0440\u043e\u0434\u0435 <code>find_one<\/code>, <code>find_many<\/code>, <code>update_one<\/code>, <code>delete_one<\/code> \u0438 <code>aggregate<\/code>;<\/p>\n<p>\u2014 HTTP path\/method mapping.<\/p>\n<p>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 Mongo app \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 repositories, services, handlers, OpenAPI, handler tests, auth middleware, Docker support \u0438 runtime health\/readiness paths. Mongo domain layer \u0441\u0434\u0435\u043b\u0430\u043d \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0433\u0438\u0431\u043a\u0438\u043c \u0434\u043b\u044f\u00a0document data.<\/p>\n<h2>\u0427\u0442\u043e\u00a0\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/h2>\n<p>\u0412\u00a0\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442\u00a0\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 rest.yaml \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <code>rest gen<\/code> \u043c\u043e\u0436\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c:<\/p>\n<p>\u2014 <code>cmd\/main.go<\/code>;<\/p>\n<p>\u2014 domain models;<\/p>\n<p>\u2014 PostgreSQL \u0438\u043b\u0438\u00a0MongoDB repositories;<\/p>\n<p>\u2014 service layer;<\/p>\n<p>\u2014 HTTP handlers;<\/p>\n<p>\u2014 request\/response models;<\/p>\n<p>\u2014 handler tests;<\/p>\n<p>\u2014 OpenAPI \u0438 Swagger UI;<\/p>\n<p>\u2014 JWT \u0438\u043b\u0438\u00a0Basic Auth;<\/p>\n<p>\u2014 RBAC route wrapping;<\/p>\n<p>\u2014 security headers;<\/p>\n<p>\u2014 rate limiting;<\/p>\n<p>\u2014 production\u2011safer CORS defaults;<\/p>\n<p>\u2014 request IDs;<\/p>\n<p>\u2014 panic recovery;<\/p>\n<p>\u2014 body size limits;<\/p>\n<p>\u2014 Zap logging;<\/p>\n<p>\u2014 optional Prometheus metrics;<\/p>\n<p>\u2014 Dockerfile;<\/p>\n<p>\u2014 optional Docker Compose;<\/p>\n<p>\u2014 <code>.env.example<\/code>;<\/p>\n<p>\u2014 Makefile;<\/p>\n<p>\u2014 init_db shell script \u0434\u043b\u044f\u00a0\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e postgres<\/p>\n<p>\u2014 CI\/CD workflow templates;<\/p>\n<p>\u2014 curl examples.<\/p>\n<p>\u2014 DEPLOYMENT.md next steps guide<\/p>\n<p>\u2014 ARCHITECTURE.md c \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0445\u0435\u043c\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/p>\n<p>\u2014 README \u0448\u0430\u0431\u043b\u043e\u043d \u0441\u00a0\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439 \u043f\u043e\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/p>\n<p>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 Go \u043a\u043e\u0434 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f\u00a0\u043b\u0438\u043d\u0442\u0435\u0440\u0430\u043c\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 imports \u0438 \u043e\u0431\u0449\u0438\u0439 \u0441\u0442\u0438\u043b\u044c \u043a\u043e\u0434\u0430 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043a\u00a0\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443.<\/p>\n<h2>Auth generation<\/h2>\n<p>Auth \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u0438\u0437\u00a0\u0441\u0430\u043c\u044b\u0445 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0434\u0438\u0437\u0430\u0439\u043d\u0430. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043a\u0430 2\u00a0\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 JWT \u0438 BasicAuth.<\/p>\n<p>Flow \u0442\u0430\u043a\u043e\u0439:<\/p>\n<p>1. \u0423\u043a\u0430\u0437\u0430\u0442\u044c <code>auth: enable<\/code> \u0432 <code>rest.yaml<\/code>.<\/p>\n<p>2. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c <code>rest gen<\/code>.<\/p>\n<p>3. \u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043d\u0430\u0439\u0434\u0451\u0442 endpoints \u0438 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 <code>rest_config\/auth_rest.yaml<\/code>.<\/p>\n<p>4. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 auth \u0438 \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u0442, \u043a\u0430\u043a\u0438\u0435 endpoints \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435, \u043a\u0430\u043a\u0438\u0435 \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u044b, \u0430\u00a0\u043a\u0430\u043a\u0438\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0440\u043e\u043b\u0438.<\/p>\n<p>5. \u0421\u043d\u043e\u0432\u0430 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c <code>rest gen<\/code>.<\/p>\n<p>6. \u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u043e\u0432\u0438\u0442 middleware, route wrapping, auth handlers \u0438 OpenAPI security.<\/p>\n<p>\u0414\u043b\u044f\u00a0SQL\/JWT \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c signup\/signin handlers, password hashing, token service, claims configuration \u0438 protected routes \u043d\u0430\u00a0\u043e\u0441\u043d\u043e\u0432\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 user model.<\/p>\n<p>\u0414\u043b\u044f\u00a0Basic Auth \u0438 Mongo apps \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 middleware \u0438 role checks.<\/p>\n<h2>rest doctor<\/h2>\n<p>\u0414\u0430, \u0438 \u0442\u0430\u043a\u0430\u044f \u0435\u0441\u0442\u044c \u0444\u0438\u0447\u0430. \u0415\u0451 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430\u00a0\u043b\u044e\u0431\u043e\u043c \u044d\u0442\u0430\u043f\u0435:<\/p>\n<p>\u2014 \u043f\u043e\u0441\u043b\u0435 <code>rest init<\/code>;<\/p>\n<p>\u2014 \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f YAML \u0444\u0430\u0439\u043b\u043e\u0432;<\/p>\n<p>\u2014 \u043f\u043e\u0441\u043b\u0435 <code>rest gen<\/code>;<\/p>\n<p>\u2014 \u043f\u0435\u0440\u0435\u0434 \u043f\u043e\u043f\u044b\u0442\u043a\u043e\u0439 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041e\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432, \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043d\u0443\u0436\u043d\u044b\u0445 tools, YAML\u2011\u043e\u0448\u0438\u0431\u043a\u0438, \u0433\u043e\u0442\u043e\u0432\u043d\u043e\u0441\u0442\u044c Docker, OpenAPI\/auth configuration, generated files \u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.<\/p>\n<p>\u042d\u0442\u043e \u043a\u0430\u043a\u00a0\u0440\u0430\u0437 \u0442\u0430 \u0432\u0435\u0449\u044c, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043d\u0435 \u043d\u0435\u00a0\u0445\u0432\u0430\u0442\u0430\u043b\u043e \u043c\u043d\u043e\u0433\u043e \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434, \u0432\u00a0\u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0443\u0442\u0438: \u043a\u043e\u043c\u0430\u043d\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0435\u0433\u043e \u043d\u0435\u00a0\u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0438 \u0447\u0442\u043e\u00a0\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435&#8230; \u0432 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438, \u043a\u0430\u043a\u00a0\u0441\u0435\u0439\u0447\u0430\u0441 \u043b\u044e\u0431\u043e\u0439 ai powered cli.<\/p>\n<h2>\u0427\u0442\u043e\u00a0\u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0435\u00a0\u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0448\u0438\u0442\u044c<\/h2>\n<p><code>rest<\/code> \u043d\u0435\u00a0\u0437\u043d\u0430\u0435\u0442 \u0432\u0430\u0448\u0443 \u0431\u0438\u0437\u043d\u0435\u0441\u2011\u043b\u043e\u0433\u0438\u043a\u0443.<\/p>\n<p>\u041e\u043d \u043d\u0435\u00a0\u0431\u0443\u0434\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c:<\/p>\n<p>\u2014 \u0441\u043b\u043e\u0436\u043d\u0443\u044e domain validation;<\/p>\n<p>\u2014 custom workflows;<\/p>\n<p>\u2014 billing logic;<\/p>\n<p>\u2014 external integrations;<\/p>\n<p>\u2014 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 transactions;<\/p>\n<p>\u2014 product\u2011specific authorization rules.<\/p>\n<p>\u2014 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 SQL query \u0441\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435\u00a0\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f <code>sqlc generate<\/code> \u0438\u043b\u0438 \u00ab\u043a\u0440\u0430\u0439\u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439\u00bb Mongo contract<\/p>\n<p>\u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043d\u0443\u0436\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0438\u043b\u044c\u043d\u0443\u044e \u0438 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0443\u044e \u0442\u043e\u0447\u043a\u0443. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u043e\u0431\u044b\u0447\u043d\u0443\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443. \u041a \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0443 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0435 domain models \u0438\u043b\u0438\u00a0queries, \u0434\u043b\u044f\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043d\u043e\u0432\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u0441\u043b\u043e\u0438 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u00a0\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u2014 \u043e\u0431\u00a0\u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u0442\u0441\u044f \u0441\u043a\u0440\u043e\u043c\u043d\u0430\u044f \u043e\u043f\u0446\u0438\u044f safe_reload: enable \u0438\u0437\u00a0rest.yaml, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043f\u0440\u043e\u0441\u0438\u0442 \u0432\u0430\u0441, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c\u00a0\u043b\u0438 \u0432\u0430\u0448 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u00a0\u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<h2>\u041a\u0430\u043a\u00a0\u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c<\/h2>\n<p>Install:<\/p>\n<pre><code class=\"bash\">go install github.com\/repomz\/rest\/cmd\/rest@latest<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>SQL \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code>rest init --example sql # \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0434\u043b\u044f sqlcrest gengo run .\/cmd\/main.go # go test .\/... <\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>MongoDB \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"bash\">rest init --example sql # \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0434\u043b\u044f sqlcrest gengo run .\/cmd\/main.go # go test .\/... <\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0439 workflow:<\/p>\n<pre><code class=\"bash\">rest init# \u0421\u043e\u0437\u0434\u0430\u0451\u0442 rest_config\/ \u0441 \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430.# \u041f\u0435\u0440\u0435\u0434 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0435\u0439 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c rest.yaml \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u044b:# SQLC schema\/queries \u0434\u043b\u044f PostgreSQL \u0438\u043b\u0438 YAML-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u044b \u0434\u043b\u044f MongoDB.rest gen go run .\/cmd\/main.go # go test .\/... <\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430\u00a0\u0441\u0445\u0435\u043c\u0443 \u0435\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432:<\/p>\n<pre><code class=\"bash\">rest list endpoints # \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0432\u0441\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0435\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b \u0441 \u0438\u0445 \u0442\u0435\u043a\u0443\u0449\u0438\u043c\u0438 \u043e\u043f\u0446\u0438\u044f\u043c\u0438<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0438\u043b\u0438\u00a0\u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432\u00a0swagger ui: http:\/\/localhost:8080\/swagger<\/p>\n<p>\u0412 README.md \u0432\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0436\u0434\u0430\u0442\u044c \u043f\u0430\u0440\u0430 \u0448\u0438\u043b\u044c\u0434\u0438\u043a\u043e\u0432 \u0438 \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"bash\">my-app\/\u251c\u2500\u2500 cmd\/\u2502   \u2514\u2500\u2500 main.go                  # entrypoint \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u251c\u2500\u2500 internal\/\u2502   \u251c\u2500\u2500 config\/                  # \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 env\/config\u2502   \u251c\u2500\u2500 db\/                      # SQLC models\/queries \u0438\u043b\u0438 Mongo client\u2502   \u251c\u2500\u2500 repository\/              # \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c\u2502   \u251c\u2500\u2500 service\/                 # \u0431\u0438\u0437\u043d\u0435\u0441-\u0441\u043b\u043e\u0439\u2502   \u251c\u2500\u2500 transport\/\u2502   \u2502   \u2514\u2500\u2500 http\/                # handlers, routes, middleware\u2502   \u251c\u2500\u2500 auth\/                    # JWT\/Basic Auth, RBAC\u2502   \u251c\u2500\u2500 logger\/                  # Zap logging\u2502   \u2514\u2500\u2500 observability\/           # health, readiness, metrics\u251c\u2500\u2500 api\/\u2502   \u2514\u2500\u2500 openapi.yaml             # Swagger\/OpenAPI \u0441\u0445\u0435\u043c\u0430\u251c\u2500\u2500 examples\/\u2502   \u2514\u2500\u2500 curl\/                    # curl-\u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\u251c\u2500\u2500 rest_config\/\u2502   \u251c\u2500\u2500 rest.yaml                # \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438\u2502   \u251c\u2500\u2500 auth_rest.yaml           # \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a endpoints\u2502   \u251c\u2500\u2500 rest_sqlc\/               # SQLC schema\/queries\/config\u2502   \u2502   \u251c\u2500\u2500 rest_sqlc.yaml\u2502   \u2502   \u251c\u2500\u2500 schema.sql\u2502   \u2502   \u2514\u2500\u2500 queries.sql\u2502   \u2514\u2500\u2500 rest_mongo\/              # Mongo contracts, \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f MongoDB\u2502       \u251c\u2500\u2500 rest_cheatsheet.yaml\u2502       \u2514\u2500\u2500 user.yaml\u251c\u2500\u2500 Dockerfile\u251c\u2500\u2500 docker-compose.yaml\u251c\u2500\u2500 Makefile\u251c\u2500\u2500 .env.example\u251c\u2500\u2500 go.mod\u2514\u2500\u2500 go.sum<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h2>\u041f\u043e\u0447\u0435\u043c\u0443 \u0438 \u0437\u0430\u0447\u0435\u043c<\/h2>\n<p>\u042f \u043d\u0435\u00a0\u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044e, \u0447\u0442\u043e\u00a0query\u2011first\u00a0\u2014 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u0442\u0440\u043e\u0438\u0442\u044c API, \u043d\u043e\u00a0\u044f \u0434\u0443\u043c\u0430\u044e \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0423\u0414\u041e\u0411\u041d\u041e. Spec\u2011first \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442, \u043a\u043e\u0433\u0434\u0430 OpenAPI \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u043c. \u0421\u0432\u043e\u0439 Code\u2011first \u0443\u0434\u043e\u0431\u0435\u043d \u0434\u043b\u044f\u00a0\u043c\u043d\u043e\u0433\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u0443\u00a0\u043a\u0430\u0436\u0434\u043e\u0433\u043e beckend&#8217;\u0435\u0440\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0439\u00a0\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d\/\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440. \u0420\u0443\u0447\u043d\u043e\u0439 \u043a\u043e\u0434 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u043e\u0442\u0432\u0435\u0442\u043e\u043c, \u043a\u043e\u0433\u0434\u0430 \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u00a0\u2014 \u0432\u00a0\u0431\u0438\u0437\u043d\u0435\u0441\u2011\u043b\u043e\u0433\u0438\u043a\u0435.<\/p>\n<p>\u041d\u043e\u00a0\u0441\u0432\u043e\u0439 whateverIusedToDo\u2011first \u044f \u0442\u043e\u0447\u043d\u043e \u0430\u043f\u0433\u0440\u0435\u0439\u0434\u0438\u043b \u0438 \u0441\u00a0\u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435 \u0434\u0435\u043b\u044e\u0441\u044c \u0441\u00a0\u0432\u0430\u043c\u0438, \u043d\u0435\u00a0\u043f\u0440\u0435\u0434\u0442\u0435\u043d\u0434\u0443\u044f \u043d\u0438 \u043d\u0430\u00a0\u0447\u0442\u043e\u00a0\u043d\u0438 \u0432\u00a0\u043a\u043e\u0435\u043c \u0440\u0430\u0437\u0435, \u0430\u00a0\u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u0438\u043c\u0435\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0435\u00a0\u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u0440\u043e\u043c\u043d\u044b\u0439 \u0441\u043e\u0432\u0435\u0442 \u043f\u043e\u00a0\u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044e \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e \u043f\u043e\u00a0\u0431\u043e\u0440\u044c\u0431\u0435 \u0441\u00a0bug issues. \u041d\u0443, \u0430\u00a0\u043a\u043e\u043c\u0443 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0445\u043e\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u00a0\u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0438 \u0441\u0442\u0430\u043d\u0435\u0442, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u044b\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c, \u043c\u043e\u0433\u0443 \u0441\u00a0\u0443\u043b\u044b\u0431\u043a\u043e\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0436\u0435\u043b\u0430\u0442\u044c\u00a0\u2014 Give yourself a little <code>rest<\/code>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0438\u0434\u0435\u044f \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439, WELCOME TO COLLABORATE and <a href=\"https:\/\/github.com\/repomz\/rest\" rel=\"noopener noreferrer nofollow\">rest<\/a> together.<\/p>\n<blockquote>\n<p><strong>Write queries. Get an application. Add business logic.<\/strong><\/p>\n<\/blockquote>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1056034\/\">https:\/\/habr.com\/ru\/articles\/1056034\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u042f \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u0434\u0443\u043c\u0430\u043b \u043e\u0431\u00a0\u043e\u0434\u043d\u043e\u0439 \u0432\u0440\u043e\u0434\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439, \u043d\u043e\u00a0\u043d\u0430\u00a0\u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0438\u0437\u0440\u044f\u0434\u043d\u043e, \u043f\u043e\u00a0\u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u043c\u0435\u043d\u044f, \u0434\u043e\u0441\u0442\u0430\u0432\u0448\u0435\u0439 backend\u2011\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435.\u0412\u00a0\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442\u00a0\u043f\u043e\u0434\u0445\u043e\u0434\u0430, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u043e\u00a0\u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e, \u043c\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u0441\u00a0\u043a\u0430\u043a\u0438\u043c\u0438 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f REST \u0441\u0435\u0440\u0432\u0438\u0441. \u041d\u043e\u00a0\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a\u00a0\u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u00a0\u043b\u0438\u0448\u044c \u043a\u0430\u043a\u00a0\u043e\u0434\u0438\u043d \u0438\u0437\u00a0\u044d\u0442\u0430\u043f\u043e\u0432 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043b\u043e\u0438\u0441\u0442\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\/\u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430\u00a0\u043e\u043f\u044b\u0442, \u0432\u0441\u0451\u00a0\u0436\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u0440\u0443\u0447\u043d\u0443\u044e \u0441\u0431\u043e\u0440\u043a\u0443 \u043e\u0434\u043d\u0438\u0445 \u0438 \u0442\u0435\u0445\u00a0\u0436\u0435 \u0441\u043b\u043e\u0451\u0432 \u043f\u043e\u00a0\u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0434\u043e\u043c\u0435\u043d\u0443, \u043d\u0435\u00a0\u0433\u043e\u0432\u043e\u0440\u044f \u0443\u0436\u0435 \u043e\u00a0\u043d\u0435\u0439\u043c\u0438\u043d\u0433\u0435 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432, \u0445\u0435\u043d\u0434\u043b\u0435\u0440\u043e\u0432, \u0445\u0435\u043b\u043f\u0435\u0440\u043e\u0432 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435&#8230; \u041f\u043e\u0447\u0442\u0438 \u0434\u043b\u044f\u00a0\u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0432\u043e\u0439 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442\u00a0\u0436\u0435 \u043f\u0443\u0442\u044c:\u2014 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f;\u2014 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0441\u043b\u043e\u0439;\u2014 \u0441\u043e\u0437\u0434\u0430\u0442\u044c HTTP handlers;\u2014 \u043e\u043f\u0438\u0441\u0430\u0442\u044c request \u0438 response \u043c\u043e\u0434\u0435\u043b\u0438;\u2014 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c auth \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u00a0\u0440\u043e\u043b\u044f\u043c\u0438 \u0434\u043b\u044f\u00a0\u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432;\u2014 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c\/\u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c OpenAPI spec;\u2014 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c curl\u2011\u043f\u0440\u0438\u043c\u0435\u0440\u044b; \/\/ \u043f\u043e\u00a0\u0436\u0435\u043b\u0430\u043d\u0438\u044e, \u043d\u043e\u00a0\u043c\u043d\u0435 \u0447\u0430\u0441\u0442\u043e \u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u00a0\u043d\u0438\u043c\u0438\u2014 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b;\u2014 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, Docker, health checks, auth \u0438 \u043a\u0443\u0447\u043a\u0443 middleware.\u0411\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u0438\u0437\u00a0\u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u00a0\u043f\u0440\u043e\u0435\u043a\u0442. \u0411\u0435\u0440\u044f \u0437\u0430\u00a0\u043e\u0441\u043d\u043e\u0432\u0443 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043c\u044b \u0434\u043e\u043b\u0433\u043e \u0442\u043e\u043f\u0447\u0435\u043c\u0441\u044f \u043d\u0430\u0434 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u0440\u044b\u0433\u0430\u044f \u043f\u043e\u00a0\u044d\u0442\u043e\u043c\u0443 snakeCase, \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0440\u0443\u044f \u043d\u0430\u0434 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0430, \u0445\u0435\u043b\u043f\u0435\u0440\u0430&#8230; \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u044f \u0443\u0436\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0441\u044c:).\u041f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u043a\u00a0\u043d\u0430\u0447\u0430\u043b\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f REST \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043a\u0430\u043a\u00a0\u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u043d\u0435\u043c\u043d\u043e\u0433\u043e:\u2014 spec\u2011first\u2014 code\u2011first\u2014 whateverIusedToDo\u2011first\u00a0\u2014 \u043a\u0430\u043a\u00a0\u043f\u0440\u0438\u0432\u044b\u043a, \u0442\u0430\u043a \u043f\u0438\u0448\u0443 + \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442\u00a0\u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0433\u043e\u0434\u044b \/\/ \u0441\u0430\u043c\u044b\u0439 \u0447\u0430\u0441\u0442\u044b\u0439 \u043d\u0435\u00a0\u043f\u0440\u0438\u0437\u043d\u0430\u043d\u043d\u044b\u0439, \u043d\u043e\u00a0\u0432\u0441\u0435\u043c\u0438 \u043b\u044e\u0431\u0438\u043c\u044b\u0439\u2014 query\u2011first\u00a0\u2014 \u043c\u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u043c\u043f\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043b, \u043d\u043e\u00a0\u0434\u0430\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u0445\u043e\u0434\u0443 (\u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u0432\u00a0\u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u0435 \u043d\u0435\u00a0\u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b \u0441\u0430\u043c\u00a0\u2014 \u043d\u0438 \u043d\u0430\u00a0\u0447\u0442\u043e\u00a0\u043d\u0435\u00a0\u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u044e \u0438 \u0433\u043e\u0442\u043e\u0432 \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u044c, \u043a\u043e\u043b\u0438 \u0443\u043a\u0430\u0436\u0435\u0442\u0435, \u0447\u0442\u043e\u00a0\u0442\u0430\u043a\u043e\u0435 \u0435\u0441\u0442\u044c) \u0432\u0434\u0440\u0443\u0433 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0432\u00a0\u044d\u0442\u043e\u043c \u0433\u043e\u0434\u0443&#8230;\u0430 \u043f\u043e\u0442\u043e\u043c \u0434\u043e\u043b\u0433\u043e \u043f\u0438\u0441\u0430\u043b \u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u043a \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430, \u0434\u0430-\u0434\u0430, \u043b\u044e\u0431\u043b\u044e \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0430\u043c&#8230;\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0434\u043e\u043b\u0433\u043e:).\u0427\u0442\u043e\u00a0\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u044e query\u2011first\u0418\u0434\u0435\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f: \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u00a0\u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0443\u0436\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e\u00a0\u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u00a0\u0442\u0435\u043c \u0438\u043b\u0438\u00a0\u0438\u043d\u044b\u043c json, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e (\u043f\u043e\u0447\u0442\u0438) \u0432\u0441\u0435\u0433\u043e REST \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f&#8230; \u041d\u0435\u00a0\u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u044e\u00a0\u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u043c \u043a\u0442\u043e \u044d\u0442\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b, \u0430\u00a0\u043c\u043e\u0436\u0435\u0442 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b, \u043d\u0443 \u0440\u0430\u0437\u0432\u0435 \u0447\u0442\u043e 1001\u044b\u043c:).\u0414\u043b\u044f\u00a0SQL \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:PostgreSQL schema + SQLC queries        \u2193Generated endpoint inventory        \u2193Repository \u2192 Service \u2192 HTTP handlers        \u2193http server \u0441\u043e \u0432\u0441\u0435\u043c\u0438 &#171;\u043f\u0440\u0438\u043c\u043e\u0447\u043a\u0430\u043c\u0438&#187; + logging + OpenAPI + auth policies + tests + observability + docker + docker compose + ci\/cd\u0414\u043b\u044f\u00a0MongoDB \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438\u0434\u0435\u044f \u043f\u043e\u0445\u043e\u0436\u0430\u044f, \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043c\u0435\u0441\u0442\u043e SQLC \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u044f\u0432\u043d\u044b\u0435 YAML\u2011\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u044b:MongoDB collection contracts        \u2193Generated endpoint inventory        \u2193Repository \u2192 Service \u2192 HTTP handlers        \u2193http server \u0441\u043e \u0432\u0441\u0435\u043c\u0438 &#171;\u043f\u0440\u0438\u043c\u043e\u0447\u043a\u0430\u043c\u0438&#187; + logging + OpenAPI + auth policies + tests + observability + docker + docker compose + ci\/cdendpoint inventory\u00a0\u2014 \u044d\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u043d\u0430\u0435\u0442:\u2014 HTTP method \u0438 path;\u2014 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 SQL query \u0438\u043b\u0438\u00a0Mongo method;\u2014 path\/query\/body \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b;\u2014 auth policy;\u2014 \u0440\u043e\u043b\u0438;\u2014 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 routes \u0432\u0440\u043e\u0434\u0435 health, readiness, Swagger \u0438 metrics.\u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0437\u00a0\u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u043f\u0440\u0430\u0432\u0434\u044b. Handler, OpenAPI operation, curl\u2011\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0435\u0441\u0442 \u0438 auth policy \u043d\u0435\u00a0\u0434\u043e\u043b\u0436\u043d\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0443\u0433\u0430\u0434\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e\u00a0\u0442\u0430\u043a\u043e\u0435 endpoint. \u041e\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u0442\u0440\u043e\u0438\u0442\u044c\u0441\u044f \u0438\u0437\u00a0\u043e\u0434\u043d\u043e\u0433\u043e inventory.\u0412 \u043e\u0431\u0449\u0435\u043c, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u044f \u044d\u0442\u0443 \u0438\u0434\u0435\u044e \u0432\u00a0open\u2011source Go CLI \u043f\u043e\u0434\u00a0\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c rest. \u041d\u0435\u00a0\u043c\u043e\u0433\u0443 \u043d\u0435\u00a0\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e\u00a0\u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0438\u043b \u043c\u0435\u043d\u044f \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0434\u0430\u0432\u043d\u0438\u0439 \u0437\u0430\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u0432\u0448\u0438\u0439 \u0441\u0435\u0431\u044f \u043f\u0440\u043e\u0435\u043a\u0442 sqlc. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0438\u043b \u043c\u0435\u043d\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0447\u0430\u0442\u044c, \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c, \u043d\u0430\u0447\u0430\u0442\u043e\u0435 \u0434\u0430\u0432\u043d\u043e \u0438 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0435\u043b\u0438\u0437. SQLC \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 SQL \u0432\u00a0type\u2011safe Go \u043a\u043e\u0434. rest \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433: \u0431\u0435\u0440\u0451\u0442 SQLC output \u0438\u043b\u0438\u00a0MongoDB contracts \u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u0445 \u0432\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u043e\u0435 \u0441\u043b\u043e\u0438\u0441\u0442\u043e\u0435 REST \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.\u0426\u0435\u043b\u044c \u043d\u0435\u00a0\u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0442. \u0426\u0435\u043b\u044c \u043f\u0440\u043e\u0441\u0442\u0430\u044f\u00a0\u2014 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u00a0\u2014 \u0443\u0431\u0440\u0430\u0442\u044c \u0441\u043a\u0443\u0447\u043d\u0443\u044e \u0438 \u0441\u043a\u043b\u043e\u043d\u043d\u0443\u044e \u043a\u00a0\u043e\u0448\u0438\u0431\u043a\u0430\u043c \u0440\u0443\u0442\u0438\u043d\u0443, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u043b \u043d\u0435\u00a0\u0441\u00a0\u043f\u0443\u0441\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0438, \u0430\u00a0\u0441\u00a0\u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u043a\u0430\u0440\u043a\u0430\u0441\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u0438\u0441\u0430\u043b \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0443\u044e \u0431\u0438\u0437\u043d\u0435\u0441\u2011\u043b\u043e\u0433\u0438\u043a\u0443. \u0412\u00a0\u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0442\u044c \u043f\u043e\u0447\u0442\u0438 \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0412\u00a0\u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445\u00a0\u2014 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0441\u043d\u044f\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0435 80\u201390% \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0435\u0439\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u044b.SQL \u043f\u0440\u0438\u043c\u0435\u0440\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443:CREATE TABLE studies (    id              UUID PRIMARY KEY DEFAULT gen_random_uuid(),    created_at      TIMESTAMPTZ NOT NULL DEFAULT now(),    patient         TEXT NOT NULL,    study_type      TEXT NOT NULL,    time_beginning  TIMESTAMP,    surgeon         TEXT NOT NULL,    deleted         BOOLEAN NOT NULL DEFAULT FALSE);\u0418 sqlc query:&#8212; name: GetStudies :manySELECT * FROM studiesWHERE deleted = false  AND (    sqlc.narg(&#8216;type&#8217;)::text IS NULL    OR study_type = sqlc.narg(&#8216;type&#8217;)  )  AND (    sqlc.narg(&#8216;surgeon&#8217;)::text IS NULL    OR surgeon = sqlc.narg(&#8216;surgeon&#8217;)  )ORDER BY time_beginning DESC;\u0414\u0430\u043b\u0435\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0438\u0434\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b sqlc generate \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u043b\u0438\u00a0\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u00a0\u0440\u0430\u043c\u043a\u0430\u0445 \u0441\u0430\u043c\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b rest gen \u043f\u0440\u0438\u00a0\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043e\u043f\u0446\u0438\u0438 auto_sqlc: enable \u0432\u00a0\u0444\u0430\u0439\u043b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a rest.yamlSQLC \u0441\u043e\u0437\u0434\u0430\u0451\u0442 type\u2011safe Go \u043a\u043e\u0434 \u0434\u043b\u044f\u00a0\u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430. rest \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u00a0\u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 endpoint \u0432\u0440\u043e\u0434\u0435: GET \/studies?type=CT&amp;surgeon=Ivanov\u041e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 sqlc.narg(&#8230;) \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f optional query parameters. Result type \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e response model \u0438 OpenAPI schema.MongoDB \u043f\u0440\u0438\u043c\u0435\u0440\u0414\u043b\u044f\u00a0MongoDB \u043d\u0435\u0442 \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0430 SQLC, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u044f\u0432\u043d\u044b\u0435 YAML\u2011\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u044b. Mongo contracts \u043b\u0435\u0436\u0430\u0442 \u0437\u0434\u0435\u0441\u044c: rest_config\/rest_mongo\/*.yaml.\u041a\u0430\u0436\u0434\u044b\u0439 entity file \u043c\u043e\u0436\u0435\u0442 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c:\u2014 collection name;\u2014 fields;\u2014 indexes;\u2014 CRUD methods;\u2014 custom methods \u0432\u0440\u043e\u0434\u0435 find_one, find_many, update_one, delete_one \u0438 aggregate;\u2014 HTTP path\/method mapping.\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 Mongo app \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 repositories, services, handlers, OpenAPI, handler tests, auth middleware, Docker support \u0438 runtime health\/readiness paths. Mongo domain layer \u0441\u0434\u0435\u043b\u0430\u043d \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0433\u0438\u0431\u043a\u0438\u043c \u0434\u043b\u044f\u00a0document data.\u0427\u0442\u043e\u00a0\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f\u0412\u00a0\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442\u00a0\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 rest.yaml \u043a\u043e\u043c\u0430\u043d\u0434\u0430 rest gen \u043c\u043e\u0436\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c:\u2014 cmd\/main.go;\u2014 domain models;\u2014 PostgreSQL \u0438\u043b\u0438\u00a0MongoDB repositories;\u2014 service layer;\u2014 HTTP handlers;\u2014 request\/response models;\u2014 handler tests;\u2014 OpenAPI \u0438 Swagger UI;\u2014 JWT \u0438\u043b\u0438\u00a0Basic Auth;\u2014 RBAC route wrapping;\u2014 security headers;\u2014 rate limiting;\u2014 production\u2011safer CORS defaults;\u2014 request IDs;\u2014 panic recovery;\u2014 body size limits;\u2014 Zap logging;\u2014 optional Prometheus metrics;\u2014 Dockerfile;\u2014 optional Docker Compose;\u2014 .env.example;\u2014 Makefile;\u2014 init_db shell script \u0434\u043b\u044f\u00a0\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e postgres\u2014 CI\/CD workflow templates;\u2014 curl examples.\u2014 DEPLOYMENT.md next steps guide\u2014 ARCHITECTURE.md c \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0445\u0435\u043c\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u2014 README \u0448\u0430\u0431\u043b\u043e\u043d \u0441\u00a0\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439 \u043f\u043e\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 Go \u043a\u043e\u0434 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f\u00a0\u043b\u0438\u043d\u0442\u0435\u0440\u0430\u043c\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 imports \u0438 \u043e\u0431\u0449\u0438\u0439 \u0441\u0442\u0438\u043b\u044c \u043a\u043e\u0434\u0430 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043a\u00a0\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443.Auth generationAuth \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u0438\u0437\u00a0\u0441\u0430\u043c\u044b\u0445 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0434\u0438\u0437\u0430\u0439\u043d\u0430. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043a\u0430 2\u00a0\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 JWT \u0438 BasicAuth.Flow \u0442\u0430\u043a\u043e\u0439:1. \u0423\u043a\u0430\u0437\u0430\u0442\u044c auth: enable \u0432 rest.yaml.2. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c rest gen.3. \u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043d\u0430\u0439\u0434\u0451\u0442 endpoints \u0438 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 rest_config\/auth_rest.yaml.4. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 auth \u0438 \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u0442, \u043a\u0430\u043a\u0438\u0435 endpoints \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435, \u043a\u0430\u043a\u0438\u0435 \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u044b, \u0430\u00a0\u043a\u0430\u043a\u0438\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0440\u043e\u043b\u0438.5. \u0421\u043d\u043e\u0432\u0430 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c rest gen.6. \u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u043e\u0432\u0438\u0442 middleware, route wrapping, auth handlers \u0438 OpenAPI security.\u0414\u043b\u044f\u00a0SQL\/JWT \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c signup\/signin handlers, password hashing, token service, claims configuration \u0438 protected routes \u043d\u0430\u00a0\u043e\u0441\u043d\u043e\u0432\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 user model.\u0414\u043b\u044f\u00a0Basic Auth \u0438 Mongo apps \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 middleware \u0438 role checks.rest doctor\u0414\u0430, \u0438 \u0442\u0430\u043a\u0430\u044f \u0435\u0441\u0442\u044c \u0444\u0438\u0447\u0430. \u0415\u0451 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430\u00a0\u043b\u044e\u0431\u043e\u043c \u044d\u0442\u0430\u043f\u0435:\u2014 \u043f\u043e\u0441\u043b\u0435 rest init;\u2014 \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f YAML \u0444\u0430\u0439\u043b\u043e\u0432;\u2014 \u043f\u043e\u0441\u043b\u0435 rest gen;\u2014 \u043f\u0435\u0440\u0435\u0434 \u043f\u043e\u043f\u044b\u0442\u043a\u043e\u0439 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.\u041e\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432, \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043d\u0443\u0436\u043d\u044b\u0445 tools, YAML\u2011\u043e\u0448\u0438\u0431\u043a\u0438, \u0433\u043e\u0442\u043e\u0432\u043d\u043e\u0441\u0442\u044c Docker, OpenAPI\/auth configuration, generated files \u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.\u042d\u0442\u043e \u043a\u0430\u043a\u00a0\u0440\u0430\u0437 \u0442\u0430 \u0432\u0435\u0449\u044c, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043d\u0435 \u043d\u0435\u00a0\u0445\u0432\u0430\u0442\u0430\u043b\u043e \u043c\u043d\u043e\u0433\u043e \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434, \u0432\u00a0\u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0443\u0442\u0438: \u043a\u043e\u043c\u0430\u043d\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0435\u0433\u043e \u043d\u0435\u00a0\u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0438 \u0447\u0442\u043e\u00a0\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435&#8230; \u0432 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438, \u043a\u0430\u043a\u00a0\u0441\u0435\u0439\u0447\u0430\u0441 \u043b\u044e\u0431\u043e\u0439 ai powered cli.\u0427\u0442\u043e\u00a0\u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0435\u00a0\u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0448\u0438\u0442\u044crest \u043d\u0435\u00a0\u0437\u043d\u0430\u0435\u0442 \u0432\u0430\u0448\u0443 \u0431\u0438\u0437\u043d\u0435\u0441\u2011\u043b\u043e\u0433\u0438\u043a\u0443.\u041e\u043d \u043d\u0435\u00a0\u0431\u0443\u0434\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c:\u2014 \u0441\u043b\u043e\u0436\u043d\u0443\u044e domain validation;\u2014 custom workflows;\u2014 billing logic;\u2014 external integrations;\u2014 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 transactions;\u2014 product\u2011specific authorization rules.\u2014 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 SQL query \u0441\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435\u00a0\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f sqlc generate \u0438\u043b\u0438 \u00ab\u043a\u0440\u0430\u0439\u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439\u00bb Mongo contract\u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043d\u0443\u0436\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0438\u043b\u044c\u043d\u0443\u044e \u0438 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0443\u044e \u0442\u043e\u0447\u043a\u0443. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u043e\u0431\u044b\u0447\u043d\u0443\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443. \u041a \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0443 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0435 domain models \u0438\u043b\u0438\u00a0queries, \u0434\u043b\u044f\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043d\u043e\u0432\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u0441\u043b\u043e\u0438 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u00a0\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u2014 \u043e\u0431\u00a0\u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u0442\u0441\u044f \u0441\u043a\u0440\u043e\u043c\u043d\u0430\u044f \u043e\u043f\u0446\u0438\u044f safe_reload: enable \u0438\u0437\u00a0rest.yaml, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043f\u0440\u043e\u0441\u0438\u0442 \u0432\u0430\u0441, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c\u00a0\u043b\u0438 \u0432\u0430\u0448 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u00a0\u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438.\u041a\u0430\u043a\u00a0\u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044cInstall:go install github.com\/repomz\/rest\/cmd\/rest@latestSQL \u043f\u0440\u0438\u043c\u0435\u0440:rest init &#8212;example sql # \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0434\u043b\u044f sqlcrest gengo run .\/cmd\/main.go # go test .\/&#8230; MongoDB \u043f\u0440\u0438\u043c\u0435\u0440:rest init &#8212;example sql # \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0434\u043b\u044f sqlcrest gengo run .\/cmd\/main.go # go test .\/&#8230; \u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0439 workflow:rest init# \u0421\u043e\u0437\u0434\u0430\u0451\u0442 rest_config\/ \u0441 \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430.# \u041f\u0435\u0440\u0435\u0434 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0435\u0439 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c rest.yaml \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u044b:# SQLC schema\/queries \u0434\u043b\u044f PostgreSQL \u0438\u043b\u0438 YAML-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u044b \u0434\u043b\u044f MongoDB.rest gen go run .\/cmd\/main.go # go test .\/&#8230; \u041f\u043e\u0441\u043b\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430\u00a0\u0441\u0445\u0435\u043c\u0443 \u0435\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432:rest list endpoints # \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0432\u0441\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0435\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b \u0441 \u0438\u0445 \u0442\u0435\u043a\u0443\u0449\u0438\u043c\u0438 \u043e\u043f\u0446\u0438\u044f\u043c\u0438\u0438\u043b\u0438\u00a0\u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432\u00a0swagger ui: http:\/\/localhost:8080\/swagger\u0412 README.md \u0432\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0436\u0434\u0430\u0442\u044c \u043f\u0430\u0440\u0430 \u0448\u0438\u043b\u044c\u0434\u0438\u043a\u043e\u0432 \u0438 \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:my-app\/\u251c\u2500\u2500 cmd\/\u2502   \u2514\u2500\u2500 main.go                  # entrypoint \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u251c\u2500\u2500 internal\/\u2502   \u251c\u2500\u2500 config\/                  # \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 env\/config\u2502   \u251c\u2500\u2500 db\/                      # SQLC models\/queries \u0438\u043b\u0438 Mongo client\u2502   \u251c\u2500\u2500 repository\/              # \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c\u2502   \u251c\u2500\u2500 service\/                 # \u0431\u0438\u0437\u043d\u0435\u0441-\u0441\u043b\u043e\u0439\u2502   \u251c\u2500\u2500 transport\/\u2502   \u2502   \u2514\u2500\u2500 http\/                # handlers, routes, middleware\u2502   \u251c\u2500\u2500 auth\/             &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-486337","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/486337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=486337"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/486337\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=486337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=486337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=486337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}