diff --git a/.vscode/settings.json b/.vscode/settings.json index 246b0419d0..c001ea6561 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,10 +1,11 @@ { - "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode", - "workbench.editorAssociations": { - "*.md": "vscode.markdown.preview.editor" - }, - "[javascriptreact]": { - "editor.defaultFormatter": "vscode.typescript-language-features" - } + "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode", + "workbench.editorAssociations": { + "*.md": "vscode.markdown.preview.editor" + }, + "[javascriptreact]": { + "editor.defaultFormatter": "vscode.typescript-language-features" + }, + "githubPullRequests.ignoredPullRequestBranches": ["main"] } diff --git a/Pipfile b/Pipfile index 44e04f14ff..887d0428d4 100644 --- a/Pipfile +++ b/Pipfile @@ -6,9 +6,6 @@ verify_ssl = true [dev-packages] [packages] -flask = "*" -flask-sqlalchemy = "*" -flask-migrate = "*" flask-swagger = "*" psycopg2-binary = "*" python-dotenv = "*" @@ -17,9 +14,18 @@ gunicorn = "*" cloudinary = "*" flask-admin = "*" typing-extensions = "*" -flask-jwt-extended = "==4.6.0" wtforms = "==3.1.2" +flask-jwt-extended = "*" +flask-migrate = "*" +flask-sqlalchemy = "*" sqlalchemy = "*" +<<<<<<< HEAD +requests = "*" +google-auth = "*" +google-auth-oauthlib = "*" +======= +flask = "*" +>>>>>>> main [requires] python_version = "3.13" diff --git a/Pipfile.lock b/Pipfile.lock index b201c3decc..ca3cefe171 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,11 @@ { "_meta": { "hash": { - "sha256": "d2e672e650278aeeee2fe49bd76d76497d8b65a50f8b5dbb121d265cbc6ef4e5" +<<<<<<< HEAD + "sha256": "1fb586041e5e2a71243696749e1960d694fb8be6b6e4f5d36f8c76e5271faa9d" +======= + "sha256": "1e3cc14c317d2e1d7cccecd1fcc7afd5b60c23767c0d3997b1db5574a144d218" +>>>>>>> main }, "pipfile-spec": 6, "requires": { @@ -18,11 +22,11 @@ "default": { "alembic": { "hashes": [ - "sha256:1acdd7a3a478e208b0503cd73614d5e4c6efafa4e73518bb60e4f2846a37b1c5", - "sha256:496e888245a53adf1498fcab31713a469c65836f8de76e01399aa1c3e90dd213" + "sha256:b05e51e8e82efc1abd14ba2af6392897e145930c3e0a2faf2b0da2f7f7fd660d", + "sha256:efab6ada0dd0fae2c92060800e0bf5c1dc26af15a10e02fb4babff164b4725e2" ], - "markers": "python_version >= '3.8'", - "version": "==1.14.1" + "markers": "python_version >= '3.9'", + "version": "==1.16.4" }, "blinker": { "hashes": [ @@ -32,21 +36,114 @@ "markers": "python_version >= '3.9'", "version": "==1.9.0" }, + "cachetools": { + "hashes": [ + "sha256:1a661caa9175d26759571b2e19580f9d6393969e5dfca11fdb1f947a23e640d4", + "sha256:d26a22bcc62eb95c3beabd9f1ee5e820d3d2704fe2967cbe350e20c8ffcd3f0a" + ], + "markers": "python_version >= '3.7'", + "version": "==5.5.2" + }, "certifi": { "hashes": [ - "sha256:3d5da6925056f6f18f119200434a4780a94263f10d1c21d032a6f6b2baa20651", - "sha256:ca78db4565a652026a4db2bcdf68f2fb589ea80d0be70e03929ed730746b84fe" + "sha256:e564105f78ded564e3ae7c923924435e1daa7463faeab5bb932bc53ffae63407", + "sha256:f6c12493cfb1b06ba2ff328595af9350c65d6644968e5d3a2ffd78699af217a5" ], - "markers": "python_version >= '3.6'", - "version": "==2025.1.31" + "markers": "python_version >= '3.7'", + "version": "==2025.8.3" }, - "click": { + "charset-normalizer": { "hashes": [ - "sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2", - "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a" + "sha256:00237675befef519d9af72169d8604a067d92755e84fe76492fef5441db05b91", + "sha256:02425242e96bcf29a49711b0ca9f37e451da7c70562bc10e8ed992a5a7a25cc0", + "sha256:027b776c26d38b7f15b26a5da1044f376455fb3766df8fc38563b4efbc515154", + "sha256:07a0eae9e2787b586e129fdcbe1af6997f8d0e5abaa0bc98c0e20e124d67e601", + "sha256:0cacf8f7297b0c4fcb74227692ca46b4a5852f8f4f24b3c766dd94a1075c4884", + "sha256:0e78314bdc32fa80696f72fa16dc61168fda4d6a0c014e0380f9d02f0e5d8a07", + "sha256:0f2be7e0cf7754b9a30eb01f4295cc3d4358a479843b31f328afd210e2c7598c", + "sha256:13faeacfe61784e2559e690fc53fa4c5ae97c6fcedb8eb6fb8d0a15b475d2c64", + "sha256:14c2a87c65b351109f6abfc424cab3927b3bdece6f706e4d12faaf3d52ee5efe", + "sha256:1606f4a55c0fd363d754049cdf400175ee96c992b1f8018b993941f221221c5f", + "sha256:16a8770207946ac75703458e2c743631c79c59c5890c80011d536248f8eaa432", + "sha256:18343b2d246dc6761a249ba1fb13f9ee9a2bcd95decc767319506056ea4ad4dc", + "sha256:18b97b8404387b96cdbd30ad660f6407799126d26a39ca65729162fd810a99aa", + "sha256:1bb60174149316da1c35fa5233681f7c0f9f514509b8e399ab70fea5f17e45c9", + "sha256:1e8ac75d72fa3775e0b7cb7e4629cec13b7514d928d15ef8ea06bca03ef01cae", + "sha256:1ef99f0456d3d46a50945c98de1774da86f8e992ab5c77865ea8b8195341fc19", + "sha256:2001a39612b241dae17b4687898843f254f8748b796a2e16f1051a17078d991d", + "sha256:23b6b24d74478dc833444cbd927c338349d6ae852ba53a0d02a2de1fce45b96e", + "sha256:252098c8c7a873e17dd696ed98bbe91dbacd571da4b87df3736768efa7a792e4", + "sha256:257f26fed7d7ff59921b78244f3cd93ed2af1800ff048c33f624c87475819dd7", + "sha256:2c322db9c8c89009a990ef07c3bcc9f011a3269bc06782f916cd3d9eed7c9312", + "sha256:30a96e1e1f865f78b030d65241c1ee850cdf422d869e9028e2fc1d5e4db73b92", + "sha256:30d006f98569de3459c2fc1f2acde170b7b2bd265dc1943e87e1a4efe1b67c31", + "sha256:31a9a6f775f9bcd865d88ee350f0ffb0e25936a7f930ca98995c05abf1faf21c", + "sha256:320e8e66157cc4e247d9ddca8e21f427efc7a04bbd0ac8a9faf56583fa543f9f", + "sha256:34a7f768e3f985abdb42841e20e17b330ad3aaf4bb7e7aeeb73db2e70f077b99", + "sha256:3653fad4fe3ed447a596ae8638b437f827234f01a8cd801842e43f3d0a6b281b", + "sha256:3cd35b7e8aedeb9e34c41385fda4f73ba609e561faedfae0a9e75e44ac558a15", + "sha256:3cfb2aad70f2c6debfbcb717f23b7eb55febc0bb23dcffc0f076009da10c6392", + "sha256:416175faf02e4b0810f1f38bcb54682878a4af94059a1cd63b8747244420801f", + "sha256:41d1fc408ff5fdfb910200ec0e74abc40387bccb3252f3f27c0676731df2b2c8", + "sha256:42e5088973e56e31e4fa58eb6bd709e42fc03799c11c42929592889a2e54c491", + "sha256:4ca4c094de7771a98d7fbd67d9e5dbf1eb73efa4f744a730437d8a3a5cf994f0", + "sha256:511729f456829ef86ac41ca78c63a5cb55240ed23b4b737faca0eb1abb1c41bc", + "sha256:53cd68b185d98dde4ad8990e56a58dea83a4162161b1ea9272e5c9182ce415e0", + "sha256:585f3b2a80fbd26b048a0be90c5aae8f06605d3c92615911c3a2b03a8a3b796f", + "sha256:5b413b0b1bfd94dbf4023ad6945889f374cd24e3f62de58d6bb102c4d9ae534a", + "sha256:5d8d01eac18c423815ed4f4a2ec3b439d654e55ee4ad610e153cf02faf67ea40", + "sha256:6aab0f181c486f973bc7262a97f5aca3ee7e1437011ef0c2ec04b5a11d16c927", + "sha256:6cf8fd4c04756b6b60146d98cd8a77d0cdae0e1ca20329da2ac85eed779b6849", + "sha256:6fb70de56f1859a3f71261cbe41005f56a7842cc348d3aeb26237560bfa5e0ce", + "sha256:6fce4b8500244f6fcb71465d4a4930d132ba9ab8e71a7859e6a5d59851068d14", + "sha256:70bfc5f2c318afece2f5838ea5e4c3febada0be750fcf4775641052bbba14d05", + "sha256:73dc19b562516fc9bcf6e5d6e596df0b4eb98d87e4f79f3ae71840e6ed21361c", + "sha256:74d77e25adda8581ffc1c720f1c81ca082921329452eba58b16233ab1842141c", + "sha256:78deba4d8f9590fe4dae384aeff04082510a709957e968753ff3c48399f6f92a", + "sha256:86df271bf921c2ee3818f0522e9a5b8092ca2ad8b065ece5d7d9d0e9f4849bcc", + "sha256:88ab34806dea0671532d3f82d82b85e8fc23d7b2dd12fa837978dad9bb392a34", + "sha256:8999f965f922ae054125286faf9f11bc6932184b93011d138925a1773830bbe9", + "sha256:8dcfc373f888e4fb39a7bc57e93e3b845e7f462dacc008d9749568b1c4ece096", + "sha256:939578d9d8fd4299220161fdd76e86c6a251987476f5243e8864a7844476ba14", + "sha256:96b2b3d1a83ad55310de8c7b4a2d04d9277d5591f40761274856635acc5fcb30", + "sha256:a2d08ac246bb48479170408d6c19f6385fa743e7157d716e144cad849b2dd94b", + "sha256:b256ee2e749283ef3ddcff51a675ff43798d92d746d1a6e4631bf8c707d22d0b", + "sha256:b5e3b2d152e74e100a9e9573837aba24aab611d39428ded46f4e4022ea7d1942", + "sha256:b89bc04de1d83006373429975f8ef9e7932534b8cc9ca582e4db7d20d91816db", + "sha256:bd28b817ea8c70215401f657edef3a8aa83c29d447fb0b622c35403780ba11d5", + "sha256:c60e092517a73c632ec38e290eba714e9627abe9d301c8c8a12ec32c314a2a4b", + "sha256:c6dbd0ccdda3a2ba7c2ecd9d77b37f3b5831687d8dc1b6ca5f56a4880cc7b7ce", + "sha256:c6e490913a46fa054e03699c70019ab869e990270597018cef1d8562132c2669", + "sha256:c6f162aabe9a91a309510d74eeb6507fab5fff92337a15acbe77753d88d9dcf0", + "sha256:c6fd51128a41297f5409deab284fecbe5305ebd7e5a1f959bee1c054622b7018", + "sha256:cc34f233c9e71701040d772aa7490318673aa7164a0efe3172b2981218c26d93", + "sha256:cc9370a2da1ac13f0153780040f465839e6cccb4a1e44810124b4e22483c93fe", + "sha256:ccf600859c183d70eb47e05a44cd80a4ce77394d1ac0f79dbd2dd90a69a3a049", + "sha256:ce571ab16d890d23b5c278547ba694193a45011ff86a9162a71307ed9f86759a", + "sha256:cf1ebb7d78e1ad8ec2a8c4732c7be2e736f6e5123a4146c5b89c9d1f585f8cef", + "sha256:d0e909868420b7049dafd3a31d45125b31143eec59235311fc4c57ea26a4acd2", + "sha256:d22dbedd33326a4a5190dd4fe9e9e693ef12160c77382d9e87919bce54f3d4ca", + "sha256:d716a916938e03231e86e43782ca7878fb602a125a91e7acb8b5112e2e96ac16", + "sha256:d79c198e27580c8e958906f803e63cddb77653731be08851c7df0b1a14a8fc0f", + "sha256:d95bfb53c211b57198bb91c46dd5a2d8018b3af446583aab40074bf7988401cb", + "sha256:e28e334d3ff134e88989d90ba04b47d84382a828c061d0d1027b1b12a62b39b1", + "sha256:ec557499516fc90fd374bf2e32349a2887a876fbf162c160e3c01b6849eaf557", + "sha256:fb6fecfd65564f208cbf0fba07f107fb661bcd1a7c389edbced3f7a493f70e37", + "sha256:fb731e5deb0c7ef82d698b0f4c5bb724633ee2a489401594c5c88b02e6cb15f7", + "sha256:fb7f67a1bfa6e40b438170ebdc8158b78dc465a5a67b6dde178a46987b244a72", + "sha256:fd10de089bcdcd1be95a2f73dbe6254798ec1bda9f450d5828c96f93e2536b9c", + "sha256:fdabf8315679312cfa71302f9bd509ded4f2f263fb5b765cf1433b39106c3cc9" ], "markers": "python_version >= '3.7'", - "version": "==8.1.8" + "version": "==3.4.3" + }, + "click": { + "hashes": [ + "sha256:27c491cc05d968d271d5a1db13e3b5a184636d9d930f148c50b038f0d0646202", + "sha256:61a3265b914e850b85317d0b3109c7f8cd35a670f963866005d6ef1d5175a12b" + ], + "markers": "python_version >= '3.10'", + "version": "==8.2.1" }, "cloudinary": { "hashes": [ @@ -58,11 +155,12 @@ }, "flask": { "hashes": [ - "sha256:5f873c5184c897c8d9d1b05df1e3d01b14910ce69607a117bd3277098a5836ac", - "sha256:d667207822eb83f1c4b50949b1623c8fc8d51f2341d65f72e1a1815397551136" + "sha256:bf656c15c80190ed628ad08cdfd3aaa35beb087855e2f494910aa3774cc4fd87", + "sha256:ca1d8112ec8a6158cc29ea4858963350011b5c846a414cdb7a954aa9e967d03c" ], "index": "pypi", - "version": "==3.1.0" + "markers": "python_version >= '3.9'", + "version": "==3.1.2" }, "flask-admin": { "hashes": [ @@ -82,11 +180,12 @@ }, "flask-jwt-extended": { "hashes": [ - "sha256:63a28fc9731bcc6c4b8815b6f954b5904caa534fc2ae9b93b1d3ef12930dca95", - "sha256:9215d05a9413d3855764bcd67035e75819d23af2fafb6b55197eb5a3313fdfb2" + "sha256:52f35bf0985354d7fb7b876e2eb0e0b141aaff865a22ff6cc33d9a18aa987978", + "sha256:8085d6757505b6f3291a2638c84d207e8f0ad0de662d1f46aa2f77e658a0c976" ], "index": "pypi", - "version": "==4.6.0" + "markers": "python_version >= '3.9' and python_version < '4'", + "version": "==4.7.1" }, "flask-migrate": { "hashes": [ @@ -94,6 +193,7 @@ "sha256:24d8051af161782e0743af1b04a152d007bad9772b2bca67b7ec1e8ceeb3910d" ], "index": "pypi", + "markers": "python_version >= '3.6'", "version": "==4.1.0" }, "flask-sqlalchemy": { @@ -102,6 +202,7 @@ "sha256:e4b68bb881802dda1a7d878b2fc84c06d1ee57fb40b874d3dc97dabfa36b8312" ], "index": "pypi", + "markers": "python_version >= '3.8'", "version": "==3.1.1" }, "flask-swagger": { @@ -112,84 +213,83 @@ "index": "pypi", "version": "==0.2.14" }, + "google-auth": { + "hashes": [ + "sha256:1370d4593e86213563547f97a92752fc658456fe4514c809544f330fed45a7ca", + "sha256:500c3a29adedeb36ea9cf24b8d10858e152f2412e3ca37829b3fa18e33d63b77" + ], + "index": "pypi", + "markers": "python_version >= '3.7'", + "version": "==2.40.3" + }, + "google-auth-oauthlib": { + "hashes": [ + "sha256:11046fb8d3348b296302dd939ace8af0a724042e8029c1b872d87fabc9f41684", + "sha256:fd619506f4b3908b5df17b65f39ca8d66ea56986e5472eb5978fd8f3786f00a2" + ], + "index": "pypi", + "markers": "python_version >= '3.6'", + "version": "==1.2.2" + }, "greenlet": { "hashes": [ - "sha256:0153404a4bb921f0ff1abeb5ce8a5131da56b953eda6e14b88dc6bbc04d2049e", - "sha256:03a088b9de532cbfe2ba2034b2b85e82df37874681e8c470d6fb2f8c04d7e4b7", - "sha256:04b013dc07c96f83134b1e99888e7a79979f1a247e2a9f59697fa14b5862ed01", - "sha256:05175c27cb459dcfc05d026c4232f9de8913ed006d42713cb8a5137bd49375f1", - "sha256:09fc016b73c94e98e29af67ab7b9a879c307c6731a2c9da0db5a7d9b7edd1159", - "sha256:0bbae94a29c9e5c7e4a2b7f0aae5c17e8e90acbfd3bf6270eeba60c39fce3563", - "sha256:0fde093fb93f35ca72a556cf72c92ea3ebfda3d79fc35bb19fbe685853869a83", - "sha256:1443279c19fca463fc33e65ef2a935a5b09bb90f978beab37729e1c3c6c25fe9", - "sha256:1776fd7f989fc6b8d8c8cb8da1f6b82c5814957264d1f6cf818d475ec2bf6395", - "sha256:1d3755bcb2e02de341c55b4fca7a745a24a9e7212ac953f6b3a48d117d7257aa", - "sha256:23f20bb60ae298d7d8656c6ec6db134bca379ecefadb0b19ce6f19d1f232a942", - "sha256:275f72decf9932639c1c6dd1013a1bc266438eb32710016a1c742df5da6e60a1", - "sha256:2846930c65b47d70b9d178e89c7e1a69c95c1f68ea5aa0a58646b7a96df12441", - "sha256:3319aa75e0e0639bc15ff54ca327e8dc7a6fe404003496e3c6925cd3142e0e22", - "sha256:346bed03fe47414091be4ad44786d1bd8bef0c3fcad6ed3dee074a032ab408a9", - "sha256:36b89d13c49216cadb828db8dfa6ce86bbbc476a82d3a6c397f0efae0525bdd0", - "sha256:37b9de5a96111fc15418819ab4c4432e4f3c2ede61e660b1e33971eba26ef9ba", - "sha256:396979749bd95f018296af156201d6211240e7a23090f50a8d5d18c370084dc3", - "sha256:3b2813dc3de8c1ee3f924e4d4227999285fd335d1bcc0d2be6dc3f1f6a318ec1", - "sha256:411f015496fec93c1c8cd4e5238da364e1da7a124bcb293f085bf2860c32c6f6", - "sha256:47da355d8687fd65240c364c90a31569a133b7b60de111c255ef5b606f2ae291", - "sha256:48ca08c771c268a768087b408658e216133aecd835c0ded47ce955381105ba39", - "sha256:4afe7ea89de619adc868e087b4d2359282058479d7cfb94970adf4b55284574d", - "sha256:4ce3ac6cdb6adf7946475d7ef31777c26d94bccc377e070a7986bd2d5c515467", - "sha256:4ead44c85f8ab905852d3de8d86f6f8baf77109f9da589cb4fa142bd3b57b475", - "sha256:54558ea205654b50c438029505def3834e80f0869a70fb15b871c29b4575ddef", - "sha256:5e06afd14cbaf9e00899fae69b24a32f2196c19de08fcb9f4779dd4f004e5e7c", - "sha256:62ee94988d6b4722ce0028644418d93a52429e977d742ca2ccbe1c4f4a792511", - "sha256:63e4844797b975b9af3a3fb8f7866ff08775f5426925e1e0bbcfe7932059a12c", - "sha256:6510bf84a6b643dabba74d3049ead221257603a253d0a9873f55f6a59a65f822", - "sha256:667a9706c970cb552ede35aee17339a18e8f2a87a51fba2ed39ceeeb1004798a", - "sha256:6ef9ea3f137e5711f0dbe5f9263e8c009b7069d8a1acea822bd5e9dae0ae49c8", - "sha256:7017b2be767b9d43cc31416aba48aab0d2309ee31b4dbf10a1d38fb7972bdf9d", - "sha256:7124e16b4c55d417577c2077be379514321916d5790fa287c9ed6f23bd2ffd01", - "sha256:73aaad12ac0ff500f62cebed98d8789198ea0e6f233421059fa68a5aa7220145", - "sha256:77c386de38a60d1dfb8e55b8c1101d68c79dfdd25c7095d51fec2dd800892b80", - "sha256:7876452af029456b3f3549b696bb36a06db7c90747740c5302f74a9e9fa14b13", - "sha256:7939aa3ca7d2a1593596e7ac6d59391ff30281ef280d8632fa03d81f7c5f955e", - "sha256:8320f64b777d00dd7ccdade271eaf0cad6636343293a25074cc5566160e4de7b", - "sha256:85f3ff71e2e60bd4b4932a043fbbe0f499e263c628390b285cb599154a3b03b1", - "sha256:8b8b36671f10ba80e159378df9c4f15c14098c4fd73a36b9ad715f057272fbef", - "sha256:93147c513fac16385d1036b7e5b102c7fbbdb163d556b791f0f11eada7ba65dc", - "sha256:935e943ec47c4afab8965954bf49bfa639c05d4ccf9ef6e924188f762145c0ff", - "sha256:94b6150a85e1b33b40b1464a3f9988dcc5251d6ed06842abff82e42632fac120", - "sha256:94ebba31df2aa506d7b14866fed00ac141a867e63143fe5bca82a8e503b36437", - "sha256:95ffcf719966dd7c453f908e208e14cde192e09fde6c7186c8f1896ef778d8cd", - "sha256:98884ecf2ffb7d7fe6bd517e8eb99d31ff7855a840fa6d0d63cd07c037f6a981", - "sha256:99cfaa2110534e2cf3ba31a7abcac9d328d1d9f1b95beede58294a60348fba36", - "sha256:9e8f8c9cb53cdac7ba9793c276acd90168f416b9ce36799b9b885790f8ad6c0a", - "sha256:a0dfc6c143b519113354e780a50381508139b07d2177cb6ad6a08278ec655798", - "sha256:b2795058c23988728eec1f36a4e5e4ebad22f8320c85f3587b539b9ac84128d7", - "sha256:b42703b1cf69f2aa1df7d1030b9d77d3e584a70755674d60e710f0af570f3761", - "sha256:b7cede291382a78f7bb5f04a529cb18e068dd29e0fb27376074b6d0317bf4dd0", - "sha256:b8a678974d1f3aa55f6cc34dc480169d58f2e6d8958895d68845fa4ab566509e", - "sha256:b8da394b34370874b4572676f36acabac172602abf054cbc4ac910219f3340af", - "sha256:c3a701fe5a9695b238503ce5bbe8218e03c3bcccf7e204e455e7462d770268aa", - "sha256:c4aab7f6381f38a4b42f269057aee279ab0fc7bf2e929e3d4abfae97b682a12c", - "sha256:ca9d0ff5ad43e785350894d97e13633a66e2b50000e8a183a50a88d834752d42", - "sha256:d0028e725ee18175c6e422797c407874da24381ce0690d6b9396c204c7f7276e", - "sha256:d21e10da6ec19b457b82636209cbe2331ff4306b54d06fa04b7c138ba18c8a81", - "sha256:d5e975ca70269d66d17dd995dafc06f1b06e8cb1ec1e9ed54c1d1e4a7c4cf26e", - "sha256:da7a9bff22ce038e19bf62c4dd1ec8391062878710ded0a845bcf47cc0200617", - "sha256:db32b5348615a04b82240cc67983cb315309e88d444a288934ee6ceaebcad6cc", - "sha256:dcc62f31eae24de7f8dce72134c8651c58000d3b1868e01392baea7c32c247de", - "sha256:dfc59d69fc48664bc693842bd57acfdd490acafda1ab52c7836e3fc75c90a111", - "sha256:e347b3bfcf985a05e8c0b7d462ba6f15b1ee1c909e2dcad795e49e91b152c383", - "sha256:e4d333e558953648ca09d64f13e6d8f0523fa705f51cae3f03b5983489958c70", - "sha256:ed10eac5830befbdd0c32f83e8aa6288361597550ba669b04c48f0f9a2c843c6", - "sha256:efc0f674aa41b92da8c49e0346318c6075d734994c3c4e4430b1c3f853e498e4", - "sha256:f1695e76146579f8c06c1509c7ce4dfe0706f49c6831a817ac04eebb2fd02011", - "sha256:f1d4aeb8891338e60d1ab6127af1fe45def5259def8094b9c7e34690c8858803", - "sha256:f406b22b7c9a9b4f8aa9d2ab13d6ae0ac3e85c9a809bd590ad53fed2bf70dc79", - "sha256:f6ff3b14f2df4c41660a7dec01045a045653998784bf8cfcb5a525bdffffbc8f" - ], - "markers": "python_version < '3.14' and (platform_machine == 'aarch64' or (platform_machine == 'ppc64le' or (platform_machine == 'x86_64' or (platform_machine == 'amd64' or (platform_machine == 'AMD64' or (platform_machine == 'win32' or platform_machine == 'WIN32'))))))", - "version": "==3.1.1" + "sha256:00fadb3fedccc447f517ee0d3fd8fe49eae949e1cd0f6a611818f4f6fb7dc83b", + "sha256:061dc4cf2c34852b052a8620d40f36324554bc192be474b9e9770e8c042fd735", + "sha256:0db5594dce18db94f7d1650d7489909b57afde4c580806b8d9203b6e79cdc079", + "sha256:0dca0d95ff849f9a364385f36ab49f50065d76964944638be9691e1832e9f86d", + "sha256:16458c245a38991aa19676900d48bd1a6f2ce3e16595051a4db9d012154e8433", + "sha256:18d9260df2b5fbf41ae5139e1be4e796d99655f023a636cd0e11e6406cca7d58", + "sha256:1987de92fec508535687fb807a5cea1560f6196285a4cde35c100b8cd632cc52", + "sha256:1a921e542453fe531144e91e1feedf12e07351b1cf6c9e8a3325ea600a715a31", + "sha256:1ee8fae0519a337f2329cb78bd7a8e128ec0f881073d43f023c7b8d4831d5246", + "sha256:20fb936b4652b6e307b8f347665e2c615540d4b42b3b4c8a321d8286da7e520f", + "sha256:23768528f2911bcd7e475210822ffb5254ed10d71f4028387e5a99b4c6699671", + "sha256:2523e5246274f54fdadbce8494458a2ebdcdbc7b802318466ac5606d3cded1f8", + "sha256:27890167f55d2387576d1f41d9487ef171849ea0359ce1510ca6e06c8bece11d", + "sha256:299fd615cd8fc86267b47597123e3f43ad79c9d8a22bebdce535e53550763e2f", + "sha256:3b3812d8d0c9579967815af437d96623f45c0f2ae5f04e366de62a12d83a8fb0", + "sha256:3b67ca49f54cede0186854a008109d6ee71f66bd57bb36abd6d0a0267b540cdd", + "sha256:44358b9bf66c8576a9f57a590d5f5d6e72fa4228b763d0e43fee6d3b06d3a337", + "sha256:49a30d5fda2507ae77be16479bdb62a660fa51b1eb4928b524975b3bde77b3c0", + "sha256:4d1378601b85e2e5171b99be8d2dc85f594c79967599328f95c1dc1a40f1c633", + "sha256:554b03b6e73aaabec3745364d6239e9e012d64c68ccd0b8430c64ccc14939a8b", + "sha256:55e9c5affaa6775e2c6b67659f3a71684de4c549b3dd9afca3bc773533d284fa", + "sha256:58b97143c9cc7b86fc458f215bd0932f1757ce649e05b640fea2e79b54cedb31", + "sha256:5c9320971821a7cb77cfab8d956fa8e39cd07ca44b6070db358ceb7f8797c8c9", + "sha256:65458b409c1ed459ea899e939f0e1cdb14f58dbc803f2f93c5eab5694d32671b", + "sha256:671df96c1f23c4a0d4077a325483c1503c96a1b7d9db26592ae770daa41233d4", + "sha256:710638eb93b1fa52823aa91bf75326f9ecdfd5e0466f00789246a5280f4ba0fc", + "sha256:73f49b5368b5359d04e18d15828eecc1806033db5233397748f4ca813ff1056c", + "sha256:81701fd84f26330f0d5f4944d4e92e61afe6319dcd9775e39396e39d7c3e5f98", + "sha256:8854167e06950ca75b898b104b63cc646573aa5fef1353d4508ecdd1ee76254f", + "sha256:8c68325b0d0acf8d91dde4e6f930967dd52a5302cd4062932a6b2e7c2969f47c", + "sha256:94385f101946790ae13da500603491f04a76b6e4c059dab271b3ce2e283b2590", + "sha256:94abf90142c2a18151632371140b3dba4dee031633fe614cb592dbb6c9e17bc3", + "sha256:96378df1de302bc38e99c3a9aa311967b7dc80ced1dcc6f171e99842987882a2", + "sha256:9c40adce87eaa9ddb593ccb0fa6a07caf34015a29bf8d344811665b573138db9", + "sha256:9fe0a28a7b952a21e2c062cd5756d34354117796c6d9215a87f55e38d15402c5", + "sha256:a7d4e128405eea3814a12cc2605e0e6aedb4035bf32697f72deca74de4105e02", + "sha256:abbf57b5a870d30c4675928c37278493044d7c14378350b3aa5d484fa65575f0", + "sha256:b4a1870c51720687af7fa3e7cda6d08d801dae660f75a76f3845b642b4da6ee1", + "sha256:b6a7c19cf0d2742d0809a4c05975db036fdff50cd294a93632d6a310bf9ac02c", + "sha256:b90654e092f928f110e0007f572007c9727b5265f7632c2fa7415b4689351594", + "sha256:c17b6b34111ea72fc5a4e4beec9711d2226285f0386ea83477cbb97c30a3f3a5", + "sha256:c2ca18a03a8cfb5b25bc1cbe20f3d9a4c80d8c3b13ba3df49ac3961af0b1018d", + "sha256:c5111ccdc9c88f423426df3fd1811bfc40ed66264d35aa373420a34377efc98a", + "sha256:c60a6d84229b271d44b70fb6e5fa23781abb5d742af7b808ae3f6efd7c9c60f6", + "sha256:c8c9e331e58180d0d83c5b7999255721b725913ff6bc6cf39fa2a45841a4fd4b", + "sha256:c9913f1a30e4526f432991f89ae263459b1c64d1608c0d22a5c79c287b3c70df", + "sha256:cd3c8e693bff0fff6ba55f140bf390fa92c994083f838fece0f63be121334945", + "sha256:d25c5091190f2dc0eaa3f950252122edbbadbb682aa7b1ef2f8af0f8c0afefae", + "sha256:d2e685ade4dafd447ede19c31277a224a239a0a1a4eca4e6390efedf20260cfb", + "sha256:d76383238584e9711e20ebe14db6c88ddcedc1829a9ad31a584389463b5aa504", + "sha256:ddf9164e7a5b08e9d22511526865780a576f19ddd00d62f8a665949327fde8bb", + "sha256:e37ab26028f12dbb0ff65f29a8d3d44a765c61e729647bf2ddfbbed621726f01", + "sha256:f10fd42b5ee276335863712fa3da6608e93f70629c631bf77145021600abc23c", + "sha256:f28588772bb5fb869a8eb331374ec06f24a83a9c25bfa1f38b6993afe9c1e968" + ], + "markers": "python_version >= '3.9'", + "version": "==3.2.4" }, "gunicorn": { "hashes": [ @@ -199,6 +299,14 @@ "index": "pypi", "version": "==23.0.0" }, + "idna": { + "hashes": [ + "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9", + "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3" + ], + "markers": "python_version >= '3.6'", + "version": "==3.10" + }, "itsdangerous": { "hashes": [ "sha256:c6242fc49e35958c8b15141343aa660db5fc54d4f13a1db01a3f5891b98700ef", @@ -209,19 +317,19 @@ }, "jinja2": { "hashes": [ - "sha256:8fefff8dc3034e27bb80d67c671eb8a9bc424c0ef4c0826edbff304cceff43bb", - "sha256:aba0f4dc9ed8013c424088f68a5c226f7d6097ed89b246d7749c2ec4175c6adb" + "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", + "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67" ], "markers": "python_version >= '3.7'", - "version": "==3.1.5" + "version": "==3.1.6" }, "mako": { "hashes": [ - "sha256:95920acccb578427a9aa38e37a186b1e43156c87260d7ba18ca63aa4c7cbd3a1", - "sha256:b5d65ff3462870feec922dbccf38f6efb44e5714d7b593a656be86663d8600ac" + "sha256:99579a6f39583fa7e5630a28c3c1f440e4e97a414b80372649c0ce338da2ea28", + "sha256:baef24a52fc4fc514a0887ac600f9f1cff3d82c61d4d700a1fa84d597b88db59" ], "markers": "python_version >= '3.8'", - "version": "==1.3.9" + "version": "==1.3.10" }, "markupsafe": { "hashes": [ @@ -290,6 +398,14 @@ "markers": "python_version >= '3.9'", "version": "==3.0.2" }, + "oauthlib": { + "hashes": [ + "sha256:0f0f8aa759826a193cf66c12ea1af1637f87b9b4622d46e866952bb022e538c9", + "sha256:88119c938d2b8fb88561af5f6ee0eec8cc8d552b7bb1f712743136eb7523b7a1" + ], + "markers": "python_version >= '3.8'", + "version": "==3.3.1" + }, "packaging": { "hashes": [ "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", @@ -372,6 +488,22 @@ "index": "pypi", "version": "==2.9.10" }, + "pyasn1": { + "hashes": [ + "sha256:0d632f46f2ba09143da3a8afe9e33fb6f92fa2320ab7e886e2d0f7672af84629", + "sha256:6f580d2bdd84365380830acf45550f2511469f673cb4a5ae3857a3170128b034" + ], + "markers": "python_version >= '3.8'", + "version": "==0.6.1" + }, + "pyasn1-modules": { + "hashes": [ + "sha256:29253a9207ce32b64c3ac6600edc75368f98473906e8fd1043bd6b5b1de2c14a", + "sha256:677091de870a80aae844b1ca6134f54652fa2c8c5a52aa396440ac3106e941e6" + ], + "markers": "python_version >= '3.8'", + "version": "==0.4.2" + }, "pyjwt": { "hashes": [ "sha256:3cc5772eb20009233caf06e9d8a0577824723b44e6648ee0a2aedb6cf9381953", @@ -447,6 +579,31 @@ "markers": "python_version >= '3.8'", "version": "==6.0.2" }, + "requests": { + "hashes": [ + "sha256:2462f94637a34fd532264295e186976db0f5d453d1cdd31473c85a6a161affb6", + "sha256:dbba0bac56e100853db0ea71b82b4dfd5fe2bf6d3754a8893c3af500cec7d7cf" + ], + "index": "pypi", + "markers": "python_version >= '3.9'", + "version": "==2.32.5" + }, + "requests-oauthlib": { + "hashes": [ + "sha256:7dd8a5c40426b779b0868c404bdef9768deccf22749cde15852df527e6269b36", + "sha256:b3dffaebd884d8cd778494369603a9e7b58d29111bf6b41bdc2dcd87203af4e9" + ], + "markers": "python_version >= '3.4'", + "version": "==2.0.0" + }, + "rsa": { + "hashes": [ + "sha256:68635866661c6836b8d39430f97a996acbd61bfa49406748ea243539fe239762", + "sha256:e7bdbfdb5497da4c07dfd35530e1a902659db6ff241e39d9953cad06ebd0ae75" + ], + "markers": "python_version >= '3.6' and python_version < '4'", + "version": "==4.9.1" + }, "six": { "hashes": [ "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", @@ -457,82 +614,84 @@ }, "sqlalchemy": { "hashes": [ - "sha256:0398361acebb42975deb747a824b5188817d32b5c8f8aba767d51ad0cc7bb08d", - "sha256:0561832b04c6071bac3aad45b0d3bb6d2c4f46a8409f0a7a9c9fa6673b41bc03", - "sha256:07258341402a718f166618470cde0c34e4cec85a39767dce4e24f61ba5e667ea", - "sha256:0a826f21848632add58bef4f755a33d45105d25656a0c849f2dc2df1c71f6f50", - "sha256:1052723e6cd95312f6a6eff9a279fd41bbae67633415373fdac3c430eca3425d", - "sha256:12d5b06a1f3aeccf295a5843c86835033797fea292c60e72b07bcb5d820e6dd3", - "sha256:12f5c9ed53334c3ce719155424dc5407aaa4f6cadeb09c5b627e06abb93933a1", - "sha256:2a0ef3f98175d77180ffdc623d38e9f1736e8d86b6ba70bff182a7e68bed7727", - "sha256:2f2951dc4b4f990a4b394d6b382accb33141d4d3bd3ef4e2b27287135d6bdd68", - "sha256:3868acb639c136d98107c9096303d2d8e5da2880f7706f9f8c06a7f961961149", - "sha256:386b7d136919bb66ced64d2228b92d66140de5fefb3c7df6bd79069a269a7b06", - "sha256:3d3043375dd5bbcb2282894cbb12e6c559654c67b5fffb462fda815a55bf93f7", - "sha256:3e35d5565b35b66905b79ca4ae85840a8d40d31e0b3e2990f2e7692071b179ca", - "sha256:402c2316d95ed90d3d3c25ad0390afa52f4d2c56b348f212aa9c8d072a40eee5", - "sha256:40310db77a55512a18827488e592965d3dec6a3f1e3d8af3f8243134029daca3", - "sha256:40e9cdbd18c1f84631312b64993f7d755d85a3930252f6276a77432a2b25a2f3", - "sha256:49aa2cdd1e88adb1617c672a09bf4ebf2f05c9448c6dbeba096a3aeeb9d4d443", - "sha256:57dd41ba32430cbcc812041d4de8d2ca4651aeefad2626921ae2a23deb8cd6ff", - "sha256:5dba1cdb8f319084f5b00d41207b2079822aa8d6a4667c0f369fce85e34b0c86", - "sha256:5e1d9e429028ce04f187a9f522818386c8b076723cdbe9345708384f49ebcec6", - "sha256:63178c675d4c80def39f1febd625a6333f44c0ba269edd8a468b156394b27753", - "sha256:6493bc0eacdbb2c0f0d260d8988e943fee06089cd239bd7f3d0c45d1657a70e2", - "sha256:64aa8934200e222f72fcfd82ee71c0130a9c07d5725af6fe6e919017d095b297", - "sha256:665255e7aae5f38237b3a6eae49d2358d83a59f39ac21036413fab5d1e810578", - "sha256:6db316d6e340f862ec059dc12e395d71f39746a20503b124edc255973977b728", - "sha256:70065dfabf023b155a9c2a18f573e47e6ca709b9e8619b2e04c54d5bcf193178", - "sha256:8455aa60da49cb112df62b4721bd8ad3654a3a02b9452c783e651637a1f21fa2", - "sha256:8b0ac78898c50e2574e9f938d2e5caa8fe187d7a5b69b65faa1ea4648925b096", - "sha256:8bf312ed8ac096d674c6aa9131b249093c1b37c35db6a967daa4c84746bc1bc9", - "sha256:92f99f2623ff16bd4aaf786ccde759c1f676d39c7bf2855eb0b540e1ac4530c8", - "sha256:9c8bcad7fc12f0cc5896d8e10fdf703c45bd487294a986903fe032c72201596b", - "sha256:9cd136184dd5f58892f24001cdce986f5d7e96059d004118d5410671579834a4", - "sha256:9eb4fa13c8c7a2404b6a8e3772c17a55b1ba18bc711e25e4d6c0c9f5f541b02a", - "sha256:a2bc4e49e8329f3283d99840c136ff2cd1a29e49b5624a46a290f04dff48e079", - "sha256:a5645cd45f56895cfe3ca3459aed9ff2d3f9aaa29ff7edf557fa7a23515a3725", - "sha256:a9afbc3909d0274d6ac8ec891e30210563b2c8bdd52ebbda14146354e7a69373", - "sha256:aa498d1392216fae47eaf10c593e06c34476ced9549657fca713d0d1ba5f7248", - "sha256:afd776cf1ebfc7f9aa42a09cf19feadb40a26366802d86c1fba080d8e5e74bdd", - "sha256:b335a7c958bc945e10c522c069cd6e5804f4ff20f9a744dd38e748eb602cbbda", - "sha256:b3c4817dff8cef5697f5afe5fec6bc1783994d55a68391be24cb7d80d2dbc3a6", - "sha256:b79ee64d01d05a5476d5cceb3c27b5535e6bb84ee0f872ba60d9a8cd4d0e6579", - "sha256:b87a90f14c68c925817423b0424381f0e16d80fc9a1a1046ef202ab25b19a444", - "sha256:bf89e0e4a30714b357f5d46b6f20e0099d38b30d45fa68ea48589faf5f12f62d", - "sha256:c058b84c3b24812c859300f3b5abf300daa34df20d4d4f42e9652a4d1c48c8a4", - "sha256:c09a6ea87658695e527104cf857c70f79f14e9484605e205217aae0ec27b45fc", - "sha256:c57b8e0841f3fce7b703530ed70c7c36269c6d180ea2e02e36b34cb7288c50c7", - "sha256:c9cea5b756173bb86e2235f2f871b406a9b9d722417ae31e5391ccaef5348f2c", - "sha256:cb39ed598aaf102251483f3e4675c5dd6b289c8142210ef76ba24aae0a8f8aba", - "sha256:e036549ad14f2b414c725349cce0772ea34a7ab008e9cd67f9084e4f371d1f32", - "sha256:e185ea07a99ce8b8edfc788c586c538c4b1351007e614ceb708fd01b095ef33e", - "sha256:e5a4d82bdb4bf1ac1285a68eab02d253ab73355d9f0fe725a97e1e0fa689decb", - "sha256:eae27ad7580529a427cfdd52c87abb2dfb15ce2b7a3e0fc29fbb63e2ed6f8120", - "sha256:ecef029b69843b82048c5b347d8e6049356aa24ed644006c9a9d7098c3bd3bfd", - "sha256:ee3bee874cb1fadee2ff2b79fc9fc808aa638670f28b2145074538d4a6a5028e", - "sha256:f0d3de936b192980209d7b5149e3c98977c3810d401482d05fb6d668d53c1c63", - "sha256:f53c0d6a859b2db58332e0e6a921582a02c1677cc93d4cbb36fdf49709b327b2", - "sha256:f9d57f1b3061b3e21476b0ad5f0397b112b94ace21d1f439f2db472e568178ae" + "sha256:022e436a1cb39b13756cf93b48ecce7aa95382b9cfacceb80a7d263129dfd019", + "sha256:03d73ab2a37d9e40dec4984d1813d7878e01dbdc742448d44a7341b7a9f408c7", + "sha256:07097c0a1886c150ef2adba2ff7437e84d40c0f7dcb44a2c2b9c905ccfc6361c", + "sha256:11b9503fa6f8721bef9b8567730f664c5a5153d25e247aadc69247c4bc605227", + "sha256:11f43c39b4b2ec755573952bbcc58d976779d482f6f832d7f33a8d869ae891bf", + "sha256:13194276e69bb2af56198fef7909d48fd34820de01d9c92711a5fa45497cc7ed", + "sha256:136063a68644eca9339d02e6693932116f6a8591ac013b0014479a1de664e40a", + "sha256:14111d22c29efad445cd5021a70a8b42f7d9152d8ba7f73304c4d82460946aaa", + "sha256:1681c21dd2ccee222c2fe0bef671d1aef7c504087c9c4e800371cfcc8ac966fc", + "sha256:1a113da919c25f7f641ffbd07fbc9077abd4b3b75097c888ab818f962707eb48", + "sha256:1c6d85327ca688dbae7e2b06d7d84cfe4f3fffa5b5f9e21bb6ce9d0e1a0e0e0a", + "sha256:20d81fc2736509d7a2bd33292e489b056cbae543661bb7de7ce9f1c0cd6e7f24", + "sha256:21b27b56eb2f82653168cefe6cb8e970cdaf4f3a6cb2c5e3c3c1cf3158968ff9", + "sha256:21ba7a08a4253c5825d1db389d4299f64a100ef9800e4624c8bf70d8f136e6ed", + "sha256:227119ce0a89e762ecd882dc661e0aa677a690c914e358f0dd8932a2e8b2765b", + "sha256:25b9fc27650ff5a2c9d490c13c14906b918b0de1f8fcbb4c992712d8caf40e83", + "sha256:334f41fa28de9f9be4b78445e68530da3c5fa054c907176460c81494f4ae1f5e", + "sha256:413391b2239db55be14fa4223034d7e13325a1812c8396ecd4f2c08696d5ccad", + "sha256:4286a1139f14b7d70141c67a8ae1582fc2b69105f1b09d9573494eb4bb4b2687", + "sha256:44337823462291f17f994d64282a71c51d738fc9ef561bf265f1d0fd9116a782", + "sha256:46293c39252f93ea0910aababa8752ad628bcce3a10d3f260648dd472256983f", + "sha256:4bf0edb24c128b7be0c61cd17eef432e4bef507013292415f3fb7023f02b7d4b", + "sha256:4d3d9b904ad4a6b175a2de0738248822f5ac410f52c2fd389ada0b5262d6a1e3", + "sha256:4e6aeb2e0932f32950cf56a8b4813cb15ff792fc0c9b3752eaf067cfe298496a", + "sha256:4fb1a8c5438e0c5ea51afe9c6564f951525795cf432bed0c028c1cb081276685", + "sha256:529064085be2f4d8a6e5fab12d36ad44f1909a18848fcfbdb59cc6d4bbe48efe", + "sha256:52d9b73b8fb3e9da34c2b31e6d99d60f5f99fd8c1225c9dad24aeb74a91e1d29", + "sha256:5cda6b51faff2639296e276591808c1726c4a77929cfaa0f514f30a5f6156921", + "sha256:5d79f9fdc9584ec83d1b3c75e9f4595c49017f5594fee1a2217117647225d738", + "sha256:61f964a05356f4bca4112e6334ed7c208174511bd56e6b8fc86dad4d024d4185", + "sha256:6772e3ca8a43a65a37c88e2f3e2adfd511b0b1da37ef11ed78dea16aeae85bd9", + "sha256:6e2bf13d9256398d037fef09fd8bf9b0bf77876e22647d10761d35593b9ac547", + "sha256:70322986c0c699dca241418fcf18e637a4369e0ec50540a2b907b184c8bca069", + "sha256:788bfcef6787a7764169cfe9859fe425bf44559619e1d9f56f5bddf2ebf6f417", + "sha256:7f1ac7828857fcedb0361b48b9ac4821469f7694089d15550bbcf9ab22564a1d", + "sha256:87accdbba88f33efa7b592dc2e8b2a9c2cdbca73db2f9d5c510790428c09c154", + "sha256:8cee08f15d9e238ede42e9bbc1d6e7158d0ca4f176e4eab21f88ac819ae3bd7b", + "sha256:971ba928fcde01869361f504fcff3b7143b47d30de188b11c6357c0505824197", + "sha256:9c2e02f06c68092b875d5cbe4824238ab93a7fa35d9c38052c033f7ca45daa18", + "sha256:9c5a9da957c56e43d72126a3f5845603da00e0293720b03bde0aacffcf2dc04f", + "sha256:9df7126fd9db49e3a5a3999442cc67e9ee8971f3cb9644250107d7296cb2a164", + "sha256:b3edaec7e8b6dc5cd94523c6df4f294014df67097c8217a89929c99975811414", + "sha256:b535d35dea8bbb8195e7e2b40059e2253acb2b7579b73c1b432a35363694641d", + "sha256:bcf0724a62a5670e5718957e05c56ec2d6850267ea859f8ad2481838f889b42c", + "sha256:c00e7845d2f692ebfc7d5e4ec1a3fd87698e4337d09e58d6749a16aedfdf8612", + "sha256:c379e37b08c6c527181a397212346be39319fb64323741d23e46abd97a400d34", + "sha256:c5d1730b25d9a07727d20ad74bc1039bbbb0a6ca24e6769861c1aa5bf2c4c4a8", + "sha256:c5e73ba0d76eefc82ec0219d2301cb33bfe5205ed7a2602523111e2e56ccbd20", + "sha256:c697575d0e2b0a5f0433f679bda22f63873821d991e95a90e9e52aae517b2e32", + "sha256:cdeff998cb294896a34e5b2f00e383e7c5c4ef3b4bfa375d9104723f15186443", + "sha256:ceb5c832cc30663aeaf5e39657712f4c4241ad1f638d487ef7216258f6d41fe7", + "sha256:d34c0f6dbefd2e816e8f341d0df7d4763d382e3f452423e752ffd1e213da2512", + "sha256:db691fa174e8f7036afefe3061bc40ac2b770718be2862bfb03aabae09051aca", + "sha256:e7a903b5b45b0d9fa03ac6a331e1c1d6b7e0ab41c63b6217b3d10357b83c8b00", + "sha256:e7c08f57f75a2bb62d7ee80a89686a5e5669f199235c6d1dac75cd59374091c3", + "sha256:f42f23e152e4545157fa367b2435a1ace7571cab016ca26038867eb7df2c3631", + "sha256:fe2b3b4927d0bc03d02ad883f402d5de201dbc8894ac87d2e981e7d87430e60d" ], "index": "pypi", - "version": "==2.0.38" + "markers": "python_version >= '3.7'", + "version": "==2.0.43" }, "typing-extensions": { "hashes": [ - "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d", - "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8" + "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", + "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548" ], "index": "pypi", - "version": "==4.12.2" + "markers": "python_version >= '3.9'", + "version": "==4.15.0" }, "urllib3": { "hashes": [ - "sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df", - "sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d" + "sha256:3fc47733c7e419d4bc3f6b3dc2b4f890bb743906a30d56ba4a5bfa4bbff92760", + "sha256:e6b01673c0fa6a13e374b50871808eb3bf7046c4b125b216f6bf1cc604cff0dc" ], "markers": "python_version >= '3.9'", - "version": "==2.3.0" + "version": "==2.5.0" }, "werkzeug": { "hashes": [ diff --git a/calhost b/calhost new file mode 100644 index 0000000000..e69de29bb2 diff --git a/migrations/versions/0763d677d453_.py b/migrations/versions/0763d677d453_.py deleted file mode 100644 index 88964176f1..0000000000 --- a/migrations/versions/0763d677d453_.py +++ /dev/null @@ -1,35 +0,0 @@ -"""empty message - -Revision ID: 0763d677d453 -Revises: -Create Date: 2025-02-25 14:47:16.337069 - -""" -from alembic import op -import sqlalchemy as sa - - -# revision identifiers, used by Alembic. -revision = '0763d677d453' -down_revision = None -branch_labels = None -depends_on = None - - -def upgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.create_table('user', - sa.Column('id', sa.Integer(), nullable=False), - sa.Column('email', sa.String(length=120), nullable=False), - sa.Column('password', sa.String(), nullable=False), - sa.Column('is_active', sa.Boolean(), nullable=False), - sa.PrimaryKeyConstraint('id'), - sa.UniqueConstraint('email') - ) - # ### end Alembic commands ### - - -def downgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.drop_table('user') - # ### end Alembic commands ### diff --git a/migrations/versions/d93ef08ef900_init.py b/migrations/versions/d93ef08ef900_init.py new file mode 100644 index 0000000000..efdcf457fd --- /dev/null +++ b/migrations/versions/d93ef08ef900_init.py @@ -0,0 +1,245 @@ +"""init + +Revision ID: d93ef08ef900 +Revises: +Create Date: 2025-08-28 15:53:18.648875 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'd93ef08ef900' +down_revision = None +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('category', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('name', sa.String(length=50), nullable=False), + sa.PrimaryKeyConstraint('id'), + sa.UniqueConstraint('name') + ) + op.create_table('rol', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('type', sa.String(length=50), nullable=False), + sa.PrimaryKeyConstraint('id'), + sa.UniqueConstraint('type') + ) + op.create_table('user', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('email', sa.String(length=120), nullable=False), + sa.Column('username', sa.String(length=80), nullable=False), + sa.Column('password', sa.String(length=200), nullable=False), + sa.Column('created_at', sa.DateTime(), server_default=sa.text('(CURRENT_TIMESTAMP)'), nullable=False), + sa.Column('modified_at', sa.DateTime(), server_default=sa.text('(CURRENT_TIMESTAMP)'), nullable=False), + sa.PrimaryKeyConstraint('id'), + sa.UniqueConstraint('email'), + sa.UniqueConstraint('username') + ) + op.create_table('account_settings', + sa.Column('user_id', sa.Integer(), nullable=False), + sa.Column('phone', sa.String(length=20), nullable=True), + sa.Column('billing_info', sa.String(length=250), nullable=True), + sa.Column('language', sa.String(length=50), nullable=True), + sa.Column('marketing_emails', sa.Boolean(), nullable=True), + sa.Column('created_at', sa.DateTime(), nullable=False), + sa.Column('modified_at', sa.DateTime(), nullable=False), + sa.ForeignKeyConstraint(['user_id'], ['user.id'], ), + sa.PrimaryKeyConstraint('user_id') + ) + op.create_table('profile', + sa.Column('user_id', sa.Integer(), nullable=False), + sa.Column('name', sa.String(length=100), nullable=False), + sa.Column('last_name', sa.String(length=100), nullable=False), + sa.Column('avatar', sa.String(length=100), nullable=True), + sa.Column('city', sa.String(length=50), nullable=False), + sa.Column('birth_date', sa.Date(), nullable=True), + sa.Column('bio', sa.String(length=250), nullable=True), + sa.Column('skills', sa.String(length=250), nullable=True), + sa.Column('rating_avg', sa.Float(), nullable=True), + sa.Column('created_at', sa.DateTime(), nullable=False), + sa.Column('modified_at', sa.DateTime(), nullable=False), + sa.ForeignKeyConstraint(['user_id'], ['user.id'], ), + sa.PrimaryKeyConstraint('user_id') + ) + op.create_table('task', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('title', sa.String(length=120), nullable=True), + sa.Column('description', sa.Text(), nullable=True), + sa.Column('location', sa.String(length=120), nullable=True), + sa.Column('price', sa.Numeric(precision=10, scale=2), nullable=True), + sa.Column('due_at', sa.DateTime(), nullable=True), + sa.Column('posted_at', sa.Date(), server_default=sa.text('(CURRENT_DATE)'), nullable=False), + sa.Column('assigned_at', sa.Date(), nullable=True), + sa.Column('completed_at', sa.Date(), nullable=True), + sa.Column('status', sa.String(length=30), server_default='pending', nullable=False), + sa.Column('publisher_id', sa.Integer(), nullable=False), + sa.ForeignKeyConstraint(['publisher_id'], ['user.id'], ), + sa.PrimaryKeyConstraint('id') + ) + with op.batch_alter_table('task', schema=None) as batch_op: + batch_op.create_index(batch_op.f('ix_task_publisher_id'), ['publisher_id'], unique=False) + + op.create_table('user_rol', + sa.Column('user_id', sa.Integer(), nullable=False), + sa.Column('role_id', sa.Integer(), nullable=False), + sa.ForeignKeyConstraint(['role_id'], ['rol.id'], ), + sa.ForeignKeyConstraint(['user_id'], ['user.id'], ), + sa.PrimaryKeyConstraint('user_id', 'role_id') + ) + op.create_table('task_categories', + sa.Column('task_id', sa.Integer(), nullable=False), + sa.Column('category_id', sa.Integer(), nullable=False), + sa.ForeignKeyConstraint(['category_id'], ['category.id'], ondelete='CASCADE'), + sa.ForeignKeyConstraint(['task_id'], ['task.id'], ondelete='CASCADE'), + sa.PrimaryKeyConstraint('task_id', 'category_id') + ) + op.create_table('tasks_offered', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('status', sa.Numeric(precision=10, scale=2), nullable=True), + sa.Column('created_at', sa.Date(), server_default=sa.text('(CURRENT_DATE)'), nullable=False), + sa.Column('updated_at', sa.Date(), server_default=sa.text('(CURRENT_DATE)'), nullable=False), + sa.Column('task_id', sa.Integer(), nullable=False), + sa.Column('tasker_id', sa.Integer(), nullable=False), + sa.ForeignKeyConstraint(['task_id'], ['task.id'], ), + sa.ForeignKeyConstraint(['tasker_id'], ['user.id'], ), + sa.PrimaryKeyConstraint('id'), + sa.UniqueConstraint('task_id', 'tasker_id', name='uq_tasks_offered_task_tasker') + ) + with op.batch_alter_table('tasks_offered', schema=None) as batch_op: + batch_op.create_index(batch_op.f('ix_tasks_offered_task_id'), ['task_id'], unique=False) + batch_op.create_index(batch_op.f('ix_tasks_offered_tasker_id'), ['tasker_id'], unique=False) + + op.create_table('task_dealed', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('fixed_price', sa.Numeric(precision=10, scale=2), nullable=True), + sa.Column('status', sa.String(length=30), nullable=False), + sa.Column('accepted_at', sa.Date(), nullable=True), + sa.Column('delivered_at', sa.Date(), nullable=True), + sa.Column('cancelled_at', sa.Date(), nullable=True), + sa.Column('task_id', sa.Integer(), nullable=False), + sa.Column('offer_id', sa.Integer(), nullable=False), + sa.Column('client_id', sa.Integer(), nullable=False), + sa.Column('tasker_id', sa.Integer(), nullable=False), + sa.ForeignKeyConstraint(['client_id'], ['user.id'], ), + sa.ForeignKeyConstraint(['offer_id'], ['tasks_offered.id'], ), + sa.ForeignKeyConstraint(['task_id'], ['task.id'], ), + sa.ForeignKeyConstraint(['tasker_id'], ['user.id'], ), + sa.PrimaryKeyConstraint('id') + ) + with op.batch_alter_table('task_dealed', schema=None) as batch_op: + batch_op.create_index(batch_op.f('ix_task_dealed_client_id'), ['client_id'], unique=False) + batch_op.create_index(batch_op.f('ix_task_dealed_offer_id'), ['offer_id'], unique=False) + batch_op.create_index(batch_op.f('ix_task_dealed_task_id'), ['task_id'], unique=False) + batch_op.create_index(batch_op.f('ix_task_dealed_tasker_id'), ['tasker_id'], unique=False) + + op.create_table('dispute', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('reason', sa.String(length=120), nullable=False), + sa.Column('details', sa.String(length=1000), nullable=False), + sa.Column('status', sa.String(length=30), nullable=False), + sa.Column('resolution', sa.String(length=1000), nullable=True), + sa.Column('created_at', sa.DateTime(timezone=True), nullable=True), + sa.Column('updated_at', sa.DateTime(timezone=True), nullable=True), + sa.Column('dealed_id', sa.Integer(), nullable=False), + sa.Column('raised_by', sa.Integer(), nullable=False), + sa.Column('resolved_by_admin_user', sa.Integer(), nullable=True), + sa.ForeignKeyConstraint(['dealed_id'], ['task_dealed.id'], ), + sa.ForeignKeyConstraint(['raised_by'], ['user.id'], ), + sa.ForeignKeyConstraint(['resolved_by_admin_user'], ['user.id'], ), + sa.PrimaryKeyConstraint('id'), + sa.UniqueConstraint('dealed_id') + ) + op.create_table('message', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('body', sa.String(length=10000), nullable=True), + sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text('(CURRENT_TIMESTAMP)'), nullable=True), + sa.Column('dealer_id', sa.Integer(), nullable=False), + sa.Column('sender_id', sa.Integer(), nullable=False), + sa.ForeignKeyConstraint(['dealer_id'], ['task_dealed.id'], ), + sa.ForeignKeyConstraint(['sender_id'], ['user.id'], ), + sa.PrimaryKeyConstraint('id'), + sa.UniqueConstraint('dealer_id') + ) + op.create_table('payments', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('amount', sa.Numeric(precision=10, scale=2), nullable=False), + sa.Column('status', sa.String(length=20), nullable=False), + sa.Column('created_at', sa.Date(), server_default=sa.text('(CURRENT_DATE)'), nullable=False), + sa.Column('updated_at', sa.Date(), server_default=sa.text('(CURRENT_DATE)'), nullable=False), + sa.Column('dealed_id', sa.Integer(), nullable=False), + sa.ForeignKeyConstraint(['dealed_id'], ['task_dealed.id'], ondelete='CASCADE'), + sa.PrimaryKeyConstraint('id') + ) + with op.batch_alter_table('payments', schema=None) as batch_op: + batch_op.create_index(batch_op.f('ix_payments_dealed_id'), ['dealed_id'], unique=True) + + op.create_table('review', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('review', sa.String(length=10000), nullable=True), + sa.Column('rate', sa.Numeric(precision=3, scale=2), nullable=False), + sa.Column('created_at', sa.DateTime(timezone=True), nullable=True), + sa.Column('publisher_id', sa.Integer(), nullable=False), + sa.Column('worker_id', sa.Integer(), nullable=False), + sa.Column('task_dealed_id', sa.Integer(), nullable=False), + sa.Column('task_id', sa.Integer(), nullable=False), + sa.ForeignKeyConstraint(['publisher_id'], ['user.id'], ), + sa.ForeignKeyConstraint(['task_dealed_id'], ['task_dealed.id'], ), + sa.ForeignKeyConstraint(['task_id'], ['task.id'], ), + sa.ForeignKeyConstraint(['worker_id'], ['user.id'], ), + sa.PrimaryKeyConstraint('id'), + sa.UniqueConstraint('task_dealed_id') + ) + op.create_table('admin_action', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('action', sa.String(length=60), nullable=False), + sa.Column('created_at', sa.DateTime(timezone=True), nullable=True), + sa.Column('dispute_id', sa.Integer(), nullable=False), + sa.Column('admin_user', sa.Integer(), nullable=False), + sa.ForeignKeyConstraint(['admin_user'], ['user.id'], ), + sa.ForeignKeyConstraint(['dispute_id'], ['dispute.id'], ), + sa.PrimaryKeyConstraint('id'), + sa.UniqueConstraint('admin_user') + ) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_table('admin_action') + op.drop_table('review') + with op.batch_alter_table('payments', schema=None) as batch_op: + batch_op.drop_index(batch_op.f('ix_payments_dealed_id')) + + op.drop_table('payments') + op.drop_table('message') + op.drop_table('dispute') + with op.batch_alter_table('task_dealed', schema=None) as batch_op: + batch_op.drop_index(batch_op.f('ix_task_dealed_tasker_id')) + batch_op.drop_index(batch_op.f('ix_task_dealed_task_id')) + batch_op.drop_index(batch_op.f('ix_task_dealed_offer_id')) + batch_op.drop_index(batch_op.f('ix_task_dealed_client_id')) + + op.drop_table('task_dealed') + with op.batch_alter_table('tasks_offered', schema=None) as batch_op: + batch_op.drop_index(batch_op.f('ix_tasks_offered_tasker_id')) + batch_op.drop_index(batch_op.f('ix_tasks_offered_task_id')) + + op.drop_table('tasks_offered') + op.drop_table('task_categories') + op.drop_table('user_rol') + with op.batch_alter_table('task', schema=None) as batch_op: + batch_op.drop_index(batch_op.f('ix_task_publisher_id')) + + op.drop_table('task') + op.drop_table('profile') + op.drop_table('account_settings') + op.drop_table('user') + op.drop_table('rol') + op.drop_table('category') + # ### end Alembic commands ### diff --git a/package-lock.json b/package-lock.json index 8d43d98ab7..08a7ffd6bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,9 +9,11 @@ "version": "1.0.1", "license": "ISC", "dependencies": { + "@react-oauth/google": "^0.12.2", "prop-types": "^15.8.1", "react": "^18.2.0", "react-dom": "^18.2.0", + "react-google-recaptcha": "^3.1.0", "react-router-dom": "^6.18.0" }, "devDependencies": { @@ -943,6 +945,16 @@ "node": ">= 8" } }, + "node_modules/@react-oauth/google": { + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/@react-oauth/google/-/google-0.12.2.tgz", + "integrity": "sha512-d1GVm2uD4E44EJft2RbKtp8Z1fp/gK8Lb6KHgs3pHlM0PxCXGLaq8LLYQYENnN4xPWO1gkL4apBtlPKzpLvZwg==", + "license": "MIT", + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, "node_modules/@remix-run/router": { "version": "1.22.0", "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.22.0.tgz", @@ -2564,6 +2576,15 @@ "node": ">= 0.4" } }, + "node_modules/hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "license": "BSD-3-Clause", + "dependencies": { + "react-is": "^16.7.0" + } + }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -3493,6 +3514,19 @@ "node": ">=0.10.0" } }, + "node_modules/react-async-script": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/react-async-script/-/react-async-script-1.2.0.tgz", + "integrity": "sha512-bCpkbm9JiAuMGhkqoAiC0lLkb40DJ0HOEJIku+9JDjxX3Rcs+ztEOG13wbrOskt3n2DTrjshhaQ/iay+SnGg5Q==", + "license": "MIT", + "dependencies": { + "hoist-non-react-statics": "^3.3.0", + "prop-types": "^15.5.0" + }, + "peerDependencies": { + "react": ">=16.4.1" + } + }, "node_modules/react-dom": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", @@ -3506,6 +3540,19 @@ "react": "^18.3.1" } }, + "node_modules/react-google-recaptcha": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/react-google-recaptcha/-/react-google-recaptcha-3.1.0.tgz", + "integrity": "sha512-cYW2/DWas8nEKZGD7SCu9BSuVz8iOcOLHChHyi7upUuVhkpkhYG/6N3KDiTQ3XAiZ2UAZkfvYKMfAHOzBOcGEg==", + "license": "MIT", + "dependencies": { + "prop-types": "^15.5.0", + "react-async-script": "^1.2.0" + }, + "peerDependencies": { + "react": ">=16.4.1" + } + }, "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", @@ -4998,6 +5045,12 @@ "fastq": "^1.6.0" } }, + "@react-oauth/google": { + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/@react-oauth/google/-/google-0.12.2.tgz", + "integrity": "sha512-d1GVm2uD4E44EJft2RbKtp8Z1fp/gK8Lb6KHgs3pHlM0PxCXGLaq8LLYQYENnN4xPWO1gkL4apBtlPKzpLvZwg==", + "requires": {} + }, "@remix-run/router": { "version": "1.22.0", "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.22.0.tgz", @@ -6115,6 +6168,14 @@ "function-bind": "^1.1.2" } }, + "hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "requires": { + "react-is": "^16.7.0" + } + }, "ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -6706,6 +6767,15 @@ "loose-envify": "^1.1.0" } }, + "react-async-script": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/react-async-script/-/react-async-script-1.2.0.tgz", + "integrity": "sha512-bCpkbm9JiAuMGhkqoAiC0lLkb40DJ0HOEJIku+9JDjxX3Rcs+ztEOG13wbrOskt3n2DTrjshhaQ/iay+SnGg5Q==", + "requires": { + "hoist-non-react-statics": "^3.3.0", + "prop-types": "^15.5.0" + } + }, "react-dom": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", @@ -6715,6 +6785,15 @@ "scheduler": "^0.23.2" } }, + "react-google-recaptcha": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/react-google-recaptcha/-/react-google-recaptcha-3.1.0.tgz", + "integrity": "sha512-cYW2/DWas8nEKZGD7SCu9BSuVz8iOcOLHChHyi7upUuVhkpkhYG/6N3KDiTQ3XAiZ2UAZkfvYKMfAHOzBOcGEg==", + "requires": { + "prop-types": "^15.5.0", + "react-async-script": "^1.2.0" + } + }, "react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", diff --git a/package.json b/package.json index 0caab10749..d8c683d020 100755 --- a/package.json +++ b/package.json @@ -8,10 +8,10 @@ "main": "index.js", "scripts": { "dev": "vite", - "start": "vite", - "build": "vite build", - "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", - "preview": "vite preview" + "start": "vite", + "build": "vite build", + "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", + "preview": "vite preview" }, "author": { "name": "Alejandro Sanchez", @@ -30,13 +30,13 @@ "license": "ISC", "devDependencies": { "@types/react": "^18.2.18", - "@types/react-dom": "^18.2.7", - "@vitejs/plugin-react": "^4.0.4", - "eslint": "^8.46.0", - "eslint-plugin-react": "^7.33.1", - "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-react-refresh": "^0.4.3", - "vite": "^4.4.8" + "@types/react-dom": "^18.2.7", + "@vitejs/plugin-react": "^4.0.4", + "eslint": "^8.46.0", + "eslint-plugin-react": "^7.33.1", + "eslint-plugin-react-hooks": "^4.6.0", + "eslint-plugin-react-refresh": "^0.4.3", + "vite": "^4.4.8" }, "babel": { "presets": [ @@ -54,9 +54,11 @@ ] }, "dependencies": { + "@react-oauth/google": "^0.12.2", "prop-types": "^15.8.1", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-router-dom": "^6.18.0" + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-google-recaptcha": "^3.1.0", + "react-router-dom": "^6.18.0" } } diff --git a/requirements.txt b/requirements.txt index 4eac45f4f8..4f6dd9f3f0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,26 +1,31 @@ --i https://pypi.org/simple -alembic==1.5.4; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' -certifi==2020.12.5 -click==7.1.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' -cloudinary==1.24.0 -flask==1.1.2 -flask-admin==1.5.7 -flask-cors==3.0.10 -flask-migrate==2.6.0 -flask-sqlalchemy==2.4.4 -flask-swagger==0.2.14 -gunicorn==20.0.4 -itsdangerous==1.1.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' -jinja2==2.11.3; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' -mako==1.1.4; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' -markupsafe==1.1.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' -psycopg2-binary==2.8.6 -python-dateutil==2.8.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' -python-dotenv==0.15.0 -python-editor==1.0.4 -pyyaml==5.4.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' -six==1.15.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' -sqlalchemy==1.3.23 -urllib3==1.26.3; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4' -werkzeug==1.0.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' -wtforms==2.3.3 +# --- Core Flask (compatible Py3.13) +Flask==2.3.3 +Werkzeug==2.3.8 +itsdangerous==2.1.2 +Jinja2==3.1.4 +MarkupSafe==2.1.5 +click>=8.1.7 + +# CORS +Flask-Cors==4.0.0 + +# DB stack (SQLAlchemy 2.x + Flask-SQLAlchemy 3.x + Alembic) +SQLAlchemy==2.0.31 +Flask-SQLAlchemy==3.1.1 +alembic==1.13.2 +Flask-Migrate==4.0.7 + +# Postgres +psycopg2-binary==2.9.9 + +# OAuth / Auth +Authlib==1.2.1 +requests==2.32.3 + +# Utils +python-dotenv==1.0.1 +PyYAML==6.0.2 +cloudinary==1.41.0 + +# Server +gunicorn==21.2.0 diff --git a/return b/return new file mode 100644 index 0000000000..4eb01ad6d6 --- /dev/null +++ b/return @@ -0,0 +1,21 @@ + List of relations + Schema | Name | Type | Owner +--------+------------------+-------+-------- + public | account_settings | table | gitpod + public | admin_action | table | gitpod + public | alembic_version | table | gitpod + public | categories | table | gitpod + public | dispute | table | gitpod + public | message | table | gitpod + public | payments | table | gitpod + public | profile | table | gitpod + public | review | table | gitpod + public | rol | table | gitpod + public | task | table | gitpod + public | task_categories | table | gitpod + public | task_dealed | table | gitpod + public | tasks_offered | table | gitpod + public | user | table | gitpod + public | user_rol | table | gitpod +(16 rows) + diff --git a/src/api/models.py b/src/api/models.py index da515f6a1a..3f55360852 100644 --- a/src/api/models.py +++ b/src/api/models.py @@ -1,19 +1,387 @@ from flask_sqlalchemy import SQLAlchemy -from sqlalchemy import String, Boolean -from sqlalchemy.orm import Mapped, mapped_column +from sqlalchemy import String, Boolean, Integer, ForeignKey, Date, Text, Numeric, DateTime, func, UniqueConstraint, Float +from sqlalchemy.orm import relationship, Mapped, mapped_column +from datetime import date, datetime +from decimal import Decimal db = SQLAlchemy() -class User(db.Model): - id: Mapped[int] = mapped_column(primary_key=True) - email: Mapped[str] = mapped_column(String(120), unique=True, nullable=False) - password: Mapped[str] = mapped_column(nullable=False) - is_active: Mapped[bool] = mapped_column(Boolean(), nullable=False) +# Tabla que relaciona user con rol +UserRole = db.Table( + 'user_rol', + db.Model.metadata, + db.Column('user_id', db.Integer, db.ForeignKey( + 'user.id'), primary_key=True), + db.Column('role_id', db.Integer, db.ForeignKey( + 'rol.id'), primary_key=True) +) +class User(db.Model): + __tablename__ = 'user' + id = db.Column(db.Integer, primary_key=True) + email = db.Column(db.String(120), unique=True, nullable=False) + username = db.Column(db.String(80), unique=True, nullable=False) + password = db.Column(db.String(200), nullable=False) + created_at = db.Column(db.DateTime, nullable=False, + server_default=func.current_timestamp()) + modified_at = db.Column(db.DateTime, nullable=False, server_default=func.current_timestamp( + ), server_onupdate=func.current_timestamp()) + roles = db.relationship('Rol', secondary='user_rol',) + messages = db.relationship('Message', back_populates='user') def serialize(self): return { "id": self.id, "email": self.email, - # do not serialize the password, its a security breach - } \ No newline at end of file + "username": self.username, + "created_at": self.created_at, + "modified_at": self.modified_at, + # no serializar "password" para no exponerlo + } + + +class Rol(db.Model): + __tablename__ = 'rol' + id = db.Column(db.Integer, primary_key=True) + type = db.Column(db.String(50), unique=True, nullable=False) + user = db.relationship('User', secondary='user_rol') + + def serialize(self): + return { + "id": self.id, + "type": self.type, + } + + +class Profile(db.Model): + __tablename__ = 'profile' + user_id = db.Column(db.Integer, ForeignKey('user.id'), primary_key=True) + name = db.Column(db.String(100), nullable=False) + last_name = db.Column(db.String(100), nullable=False) + avatar = db.Column(db.String(100), nullable=True) + city = db.Column(db.String(50), nullable=False) + birth_date = db.Column(db.Date, nullable=True) + bio = db.Column(db.String(250), nullable=True) + skills = db.Column(db.String(250), nullable=True) + rating_avg = db.Column(db.Float, nullable=True) + created_at = db.Column(db.DateTime, nullable=False) + modified_at = db.Column(db.DateTime, nullable=False) + + def serialize(self): + return { + "user_id": self.user_id, + "name": self.name, + "last_name": self.last_name, + "avatar": self.avatar, + "city": self.city, + "birth_date": self.birth_date, + "bio": self.bio, + "skills": self.skills, + "rating_avg": self.rating_avg, + "created_at": self.created_at, + "modified_at": self.modified_at, + } + + +class AccountSettings(db.Model): + __tablename__ = 'account_settings' + user_id = db.Column(db.Integer, ForeignKey('user.id'), primary_key=True) + phone = db.Column(db.String(20), nullable=True) + billing_info = db.Column(db.String(250), nullable=True) + language = db.Column(db.String(50), nullable=True) + marketing_emails = db.Column(db.Boolean, nullable=True) + created_at = db.Column(db.DateTime, nullable=False) + modified_at = db.Column(db.DateTime, nullable=False) + + def serialize(self): + return { + "user_id": self.user_id, + "phone": self.phone, + "billing_info": self.billing_info, + "language": self.language, + "marketing_emails": self.marketing_emails, + "created_at": self.created_at, + "modified_at": self.modified_at, + } + + +# Tabla que relaciona task con categories +task_categories = db.Table( + "task_categories", + db.Column("task_id", Integer, db.ForeignKey( + "task.id", ondelete="CASCADE"), primary_key=True), + db.Column("category_id", Integer, db.ForeignKey( + "category.id", ondelete="CASCADE"), primary_key=True), +) + + +class Task(db.Model): + __tablename__ = "task" + + id = db.Column(db.Integer, primary_key=True) + title = db.Column(db.String(120), nullable=True) + description = db.Column(db.Text, nullable=True) + location = db.Column(db.String(120), nullable=True) + price = db.Column(db.Numeric(10, 2), nullable=True) + + # dates + due_at = db.Column(db.DateTime, nullable=True) # timestamp + # DB fills posted_at automatically with current_date() + posted_at = db.Column(db.Date, nullable=False, + server_default=func.current_date()) + assigned_at = db.Column(db.Date, nullable=True) + completed_at = db.Column(db.Date, nullable=True) + + # business-defined value (app.py) + status = db.Column(db.String(30), nullable=False, server_default="pending") + + # FK + relationship (1 User -> many Tasks) + publisher_id = db.Column(db.Integer, ForeignKey( + "user.id"), nullable=False, index=True) + publisher = db.relationship("User", backref="tasks") + + # relationship categories + categories = db.relationship( + "Category", secondary=task_categories, back_populates="tasks") + + def serialize(self): + return { + "id": self.id, + "title": self.title, + } + + def serialize_all_data(self): + return { + "id": self.id, + "title": self.title, + "description": self.description, + "location": self.location, + "price": float(self.price) if self.price is not None else None, + "due_at": self.due_at.isoformat() if self.due_at else None, + "status": self.status, + "posted_at": self.posted_at.isoformat() if self.posted_at else None, + "assigned_at": self.assigned_at.isoformat() if self.assigned_at else None, + "completed_at": self.completed_at.isoformat() if self.completed_at else None, + "publisher_id": self.publisher_id, + "categories": [categories.serialize() for categories in self.categories] if self.categories else [], + } + + +class Category(db.Model): + __tablename__ = "category" + + id = db.Column(db.Integer, primary_key=True) + name = db.Column(db.String(50), nullable=False, unique=True) + + # relationship + tasks = db.relationship( + "Task", secondary=task_categories, back_populates="categories") + # return type + + def serialize(self): + return { + "id": self.id, + "name": self.name, + } + + +class TaskOffered(db.Model): + __tablename__ = "tasks_offered" + + id = db.Column(db.Integer, primary_key=True) + # the values will be defined in the business layer(app.py) + status = db.Column(db.Numeric(10, 2), nullable=True) + # dates + created_at = db.Column( + db.Date, nullable=False, server_default=func.current_date()) + updated_at = db.Column( + db.Date, nullable=False, + server_default=func.current_date(), + server_onupdate=func.current_date() + ) + # FK + task_id = db.Column(db.Integer, ForeignKey( + "task.id"), nullable=False, index=True) + tasker_id = db.Column(db.Integer, ForeignKey( + "user.id"), nullable=False, index=True) + + # one offer per (task, tasker) in pair + __table_args__ = ( + UniqueConstraint("task_id", "tasker_id", + name="uq_tasks_offered_task_tasker"), + ) + + # return type + + def serialize(self): + return { + "id": self.id, + "task_id": self.task_id, + "tasker_id": self.tasker_id, + "status": float(self.status) if self.status is not None else None, + "created_at": self.created_at.isoformat(), + "updated_at": self.updated_at.isoformat(), + } + + +class TaskDealed(db.Model): + __tablename__ = "task_dealed" + + id = db.Column(db.Integer, primary_key=True) + fixed_price = db.Column(db.Numeric(10, 2), nullable=True) + + # the values will be defined in the business layer(app.py) + status = db.Column(db.String(30), nullable=False) + # dates + accepted_at = db.Column(db.Date, nullable=True) + delivered_at = db.Column(db.Date, nullable=True) + cancelled_at = db.Column(db.Date, nullable=True) + # FK + task_id = db.Column( + db.Integer, ForeignKey("task.id"), nullable=False, index=True + ) + offer_id = db.Column(db.Integer, ForeignKey( + "tasks_offered.id"), nullable=False, index=True) + client_id = db.Column(db.Integer, ForeignKey( + "user.id"), nullable=False, index=True) + tasker_id = db.Column(db.Integer, ForeignKey( + "user.id"), nullable=False, index=True) + + def serialize(self): + return { + "id": self.id, + "task_id": self.task_id, + "offer_id": self.offer_id, + "client_id": self.client_id, + "tasker_id": self.tasker_id, + "fixed_price": float(self.fixed_price) if self.fixed_price is not None else None, + "status": self.status, + "accepted_at": self.accepted_at.isoformat() if self.accepted_at else None, + "delivered_at": self.delivered_at.isoformat() if self.delivered_at else None, + "cancelled_at": self.cancelled_at.isoformat() if self.cancelled_at else None + } + + +class Payment(db.Model): + __tablename__ = "payments" + + id = db.Column(db.Integer, primary_key=True) + amount = db.Column(db.Numeric(10, 2), nullable=False) + # the values will be defined in the business layer(app.py) + status = db.Column(db.String(20), nullable=False) + # dates + created_at = db.Column( + db.Date, nullable=False, server_default=func.current_date() + ) + updated_at = db.Column( + db.Date, nullable=False, + server_default=func.current_date(), + server_onupdate=func.current_date() + ) + + # FK + dealed_id = db.Column(db.Integer, ForeignKey( + "task_dealed.id", ondelete="CASCADE"), unique=True, nullable=False, index=True) + + def serialize(self): + return { + "id": self.id, + "dealed_id": self.dealed_id, + "amount": float(self.amount), + "status": self.status, + "created_at": self.created_at.isoformat(), + "updated_at": self.updated_at.isoformat(), + } + + +class Review(db.Model): + id = db.Column(db.Integer, primary_key=True) + review = db.Column(db.String(10000), nullable=True) + rate = db.Column(db.Numeric(3, 2), nullable=False) + created_at = db.Column(db.DateTime(timezone=True)) + publisher_id = db.Column( + db.Integer, ForeignKey('user.id'), nullable=False) + worker_id = db.Column( + db.Integer, ForeignKey('user.id'), nullable=False) + task_dealed_id = db.Column( + db.Integer, ForeignKey('task_dealed.id'), unique=True, nullable=False) + task_id = db.Column(db.Integer, ForeignKey('task.id'), nullable=False) + + def serialize(self): + return { + "id": self.id, + "review": self.review, + "rate": self.rate, + "created_at": self.created_at, + "worker_id": self.worker_id, + "task_id": self.task_id, + } + + +class Message(db.Model): + id = db.Column(db.Integer, primary_key=True) + body = db.Column(db.String(10000), nullable=True) + created_at = db.Column(db.DateTime(timezone=True), + server_default=func.current_timestamp()) + dealer_id = db.Column(db.Integer, ForeignKey( + 'task_dealed.id'), unique=True, nullable=False) + sender_id = db.Column(db.Integer, ForeignKey( + 'user.id'), nullable=False) + user = db.relationship('User', back_populates='messages') + + def serialize(self): + return { + "id": self.id, + "body": self.body, + "created_at": self.created_at, + "dealer_id": self.dealer_id, + "sender_id": self.sender_id, + } + + +class Dispute(db.Model): + id = db.Column(db.Integer, primary_key=True) + reason = db.Column(db.String(120), nullable=False) + details = db.Column(db.String(1000), nullable=False) + status = db.Column(db.String(30), nullable=False) + resolution = db.Column(db.String(1000), nullable=True) + created_at = db.Column(db.DateTime(timezone=True)) + updated_at = db.Column(db.DateTime(timezone=True)) + dealed_id = db.Column(db.Integer, ForeignKey( + 'task_dealed.id'), unique=True, nullable=False) + raised_by = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False) + resolved_by_admin_user = db.Column( + db.Integer, db.ForeignKey('user.id'), nullable=True) + + def serialize(self): + return { + "id": self.id, + "reason": self.reason, + "details": self.details, + "status": self.status, + "resolution": self.resolution, + "created_at": self.created_at, + "updated_at": self.updated_at, + "dealed_id": self.dealed_id, + "raised_by": self.raised_by, + "resolved_by_admin_user": self.resolved_by_admin_user, + } + + +class Admin_action(db.Model): + id = db.Column(db.Integer, primary_key=True) + action = db.Column(db.String(60), nullable=False) + created_at = db.Column(db.DateTime(timezone=True)) + dispute_id = db.Column( + db.Integer, ForeignKey('dispute.id'), nullable=False) + admin_user = db.Column( + db.Integer, ForeignKey('user.id'), unique=True, nullable=False) + + def serialize(self): + return { + "id": self.id, + "action": self.action, + "created_at": self.created_at, + "dispute_id": self.dispute_id, + "admin_user": self.admin_user, + } diff --git a/src/api/routes.py b/src/api/routes.py index 029589a3a1..b86e24082c 100644 --- a/src/api/routes.py +++ b/src/api/routes.py @@ -1,22 +1,182 @@ -""" -This module takes care of starting the API Server, Loading the DB and Adding the endpoints -""" -from flask import Flask, request, jsonify, url_for, Blueprint -from api.models import db, User -from api.utils import generate_sitemap, APIException +# src/api/routes.py +from flask import Blueprint, jsonify, request from flask_cors import CORS +from datetime import datetime -api = Blueprint('api', __name__) +from api.models import db, User, Task, Profile # <-- asegúrate que Profile está en models.py -# Allow CORS requests to this API -CORS(api) +api = Blueprint("api", __name__) +CORS(api, supports_credentials=True) # útil si el front envía cookies/credenciales +# ========================= +# HEALTH +# ========================= +@api.get("/health") +def health(): + return jsonify({"msg": "Hello from Tasky API"}), 200 -@api.route('/hello', methods=['POST', 'GET']) -def handle_hello(): - response_body = { - "message": "Hello! I'm a message that came from the backend, check the network tab on the google inspector and you will see the GET request" - } +# ========================= +# USERS +# ========================= +@api.get("/users") +def get_users(): + users = User.query.all() + return jsonify([u.serialize() for u in users]), 200 - return jsonify(response_body), 200 + +@api.get("/users/") +def get_user(user_id): + u = User.query.get(user_id) + if not u: + return jsonify({"error": "Usuario no encontrado"}), 404 + return jsonify(u.serialize()), 200 + + +@api.post("/users") +def create_user(): + data = request.get_json() or {} + if not data.get("email") or not data.get("password") or not data.get("username"): + return jsonify({"error": "email, password y username son requeridos"}), 400 + + u = User( + email=data["email"], + password=data["password"], # TODO: hashear en prod + username=data["username"] + ) + db.session.add(u) + db.session.commit() + return jsonify(u.serialize()), 201 + + +@api.put("/users/") +def update_user(user_id): + u = User.query.get(user_id) + if not u: + return jsonify({"error": "Usuario no encontrado"}), 404 + + data = request.get_json() or {} + u.email = data.get("email", u.email) + u.username = data.get("username", u.username) + u.password = data.get("password", u.password) # TODO: hashear en prod + db.session.commit() + return jsonify(u.serialize()), 200 + + +@api.delete("/users/") +def delete_user(user_id): + u = User.query.get(user_id) + if not u: + return jsonify({"error": "Usuario no encontrado"}), 404 + db.session.delete(u) + db.session.commit() + return jsonify({"message": "Usuario eliminado"}), 200 + + +@api.get("/users/by-username/") +def get_user_by_username(username): + # .ilike hace búsqueda case-insensitive + u = User.query.filter(User.username.ilike(username)).first() + if not u: + return jsonify({"error": "Usuario no encontrado"}), 404 + return jsonify(u.serialize()), 200 + + +# ========================= +# PROFILES (PUBLIC/PRIVATE) +# ========================= +@api.get("/users//profile") +def get_profile(user_id): + prof = Profile.query.get(user_id) # PK = user_id en este modelo + if not prof: + return jsonify({"error": "Perfil no encontrado"}), 404 + return jsonify(prof.serialize()), 200 + + +@api.put("/users//profile") +def update_profile(user_id): + """ + Crea o actualiza el perfil del usuario. + Si el perfil no existe, lo crea con valores por defecto para + las columnas NOT NULL (name, etc.). + """ + data = request.get_json() or {} + + # por si quieres validar que el usuario existe + user = User.query.get(user_id) + if not user: + return jsonify({"error": "Usuario no encontrado"}), 404 + + prof = Profile.query.get(user_id) # PK = user_id + if not prof: + # ---- crear con DEFAULTS para NOT NULL ---- + prof = Profile( + user_id=user_id, + # name es NOT NULL -> usa body o username o string vacío + name=(data.get("name") or user.username or ""), + # estas pueden ser NOT NULL en tu modelo; si lo son, ponles default + last_name=data.get("last_name") or "", + avatar=data.get("avatar") or "", + city=data.get("city") or "", + birth_date=data.get("birth_date"), # si tu col no es NOT NULL, puede ir None + bio=data.get("bio") or "", + skills=data.get("skills") or "", + rating_avg=data.get("rating_avg") or 0.0, + created_at=datetime.utcnow(), + modified_at=datetime.utcnow(), + ) + db.session.add(prof) + else: + # ---- actualizar sólo los campos recibidos ---- + for field in ["name", "last_name", "avatar", "city", "birth_date", "bio", "skills", "rating_avg"]: + if field in data and data[field] is not None: + setattr(prof, field, data[field]) + prof.modified_at = datetime.utcnow() + + db.session.commit() + return jsonify(prof.serialize()), 200 + +# ========================= +# TASKS (mínimo viable) +# ========================= +@api.get("/tasks") +def list_tasks(): + tasks = Task.query.all() + return jsonify([t.serialize() for t in tasks]), 200 + + +@api.post("/tasks") +def create_task(): + data = request.get_json() or {} + if not data.get("title") or not data.get("description") or not data.get("publisher_id"): + return jsonify({"error": "title, description, publisher_id son requeridos"}), 400 + + t = Task( + title=data["title"], + description=data["description"], + publisher_id=data["publisher_id"], + location=data.get("location"), + price=data.get("price"), + status=data.get("status", "pending"), + ) + db.session.add(t) + db.session.commit() + return jsonify(t.serialize()), 201 + + +@api.get("/tasks/") +def get_task(task_id): + t = Task.query.get(task_id) + if not t: + return jsonify({"error": "Tarea no encontrada"}), 404 + return jsonify(t.serialize()), 200 + + +@api.delete("/tasks/") +def delete_task(task_id): + t = Task.query.get(task_id) + if not t: + return jsonify({"error": "Tarea no encontrada"}), 404 + db.session.delete(t) + db.session.commit() + return jsonify({"message": "Tarea eliminada"}), 200 diff --git a/src/app.py b/src/app.py index 1b3340c0fa..60370058c6 100644 --- a/src/app.py +++ b/src/app.py @@ -1,72 +1,33 @@ -""" -This module takes care of starting the API Server, Loading the DB and Adding the endpoints -""" -import os -from flask import Flask, request, jsonify, url_for, send_from_directory -from flask_migrate import Migrate -from flask_swagger import swagger -from api.utils import APIException, generate_sitemap +from flask import Flask +from flask_cors import CORS from api.models import db from api.routes import api -from api.admin import setup_admin -from api.commands import setup_commands - -# from models import Person - -ENV = "development" if os.getenv("FLASK_DEBUG") == "1" else "production" -static_file_dir = os.path.join(os.path.dirname( - os.path.realpath(__file__)), '../dist/') -app = Flask(__name__) -app.url_map.strict_slashes = False - -# database condiguration -db_url = os.getenv("DATABASE_URL") -if db_url is not None: - app.config['SQLALCHEMY_DATABASE_URI'] = db_url.replace( - "postgres://", "postgresql://") -else: - app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:////tmp/test.db" - -app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False -MIGRATE = Migrate(app, db, compare_type=True) -db.init_app(app) - -# add the admin -setup_admin(app) - -# add the admin -setup_commands(app) - -# Add all endpoints form the API with a "api" prefix -app.register_blueprint(api, url_prefix='/api') - -# Handle/serialize errors like a JSON object +import os +def create_app(): + app = Flask(__name__) -@app.errorhandler(APIException) -def handle_invalid_usage(error): - return jsonify(error.to_dict()), error.status_code + # Config DB + db_uri = ( + os.getenv("SQLALCHEMY_DATABASE_URI") + or os.getenv("DATABASE_URL") + or "sqlite:////workspaces/final-project-Tasky/tasky.db" + ) + app.config["SQLALCHEMY_DATABASE_URI"] = db_uri + app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False -# generate sitemap with all your endpoints + db.init_app(app) + # 🔧 CORS habilitado para todas las rutas del API + CORS(app, resources={r"/api/*": {"origins": "*"}}) -@app.route('/') -def sitemap(): - if ENV == "development": - return generate_sitemap(app) - return send_from_directory(static_file_dir, 'index.html') + # Blueprint + app.register_blueprint(api, url_prefix="/api") -# any other endpoint will try to serve it like a static file -@app.route('/', methods=['GET']) -def serve_any_other_file(path): - if not os.path.isfile(os.path.join(static_file_dir, path)): - path = 'index.html' - response = send_from_directory(static_file_dir, path) - response.cache_control.max_age = 0 # avoid cache memory - return response + @app.route("/") + def root(): + return "Tasky API OK. Revisa /api/*" + return app -# this only runs if `$ python src/main.py` is executed -if __name__ == '__main__': - PORT = int(os.environ.get('PORT', 3001)) - app.run(host='0.0.0.0', port=PORT, debug=True) +app = create_app() \ No newline at end of file diff --git a/src/front/api/auth.js b/src/front/api/auth.js new file mode 100644 index 0000000000..28318c667f --- /dev/null +++ b/src/front/api/auth.js @@ -0,0 +1,67 @@ +import { getBackendURL } from "../components/BackendURL"; + +const USE_MOCK = true; +const BASE = getBackendURL?.() || import.meta.env.VITE_BACKEND_URL || ""; + +export async function apiRegister({ name, email, password, role }) { + if (USE_MOCK) return { id: 1, name, email, role: role || "client", token: "mock" }; + const res = await fetch(`${BASE}/api/register`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ name, email, password, role }), + }); + if (!res.ok) throw new Error(await res.text()); + return res.json(); +} + +export async function apiLogin({ email, password }) { + if (USE_MOCK) return { id: 1, name: "Demo", email, role: "client", token: "mock" }; + const res = await fetch(`${BASE}/api/login`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ email, password }), + }); + if (!res.ok) throw new Error(await res.text()); + return res.json(); +} + + +export async function apiGoogleLogin(idToken) { + if (USE_MOCK) { + return { + id: 101, + name: "Demo Google", + email: "demo.google@example.com", + role: "client", + token: "mock-google", + provider: "google" + }; + } + const res = await fetch(`${BASE}/api/login/google`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ id_token: idToken }), + }); + if (!res.ok) throw new Error(await res.text()); + return res.json(); +} + +export async function apiFacebookLogin(accessToken) { + if (USE_MOCK) { + return { + id: 102, + name: "Demo Facebook", + email: "demo.facebook@example.com", + role: "client", + token: "mock-facebook", + provider: "facebook" + }; + } + const res = await fetch(`${BASE}/api/login/facebook`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ access_token: accessToken }), + }); + if (!res.ok) throw new Error(await res.text()); + return res.json(); +} \ No newline at end of file diff --git a/src/front/api/categories.js b/src/front/api/categories.js new file mode 100644 index 0000000000..caffc9ad4e --- /dev/null +++ b/src/front/api/categories.js @@ -0,0 +1,37 @@ +const BASE = import.meta.env.VITE_BACKEND_URL?.replace(/\/$/, ""); + +export async function listCategories() { + const r = await fetch(`${BASE}/api/categories`); + if(!r.ok) throw new Error(await r.text()); + return r.json(); +} + +export async function createCategory(name) { + const r = await fetch(`${BASE}/api/categories`, { + method: "POST", + headers: { "Content-Type":"application/json" }, + body: JSON.stringify({ name }) + }); + if(!r.ok) throw new Error(await r.text()); + return r.json(); +} + +export async function attachCategoryToTask(taskId, category_id) { + const r = await fetch(`${BASE}/api/tasks/${taskId}/categories`, { + method: "POST", + headers: { "Content-Type":"application/json" }, + body: JSON.stringify({ category_id }) + }); + if(!r.ok) throw new Error(await r.text()); + return r.json(); +} + +export async function detachCategoryFromTask(taskId, category_id) { + const r = await fetch(`${BASE}/api/tasks/${taskId}/categories`, { + method: "DELETE", + headers: { "Content-Type":"application/json" }, + body: JSON.stringify({ category_id }) + }); + if(!r.ok) throw new Error(await r.text()); + return r.json(); +} \ No newline at end of file diff --git a/src/front/api/client.js b/src/front/api/client.js new file mode 100644 index 0000000000..6b9daaa464 --- /dev/null +++ b/src/front/api/client.js @@ -0,0 +1,37 @@ +const BASE = import.meta.env.VITE_BACKEND_URL; + +function getToken() { + try { + return JSON.parse(localStorage.getItem("tasky_user"))?.token || null; + } catch { + return null; + } +} + +export async function api(path, { method = "GET", body, headers } = {}) { + if (!BASE) { + throw new Error("VITE_BACKEND_URL no está configurada."); + } + + const res = await fetch(`${BASE}${path}`, { + method, + headers: { + "Content-Type": "application/json", + ...(getToken() ? { Authorization: `Bearer ${getToken()}` } : {}), + ...headers, + }, + body: body ? JSON.stringify(body) : undefined, + }); + + const text = await res.text(); + const data = text ? JSON.parse(text) : null; + + if (!res.ok) { + const msg = data?.message || `${res.status} ${res.statusText}`; + const err = new Error(msg); + err.status = res.status; + err.data = data; + throw err; + } + return data; +} \ No newline at end of file diff --git a/src/front/api/profile.js b/src/front/api/profile.js new file mode 100644 index 0000000000..c5470d980f --- /dev/null +++ b/src/front/api/profile.js @@ -0,0 +1,27 @@ +const BASE = import.meta.env.VITE_BACKEND_URL?.replace(/\/$/, ""); + +export async function getProfile(userId) { + const r = await fetch(`${BASE}/api/users/${userId}/profile`); + if (!r.ok) throw new Error(await r.text()); + return r.json(); +} + +export async function createProfile(userId, data = {}) { + const r = await fetch(`${BASE}/api/users/${userId}/profile`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(data), + }); + if (!r.ok) throw new Error(await r.text()); + return r.json(); +} + +export async function updateProfile(userId, data) { + const r = await fetch(`${BASE}/api/users/${userId}/profile`, { + method: "PUT", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(data), + }); + if (!r.ok) throw new Error(await r.text()); + return r.json(); +} \ No newline at end of file diff --git a/src/front/api/tasks.js b/src/front/api/tasks.js new file mode 100644 index 0000000000..3642734126 --- /dev/null +++ b/src/front/api/tasks.js @@ -0,0 +1,40 @@ +// src/front/api/tasks.js +const BASE = (import.meta.env.VITE_BACKEND_URL || "").replace(/\/$/, ""); + +// GET /api/tasks +export async function listTasks() { + const res = await fetch(`${BASE}/api/tasks`); + if (!res.ok) throw new Error(await res.text()); + return res.json(); +} + +// GET /api/tasks/:id +export async function getTask(id) { + const res = await fetch(`${BASE}/api/tasks/${id}`); + if (!res.ok) throw new Error(await res.text()); + return res.json(); +} + +// GET /api/users/:user_id/tasks +export async function getTasksByUser(userId, { status, from_date, to_date } = {}) { + const qs = new URLSearchParams(); + if (status) qs.set("status", status); + if (from_date) qs.set("from_date", from_date); + if (to_date) qs.set("to_date", to_date); + + const url = `${BASE}/api/users/${userId}/tasks${qs.toString() ? `?${qs}` : ""}`; + const res = await fetch(url); + if (!res.ok) throw new Error(await res.text()); + return res.json(); +} + +// POST /api/tasks +export async function createTask(payload) { + const res = await fetch(`${BASE}/api/tasks`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(payload), + }); + if (!res.ok) throw new Error(await res.text()); + return res.json(); +} \ No newline at end of file diff --git a/src/front/api/users.js b/src/front/api/users.js new file mode 100644 index 0000000000..ecda4af34c --- /dev/null +++ b/src/front/api/users.js @@ -0,0 +1,63 @@ +// src/front/api/users.js +const BASE = (import.meta.env.VITE_BACKEND_URL || "").replace(/\/$/, ""); + +// Helper genérico para fetch + manejo de errores +async function fetchJSON(input, init) { + const r = await fetch(input, { credentials: "include", ...init }); + let payload = null; + try { payload = await r.json(); } catch { /* puede ser texto/void */ } + if (!r.ok) { + const msg = + (payload && (payload.error || payload.message)) || + r.statusText || + "Request failed"; + throw new Error(msg); + } + return payload ?? {}; +} + +// ---------- USERS ---------- +export function listUsers() { + return fetchJSON(`${BASE}/api/users`); +} + +export function getUser(id) { + return fetchJSON(`${BASE}/api/users/${id}`); +} + +export function getUserByUsername(username) { + return fetchJSON(`${BASE}/api/users/by-username/${encodeURIComponent(username)}`); +} + +export function createUser({ email, password, username }) { + return fetchJSON(`${BASE}/api/users`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ email, password, username }), + }); +} + +export function updateUser(id, data) { + return fetchJSON(`${BASE}/api/users/${id}`, { + method: "PUT", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(data), + }); +} + +export function deleteUser(id) { + return fetchJSON(`${BASE}/api/users/${id}`, { method: "DELETE" }); +} + +// ---------- PROFILE ---------- +export function getUserProfile(userId) { + return fetchJSON(`${BASE}/api/users/${userId}/profile`); +} + +export function updateProfile(userId, data) { + return fetchJSON(`${BASE}/api/users/${userId}/profile`, { + method: "PUT", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(data), + }); +} \ No newline at end of file diff --git a/src/front/components/AdminCard.jsx b/src/front/components/AdminCard.jsx new file mode 100644 index 0000000000..6184b8ddfe --- /dev/null +++ b/src/front/components/AdminCard.jsx @@ -0,0 +1,20 @@ +export const AdminCard = () => ( +
+
+
+ ... +
+
+
+
Nombre Apellido
+

Administrador principal

+

lol@email.com

+

Miembro desde xd

+
+
+

Ultima conexión
3 mins ago

+
+
+
+
+); \ No newline at end of file diff --git a/src/front/components/AuthCard.jsx b/src/front/components/AuthCard.jsx new file mode 100644 index 0000000000..18c260a94d --- /dev/null +++ b/src/front/components/AuthCard.jsx @@ -0,0 +1,12 @@ +// src/front/components/AuthCard.jsx +export default function AuthCard({ title = "Welcome", children }) { + return ( +
+
+

{title}

+

Create your account to start posting and doing tasks

+ {children} +
+
+ ); +} \ No newline at end of file diff --git a/src/front/components/BackendURL.jsx b/src/front/components/BackendURL.jsx index ae80b8e43a..90631eb3cb 100644 --- a/src/front/components/BackendURL.jsx +++ b/src/front/components/BackendURL.jsx @@ -1,23 +1,14 @@ -import React, { Component } from "react"; -import envFile from "../../../docs/assets/env-file.png" +// src/front/components/BackendURL.jsx +export function getBackendURL() { + const url = import.meta.env.VITE_BACKEND_URL || "" + // quita slash al final (opcional) + return url.replace(/\/$/, "") +} -const Dark = ({children}) => {children}; -export const BackendURL = () => ( -
-

Missing BACKEND_URL env variable

-

Here's a video tutorial on how to update your backend URL environment variable.

-

There's a file called .env that contains the environmental variables for your project.

-

There's one variable called BACKEND_URL that needs to be manually set by yourself.

-
    -
  1. Make sure you backend is running on port 3001.
  2. -
  3. Open your API and copy the API host.
  4. -
  5. Open the .env file (do not open the .env.example)
  6. -
  7. Add a new variable VITE_BACKEND_URL=your api host
  8. -
  9. Replace your api host with the public API URL of your flask backend sever running at port 3001
  10. -
-
- -
-

Note: If you are publishing your website to Heroku, Render.com or any other hosting you probably need to follow other steps.

-
-); \ No newline at end of file +export function BackendURL() { + // ... tu UI que ayuda a setear VITE_BACKEND_URL + return
Configura VITE_BACKEND_URL…
+} + +// 👇 con esto, podrás hacer import default getBackendURL ... +export default getBackendURL diff --git a/src/front/components/Footer.jsx b/src/front/components/Footer.jsx index f06302dbd2..2883cb84a5 100644 --- a/src/front/components/Footer.jsx +++ b/src/front/components/Footer.jsx @@ -1,11 +1,15 @@ -export const Footer = () => ( - -); +export default function Footer() { + return ( +
+

Made with ❤️ by Tasky Team

+
+ ); +} \ No newline at end of file diff --git a/src/front/components/FormField.jsx b/src/front/components/FormField.jsx new file mode 100644 index 0000000000..4924effe63 --- /dev/null +++ b/src/front/components/FormField.jsx @@ -0,0 +1,9 @@ +export default function FormField({label,children,error}){ + return ( +
+ + {children} + {error &&
{error}
} +
+ ); +} \ No newline at end of file diff --git a/src/front/components/Navbar.jsx b/src/front/components/Navbar.jsx index 30d43a2636..8613f7b3ed 100644 --- a/src/front/components/Navbar.jsx +++ b/src/front/components/Navbar.jsx @@ -1,19 +1,185 @@ -import { Link } from "react-router-dom"; - -export const Navbar = () => { - - return ( - - ); +// src/front/components/Navbar.jsx +import { useEffect, useRef, useState } from "react"; +import { Link, useNavigate } from "react-router-dom"; +import { useStore } from "../hooks/useGlobalReducer"; + +export function Navbar() { + const { store, actions } = useStore(); + const user = store.user; + const nav = useNavigate(); + + const [open, setOpen] = useState(false); + const ref = useRef(null); + + useEffect(() => { + function onDoc(e) { + if (ref.current && !ref.current.contains(e.target)) setOpen(false); + } + document.addEventListener("mousedown", onDoc); + return () => document.removeEventListener("mousedown", onDoc); + }, []); + + function onLogout() { + actions.logout?.(); + setOpen(false); + nav("/", { replace: true }); + } + + const username = + user?.username || + (user?.name ? user.name.toLowerCase().replace(/\s+/g, "") : "me"); + + return ( + + ); +} + +/* ---------- UI helpers ---------- */ +function Avatar({ name = "U" }) { + const initials = name + .split(" ") + .map((s) => s[0]) + .join("") + .slice(0, 2) + .toUpperCase(); + return ( +
+ {initials} +
+ ); +} + +/* ---------- estilos mínimos ---------- */ +const navStyle = { + position: "sticky", + top: 0, + zIndex: 50, + background: "#fff", + borderBottom: "1px solid #e2e8f0", +}; + +const navInner = { + display: "flex", + alignItems: "center", + justifyContent: "space-between", + gap: 16, + padding: "10px 16px", + maxWidth: 1200, + margin: "0 auto", +}; + +const brand = { fontWeight: 800, fontSize: 20, color: "#0f172a", textDecoration: "none" }; + +const links = { + display: "flex", + alignItems: "center", + gap: 14, +}; + +const avatarBtn = { + border: 0, + background: "transparent", + cursor: "pointer", + padding: 2, + borderRadius: 999, +}; + +const menu = { + position: "absolute", + right: 0, + top: "110%", + minWidth: 220, + background: "#fff", + border: "1px solid #e2e8f0", + borderRadius: 12, + boxShadow: "0 12px 24px rgba(15,23,42,.12)", + padding: 8, + display: "grid", }; \ No newline at end of file diff --git a/src/front/components/ProfileSidebar.jsx b/src/front/components/ProfileSidebar.jsx new file mode 100644 index 0000000000..53d9b89565 --- /dev/null +++ b/src/front/components/ProfileSidebar.jsx @@ -0,0 +1,34 @@ +import { Link, useLocation } from "react-router-dom"; + +export default function ProfileSidebar() { + const { pathname } = useLocation(); + const Item = ({ to, children }) => ( + + {children} + + ); + + return ( + + ); +} \ No newline at end of file diff --git a/src/front/components/RatingStars.jsx b/src/front/components/RatingStars.jsx new file mode 100644 index 0000000000..25b50ea8b4 --- /dev/null +++ b/src/front/components/RatingStars.jsx @@ -0,0 +1,11 @@ +export default function RatingStars({ value = 0 }) { + const v = Math.max(0, Math.min(5, Math.round(value))); + return ( +
+ {Array.from({ length: 5 }, (_, i) => ( + + ))} + {value?.toFixed?.(1) ?? "0.0"} +
+ ); +} \ No newline at end of file diff --git a/src/front/components/SocialButton.jsx b/src/front/components/SocialButton.jsx new file mode 100644 index 0000000000..5d9addf511 --- /dev/null +++ b/src/front/components/SocialButton.jsx @@ -0,0 +1,8 @@ +export default function SocialButton({ icon, label, onClick }) { + return ( + + ); +} \ No newline at end of file diff --git a/src/front/hooks/useGlobalReducer.jsx b/src/front/hooks/useGlobalReducer.jsx index 6aeb9d768e..31841397c2 100644 --- a/src/front/hooks/useGlobalReducer.jsx +++ b/src/front/hooks/useGlobalReducer.jsx @@ -1,24 +1,25 @@ -// Import necessary hooks and functions from React. +// src/front/hooks/useGlobalReducer.jsx import { useContext, useReducer, createContext } from "react"; -import storeReducer, { initialStore } from "../store" // Import the reducer and the initial state. +import storeReducer, { initialStore } from "../store"; -// Create a context to hold the global state of the application -// We will call this global state the "store" to avoid confusion while using local states -const StoreContext = createContext() +const StoreContext = createContext(null); -// Define a provider component that encapsulates the store and warps it in a context provider to -// broadcast the information throught all the app pages and components. export function StoreProvider({ children }) { - // Initialize reducer with the initial state. - const [store, dispatch] = useReducer(storeReducer, initialStore()) - // Provide the store and dispatch method to all child components. - return - {children} + const [store, dispatch] = useReducer(storeReducer, initialStore()); + + const actions = { + login: (user) => dispatch({ type: "LOGIN", payload: user }), + logout: () => dispatch({ type: "LOGOUT" }), + updateRole: (role) => dispatch({ type: "UPDATE_ROLE", payload: role }), + }; + + return ( + + {children} + ); } -// Custom hook to access the global state and dispatch function. -export default function useGlobalReducer() { - const { dispatch, store } = useContext(StoreContext) - return { dispatch, store }; +export function useStore() { + return useContext(StoreContext); } \ No newline at end of file diff --git a/src/front/index.css b/src/front/index.css index e69de29bb2..2f0ddd75ce 100644 --- a/src/front/index.css +++ b/src/front/index.css @@ -0,0 +1,290 @@ +@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap'); + +* { box-sizing: border-box; } +html, body { height: 100%; } +body { + margin: 0; + font-family: 'Poppins', sans-serif; + background: #f9fafc; + color: #0f172a; +} + +/* --------------------------------------------------- + 1) VARIABLES +--------------------------------------------------- */ +:root{ + --primary: #2563eb; + --primary-dark: #1d4ed8; + --ink: #0f172a; + --muted: #64748b; + --border: #e2e8f0; + --bg: #f8fafc; + --chip-bg: #eef2ff; + --chip-ink: #1e40af; + --danger: #ef4444; +} + +/* --------------------------------------------------- + 2) UTILIDADES BÁSICAS +--------------------------------------------------- */ +.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; } +.muted { color: var(--muted); } +.soft { background: #eef4ff; } +.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } + +/* --------------------------------------------------- + 3) COMPONENTES GENERALES +--------------------------------------------------- */ +.card { + background: #fff; + border: 1px solid var(--border); + border-radius: 14px; + padding: 16px; + box-shadow: 0 4px 12px rgba(0,0,0,.04); +} +.chip { + padding: 6px 10px; + border-radius: 999px; + background: var(--chip-bg); + color: var(--chip-ink); + border: 1px solid #cbd5e1; + font-weight: 600; +} +.chip-on { background: var(--primary); color: #fff; border-color: var(--primary); } + +button, .btn { + background: var(--primary); + color: #fff; + border: 0; + border-radius: 12px; + padding: 12px 16px; + font-weight: 700; + cursor: pointer; +} +button:hover, .btn:hover { background: var(--primary-dark); } + +.btn-outline { + background: #fff; + color: var(--ink); + border: 1px solid #d1d5db; + border-radius: 10px; + padding: 10px 14px; + font-weight: 600; +} +.btn-danger { + background: var(--danger); + color: #fff; + border: none; + border-radius: 10px; + padding: 10px 14px; + font-weight: 600; +} + +input, textarea { + width: 100%; + padding: 12px 12px; + border: 1px solid var(--border); + border-radius: 12px; + background: #fff; + outline: none; +} +input:focus, textarea:focus { + border-color: var(--primary); + box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); +} + +/* --------------------------------------------------- + 4) NAVBAR + NAVLINK ACTIVO +--------------------------------------------------- */ +.navbar { + display: flex; justify-content: space-between; align-items: center; + padding: 1rem 2rem; background: #fff; border-bottom: 1px solid #eee; +} +.nav-left, .nav-right { display: flex; align-items: center; gap: 1.5rem; } +.logo { font-size: 1.4rem; font-weight: 700; color: var(--primary); text-decoration: none; } + +/* enlaces del navbar (NavLink) */ +.navlink { + text-decoration: none; + font-weight: 600; + padding: .5rem 1rem; + border-radius: 8px; + color: #94a3b8; /* gris azulado por defecto */ + background: transparent; + transition: all .2s ease; +} +.navlink:hover { color: var(--primary); } +.navlink.active { + color: #fff; + background: var(--primary); + box-shadow: 0 6px 16px rgba(37, 99, 235, .25); +} + +/* Botón CTA del navbar (si lo usas como ) */ +.btn-primary { + background: var(--primary); + color: #fff; + padding: .5rem 1rem; + border-radius: 8px; + font-weight: 600; + text-decoration: none; +} +.btn-primary:hover { background: var(--primary-dark); } + +/* Login/Signup del navbar (si los usas) */ +.btn-login { color: var(--primary); font-weight: 600; text-decoration: none; } +.btn-signup { + background: var(--primary); + color: #fff; + padding: .4rem 1rem; + border-radius: 6px; + font-weight: 600; + text-decoration: none; +} +.user-link { font-weight: 600; color: #333; text-decoration: none; } + +/* --------------------------------------------------- + 5) HOME (tarjeta de diagnóstico actual) +--------------------------------------------------- */ +.home-card { max-width: 720px; margin: 24px auto; } + +/* --------------------------------------------------- + 6) AUTH (login / register) +--------------------------------------------------- */ +.auth-wrap{ + min-height: calc(100vh - 120px); + display:flex; align-items:flex-start; justify-content:center; + background: var(--bg); padding: 40px 16px; +} +.auth-card{ + width: 100%; max-width: 520px; background:#fff; + border-radius: 14px; padding: 28px; box-shadow: 0 8px 30px rgba(15,23,42,.06); +} +.auth-title{ font-size: 28px; margin: 0 0 8px; color: var(--ink); } +.auth-subtitle{ color: var(--muted); margin: 0 0 16px; } + +.auth-form{ display:flex; flex-direction:column; gap: 10px; } +.auth-label{ font-weight:600; color:var(--ink); margin-top:6px; } +.auth-input{ + width:100%; padding:14px 14px; border:1px solid var(--border); + border-radius: 12px; font-size:16px; outline:none; background:#f6f7fb; +} +.auth-input:focus{ border-color: var(--primary); background:#fff; } +.has-error{ border-color:#b91c1c; } +.auth-error{ color:#b91c1c; font-size: 13px; } + +.captcha-mock{ + margin-top: 4px; display:flex; align-items:center; gap:10px; + border:1px solid var(--border); border-radius:12px; padding:12px; + background:#fff; +} +.captcha-mock .checkbox{ + width:22px; height:22px; border:2px solid var(--border); border-radius:4px; + background:#fff; +} + +.auth-btn-primary{ + width:100%; margin-top:10px; padding:14px 16px; border:0; cursor:pointer; + border-radius: 24px; font-weight:700; color:#fff; background: var(--primary); +} +.auth-btn-primary:hover{ background: var(--primary-dark); } +.auth-muted{ color: var(--muted); margin: 8px 0 0; } + +.auth-or{ + text-align:center; color:var(--muted); font-size:12px; margin: 14px 0; + position:relative; +} +.auth-or::before, .auth-or::after{ + content:""; height:1px; background: var(--border); position:absolute; top:50%; + width:38%; +} +.auth-or::before{ left:0; } .auth-or::after{ right:0; } + +.social-btn{ + width:100%; display:flex; align-items:center; gap:12px; justify-content:center; + padding:12px 14px; border-radius:999px; border:1px solid var(--border); + background:#fff; font-weight:600; color: var(--ink); +} +.social-btn:hover{ background:#f9fafc; } +.social-icon{ font-size:18px; } + +/* --------------------------------------------------- + 7) ACCOUNT (perfil privado) +--------------------------------------------------- */ +.acc-wrap{ background:#f8fafc; padding:20px; } +.acc-container{ + max-width:1100px; margin:0 auto; + display:grid; grid-template-columns:260px 1fr; gap:20px; +} +.acc-sidebar{ background:#fff; border:1px solid var(--border); border-radius:14px; padding:16px; } +.acc-avatar{ width:120px; height:120px; border-radius:999px; background:#e2e8f0; margin:8px auto; } +.acc-name{ text-align:center; font-weight:700; color:var(--ink); margin:6px 0 10px; } +.acc-nav{ display:flex; flex-direction:column; gap:6px; } +.acc-main{ min-height:480px; } +.acc-header{ + background:#fff; border:1px solid var(--border); border-radius:14px; padding:16px; + display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; +} +.acc-grid{ display:grid; grid-template-columns:1fr 1fr; gap:16px; } +.acc-field{ display:flex; flex-direction:column; gap:6px; } +.acc-2c{ grid-column:1 / span 2; } +.chip-list{ display:flex; gap:8px; flex-wrap:wrap; } +.check{ display:block; color:#334155; margin-top:6px; } +.acc-actions{ margin-top:16px; display:flex; gap:10px; } + +/* --------------------------------------------------- + 8) PUBLIC PROFILE +--------------------------------------------------- */ +.pub-wrap{ background:#f8fafc; padding:20px; } +.pub-container{ + max-width:1100px; margin:0 auto; + display:grid; grid-template-columns:360px 1fr; gap:20px; +} +.pub-left .pub-avatar{ + width:140px; height:140px; border-radius:999px; background:#e2e8f0; margin:6px 0 10px; +} +.pub-name{ font-size:28px; margin:6px 0; color:var(--ink); } +.pub-row{ display:flex; align-items:center; gap:8px; } +.dot{ width:10px; height:10px; border-radius:999px; background:#cbd5e1; } +.dot.on{ background:#16a34a; } + +.pub-card{ background:#fff; border:1px solid #eee; border-radius:14px; padding:1.5rem; } +.pub-header{ display:flex; gap:1rem; align-items:center; margin-bottom:1rem; } +.pub-avatar{ width:84px; height:84px; border-radius:999px; background:#e8eefc; } +.pub-id h1{ margin:.1rem 0; } +.tagline{ font-weight:600; } +.bio{ margin:.5rem 0 1rem; } +.skills{ display:flex; flex-wrap:wrap; gap:.5rem; } +.pub-actions{ display:flex; gap:.75rem; margin-top:.5rem; } + +/* --------------------------------------------------- + 9) USER MENU (dropdown avatar) +--------------------------------------------------- */ +.user-menu { position: relative; } +.user-trigger { + display: flex; align-items: center; gap:.5rem; + background:#fff; border:1px solid #e5e7eb; border-radius:999px; + padding:.25rem .6rem; cursor:pointer; font-weight:600; +} +.user-trigger:hover { background:#f9fafb; } +.user-name { max-width:120px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } +.avatar { width:28px;height:28px;border-radius:999px;background:#e8eefc; display:block; } +.chev { transition: transform .15s ease; opacity:.8; } +.chev.rot { transform: rotate(180deg); } + +.menu-popper { + position:absolute; right:0; top:calc(100% + .5rem); + width:300px; background:#fff; border:1px solid #e5e7eb; border-radius:12px; + box-shadow:0 10px 30px rgba(0,0,0,.08); padding:.5rem; z-index:50; +} +.menu-head { padding:.5rem .75rem .25rem; } +.menu-title { font-weight:700; line-height:1.2; } +.menu-sub { font-size:.85rem; color:#6b7280; margin-top:.1rem; } + +.menu-item { + display:block; width:100%; text-align:left; text-decoration:none; + padding:.6rem .75rem; border-radius:8px; color:#111827; background:transparent; border:none; font-weight:600; +} +.menu-item:hover { background:#f3f4f6; } +.menu-item.danger { color:#b91c1c; } +.menu-divider { height:1px; background:#e5e7eb; margin:.35rem 0; } \ No newline at end of file diff --git a/src/front/main.jsx b/src/front/main.jsx index a5a3c781dc..8d27ec7c98 100644 --- a/src/front/main.jsx +++ b/src/front/main.jsx @@ -1,29 +1,31 @@ -import React from 'react' -import ReactDOM from 'react-dom/client' -import './index.css' // Global styles for your application -import { RouterProvider } from "react-router-dom"; // Import RouterProvider to use the router -import { router } from "./routes"; // Import the router configuration -import { StoreProvider } from './hooks/useGlobalReducer'; // Import the StoreProvider for global state management -import { BackendURL } from './components/BackendURL'; +import React from "react" +import ReactDOM from "react-dom/client" +import "./index.css" +import { RouterProvider } from "react-router-dom" +import { router } from "./routes.jsx" +import { StoreProvider } from "./hooks/useGlobalReducer" +import { BackendURL } from "./components/BackendURL" +import { GoogleOAuthProvider } from "@react-oauth/google" const Main = () => { - - if(! import.meta.env.VITE_BACKEND_URL || import.meta.env.VITE_BACKEND_URL == "") return ( - - - - ); - return ( - - {/* Provide global state to all components */} - - {/* Set up routing for the application */} - - - - - ); -} + if (!import.meta.env.VITE_BACKEND_URL || import.meta.env.VITE_BACKEND_URL == "") + return ( + + + + ) -// Render the Main component into the root DOM element. -ReactDOM.createRoot(document.getElementById('root')).render(
) + const googleClientId = import.meta.env.VITE_GOOGLE_CLIENT_ID || "" + + return ( + + + + + + + + ) + } + + ReactDOM.createRoot(document.getElementById("root")).render(
) diff --git a/src/front/mock/users.js b/src/front/mock/users.js new file mode 100644 index 0000000000..6428200c17 --- /dev/null +++ b/src/front/mock/users.js @@ -0,0 +1,18 @@ +// src/front/mock/users.js +const demo = { + id: 1, + username: "demo", + first_name: "Demo", + last_name: "", + tagline: "Mini bio (mock)", + location: "CDMX, MX", + email: "prueba1@gmail.com", + description: "Descripción demo", + avatar_url: "", + roles: ["client", "tasker"], +}; + +export async function getUserByUsername(username) { + await new Promise(r => setTimeout(r, 300)); // latencia mock + return { ...demo, username }; +} \ No newline at end of file diff --git a/src/front/pages/Admin.jsx b/src/front/pages/Admin.jsx new file mode 100644 index 0000000000..706bcb212b --- /dev/null +++ b/src/front/pages/Admin.jsx @@ -0,0 +1,84 @@ +// src/front/pages/Admin.jsx +import { Link } from "react-router-dom"; +import { useStore } from "../hooks/useGlobalReducer"; +import { AdminCard } from "../components/AdminCard"; + +export const Admin = () => { + const { store /*, actions*/ } = useStore(); + + const filterList = ["Todo", "Pendientes", "Abiertas", "Cerradas"]; + const tableHeader = [ + "ID", + "Título", + "Usuario", + "Estado", + "Prioridad", + "Categoría", + "Fecha creación", + "Acciones", + ]; + const apiVars = ["id", "title", "user", "status", "priority", "category", "created_at"]; + + return ( +
+

Panel de Administrador

+ + + +
+
Gestión de disputas
+

Administra y resuelve las disputas de los usuarios

+ +
+ {filterList.map((filtro, i) => ( + + ))} +
+ + + + + {tableHeader.map((h, i) => ( + + ))} + + + + + {/* Fila de ejemplo: reemplazar por data real cuando conectes la API */} + + {apiVars.map((key, i) => ( + + ))} + + + +
+ {h} +
{key} +
+ + +
+
+
+ +
+ + + +
+ ); +}; + +export default Admin; diff --git a/src/front/pages/AuthCallback.jsx b/src/front/pages/AuthCallback.jsx new file mode 100644 index 0000000000..49f5739051 --- /dev/null +++ b/src/front/pages/AuthCallback.jsx @@ -0,0 +1,33 @@ +import { useEffect } from "react"; +import { useNavigate } from "react-router-dom"; + +const BASE = import.meta.env.VITE_BACKEND_URL; + +export default function AuthCallback(){ + const nav = useNavigate(); + + useEffect(() => { + const url = new URL(window.location.href); + const token = url.searchParams.get("token"); + if(!token){ + nav("/login?error=missing_token", { replace: true }); + return; + } + // Guarda token y opcionalmente trae perfil real + localStorage.setItem("tasky_token", token); + + // Si quieres traer perfil: + fetch(`${BASE}/api/me`, { + headers: { Authorization: `Bearer ${token}` } + }) + .then(r=>r.json()) + .then(resp => { + // puedes guardar en tu store global si quieres + // p. ej. localStorage.setItem("tasky_user", JSON.stringify(resp.user)); + }) + .finally(()=> nav("/", { replace:true })); + + }, [nav]); + + return
Validando…
+} \ No newline at end of file diff --git a/src/front/pages/Browse.jsx b/src/front/pages/Browse.jsx new file mode 100644 index 0000000000..e72f8b6f6e --- /dev/null +++ b/src/front/pages/Browse.jsx @@ -0,0 +1,37 @@ +// src/front/pages/Browse.jsx +import { useEffect, useState } from "react"; +import { listTasks } from "../api/tasks"; + + +export default function Browse() { + const [items, setItems] = useState([]); + const [err, setErr] = useState(""); + + useEffect(() => { + let live = true; + listTasks() + .then((data) => live && setItems(data)) + .catch((e) => live && setErr(e.message || "Error")); + return () => { live = false; }; + }, []); + + return ( +
+

Browse tasks

+ {err &&
Error: {err}
} + {!items.length && !err &&
No tasks yet.
} + +
+ {items.map(t => ( +
+
+

{t.title}

+ {typeof t.price !== "undefined" && ${t.price}} +
+ {!!t.description &&

{t.description}

} +
+ ))} +
+
+ ); +} \ No newline at end of file diff --git a/src/front/pages/Demo.jsx b/src/front/pages/Demo.jsx index 34250a45b7..6c08b333bb 100644 --- a/src/front/pages/Demo.jsx +++ b/src/front/pages/Demo.jsx @@ -1,43 +1,26 @@ -// Import necessary components from react-router-dom and other parts of the application. +// src/front/pages/Demo.jsx import { Link } from "react-router-dom"; -import useGlobalReducer from "../hooks/useGlobalReducer"; // Custom hook for accessing the global state. +import { useStore } from "../hooks/useGlobalReducer"; -export const Demo = () => { - // Access the global state and dispatch function using the useGlobalReducer hook. - const { store, dispatch } = useGlobalReducer() +export default function Demo() { + const { store /*, actions*/ } = useStore(); return (
    - {/* Map over the 'todos' array from the store and render each item as a list element */} - {store && store.todos?.map((item) => { - return ( -
  • - - {/* Link to the detail page of this todo. */} - Link to: {item.title} - -

    Open file ./store.js to see the global store that contains and updates the list of colors

    - - -
  • - ); - })} + {store && store.todos?.map((item) => ( +
  • + Link to: {item.title} +

    Open file ./store.js to see the global store

    +
  • + ))}

- - - - +
); -}; +} \ No newline at end of file diff --git a/src/front/pages/Home.jsx b/src/front/pages/Home.jsx index 341ed21768..6b686a4854 100644 --- a/src/front/pages/Home.jsx +++ b/src/front/pages/Home.jsx @@ -1,52 +1,160 @@ -import React, { useEffect } from "react" -import rigoImageUrl from "../assets/img/rigo-baby.jpg"; -import useGlobalReducer from "../hooks/useGlobalReducer.jsx"; - -export const Home = () => { - - const { store, dispatch } = useGlobalReducer() - - const loadMessage = async () => { - try { - const backendUrl = import.meta.env.VITE_BACKEND_URL - - if (!backendUrl) throw new Error("VITE_BACKEND_URL is not defined in .env file") - - const response = await fetch(backendUrl + "/api/hello") - const data = await response.json() - - if (response.ok) dispatch({ type: "set_hello", payload: data.message }) - - return data - - } catch (error) { - if (error.message) throw new Error( - `Could not fetch the message from the backend. - Please check if the backend is running and the backend port is public.` - ); - } - - } - - useEffect(() => { - loadMessage() - }, []) - - return ( -
-

Hello Rigo!!

-

- Rigo Baby -

-
- {store.message ? ( - {store.message} - ) : ( - - Loading message from the backend (make sure your python 🐍 backend is running)... - - )} -
-
- ); -}; \ No newline at end of file +// src/front/pages/Home.jsx +import { useEffect, useState } from "react" +import { Link } from "react-router-dom" +import { useStore } from "../hooks/useGlobalReducer" +import { listTasks } from "../api/tasks" // ya existe +import "./home.css" // estilos nuevos y ligeros + +export default function Home() { + const { store } = useStore() + const [msg, setMsg] = useState("Cargando…") + const [tasks, setTasks] = useState([]) + const [loadingTasks, setLoadingTasks] = useState(true) + + const BASE = import.meta.env.VITE_BACKEND_URL?.replace(/\/$/, "") + + useEffect(() => { + // ping de salud (tu diagnóstico) + ;(async () => { + try { + const r = await fetch(`${BASE}/api/health`) + const data = await r.json() + setMsg(data.msg || JSON.stringify(data)) + } catch (err) { + setMsg(`Error: ${err.message}`) + } + })() + + // preview de tareas (opcional, no rompe si falla) + ;(async () => { + try { + const data = await listTasks() + setTasks((data || []).slice(0, 6)) + } catch { + // silencioso: si no hay backend para tasks, no pasa nada + } finally { + setLoadingTasks(false) + } + })() + }, []) + + return ( +
+ {/* HERO */} +
+
+

+ Consigue ayuda para todo lo que necesitas +

+

+ Publica una tarea en minutos y recibe ofertas de taskers verificados. +

+
+ Post a task + Browse tasks +
+ + {/* mini-stats (mock seguros) */} +
+
+ +120 + Taskers activos +
+
+ ~15min + Promedio de respuesta +
+
+ 4.8★ + Satisfacción +
+
+
+
+ + {/* CÓMO FUNCIONA */} +
+

¿Cómo funciona?

+
+ + Describe tu tarea con precio, fecha y ubicación. + + + Taskers cercanos te envían propuestas y dudas. + + + Elige la mejor opción y califica el resultado. + +
+
+ + {/* TAREAS RECIENTES (si hay) */} +
+
+

Tareas recientes

+ Ver todas → +
+ + {loadingTasks ? ( +
+ ) : tasks.length ? ( +
+ {tasks.map((t) => ( + + ))} +
+ ) : ( +
+

No hay tareas para mostrar aún.

+ Crea la primera +
+ )} +
+ + {/* DIAGNÓSTICO (tu tarjeta original, ahora plegable) */} +
+
+ Diagnóstico (API / entorno) +
+

Tasky – Home

+

Backend dice: {msg}

+

VITE_BACKEND_URL: {import.meta.env.VITE_BACKEND_URL}

+ {store.user && ( +

Sesión: {store.user.email} (rol: {store.user.role})

+ )} +
+
+
+
+ ) +} + +function Step({ emoji, title, children }) { + return ( +
+
{emoji}
+
+

{title}

+

{children}

+
+
+ ) +} + +function TaskCard({ task }) { + return ( +
+
+

{task.title}

+ {task.price != null && ${task.price}} +
+

{task.description}

+
+ 📍 {task.location || "Remoto"} + + {task.status || "pending"} + +
+
+ ) +} \ No newline at end of file diff --git a/src/front/pages/Layout.jsx b/src/front/pages/Layout.jsx index 9bfa31325c..a0bdcfca88 100644 --- a/src/front/pages/Layout.jsx +++ b/src/front/pages/Layout.jsx @@ -1,15 +1,13 @@ -import { Outlet } from "react-router-dom/dist" -import ScrollToTop from "../components/ScrollToTop" -import { Navbar } from "../components/Navbar" -import { Footer } from "../components/Footer" +import { Outlet } from "react-router-dom"; +import { Navbar } from "../components/Navbar"; +import Footer from "../components/Footer"; -// Base component that maintains the navbar and footer throughout the page and the scroll to top functionality. -export const Layout = () => { - return ( - - - -