{"id":21448149,"url":"https://github.com/ehsangazar/zapp","last_synced_at":"2025-03-17T02:09:39.172Z","repository":{"id":231699215,"uuid":"782471508","full_name":"ehsangazar/zapp","owner":"ehsangazar","description":"Zapp Admin","archived":false,"fork":false,"pushed_at":"2024-04-11T14:44:11.000Z","size":756,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-23T11:45:43.294Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://zapp-app.fly.dev:8080/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ehsangazar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-05T11:21:19.000Z","updated_at":"2024-04-08T00:42:15.000Z","dependencies_parsed_at":"2024-04-11T15:46:42.963Z","dependency_job_id":null,"html_url":"https://github.com/ehsangazar/zapp","commit_stats":null,"previous_names":["ehsangazar/zapp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehsangazar%2Fzapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehsangazar%2Fzapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehsangazar%2Fzapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehsangazar%2Fzapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ehsangazar","download_url":"https://codeload.github.com/ehsangazar/zapp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243960665,"owners_count":20375104,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T03:14:17.707Z","updated_at":"2025-03-17T02:09:39.147Z","avatar_url":"https://github.com/ehsangazar.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Welcome to Zapp Project\n\n## Intro Video\n\n[Loom](https://www.loom.com/share/9220208c26ed4d0a894a6aea3e85db7b)\n\n## Tech Decisions\n\n- RemixJS for FrontEnd as it's easier and faster to develop\n- Fastify: Faster and Better performance to have ndoejs apps\n- Prisma: Great ORM with easy migraitons and powerful\n- SQLite: As the suggestion on code test introduction\n\n## Assumptions:\n\n- We have 4 required fields, sku, description, quantity and store\n  `Simple to use new fields if we needed to`\n- Assumed that our csv columns are always on the order of quantity,sky,description,store\n  `Of course we have different order, we can show them in the import modal and ask the user to assign which column is what field, or alternatively we could parse the header and find which header is what column`\n- Assumed we can always have all the .csv rows in the memory and send within one request to our API\n  `This is only to simplify the exercise, bigger the .csv files, we could send few at ones (multiple requests) to backend, (And show the state modal as like 1/20 records are saved`\n- Depending on the server (how much we want to keep the connection alive, we can send data to backend, 4 columns, makes ~ 40 bytes and 100 records makes 400 bytes), reasonable to say we can send 2KB easily, like 500 rows\n- I am sending one request to check for duplicates to update or create the record. which makes it slow, imagine 10ms for each query\n\n```500 records -\u003e 500 find + 500 create/update -\u003e 1000*10ms = 10s!\nNot Ideal -\u003e better is either\n- send less records -\u003e 10 records -\u003e ~200ms\n- remvoe the find, use upsert -\u003e we can make half that, ~5s\n- upsertMany (https://github.com/prisma/prisma/issues/4134) to have one request to make it all, (Ideal way, feature is being developed or we can make our own query)\n- After user changes and validaets, (Save can export .csv -\u003e upload it to server then parse it later) -\u003e Complex, but perhaps better for huge .csv files\n```\n\n- No Pagination is developed, however, we definitely need paignation for experience or number items we can mount tot he page! I could use React Virtualised Table or Developed my own to render less or only items in the view\n- Similarly fetch is only for demonstration of records, no pagination is implemented\n- Testing: There is no test written, as I thought based on Description on the test, it's not something that you want are interested in, However, this is absoltely needed for real projects.\n\n## Env Varibales\n\nCreate the .env file based on .env.example\n\n## Install Dependencies\n\nsimply run\n\n```\nnpm install -g pnpm\npnpm install\nnpx prisma generate\nnpx prisma db push\n```\n\n## Development\n\nRun both backend and frontend\n\n```shellscript\npnpm run dev\n```\n\nFrontEnd Local URL: http://0.0.0.0:5173\nBackend Local URL: http://0.0.0.0:3000\n\n## Docker\n\n```\ndocker build -t zapp-docker . \u0026\u0026 docker run -p 3000:3000 -p 8080:8080 zapp-docker\n```\n\nAnd everything will be available on http://localhost:8080\n\n## Deployment\n\nFirst, build your app for production:\n\n```sh\npnpm run build\n```\n\nThen run the app in production mode:\n\n```sh\npnpm start\n```\n\nNow you'll need to pick a host to deploy it to.\n\n## Fly\n\nWe can have a dockerfile deploy both frontend and backend\nSince there is a docker, we can deploy that easily to fly.\n\nDeployed Version: https://zapp-app.fly.dev:8080/\n\n## Vercel for FrontEnd.\n\nWe have different commands, so we can deploy frontend to Vercel\nand Backend to Fly or Heroku\n\n## CI/CD\n\nGithub Actions and .workflow/deploy.yml we can deploy this easily using a CI/CD to any of the options above.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fehsangazar%2Fzapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fehsangazar%2Fzapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fehsangazar%2Fzapp/lists"}