{"id":26228245,"url":"https://github.com/nemanjam/nextjs-docker-development","last_synced_at":"2025-06-21T18:07:37.177Z","repository":{"id":271131758,"uuid":"912468929","full_name":"nemanjam/nextjs-docker-development","owner":"nemanjam","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-05T17:54:16.000Z","size":17853,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T20:51:17.599Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nemanjam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2025-01-05T16:56:41.000Z","updated_at":"2025-01-05T17:54:20.000Z","dependencies_parsed_at":"2025-01-05T18:41:56.905Z","dependency_job_id":null,"html_url":"https://github.com/nemanjam/nextjs-docker-development","commit_stats":null,"previous_names":["nemanjam/nextjs-docker-development"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nemanjam/nextjs-docker-development","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemanjam%2Fnextjs-docker-development","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemanjam%2Fnextjs-docker-development/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemanjam%2Fnextjs-docker-development/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemanjam%2Fnextjs-docker-development/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nemanjam","download_url":"https://codeload.github.com/nemanjam/nextjs-docker-development/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemanjam%2Fnextjs-docker-development/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261170423,"owners_count":23119513,"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":"2025-03-12T20:50:25.831Z","updated_at":"2025-06-21T18:07:32.160Z","avatar_url":"https://github.com/nemanjam.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Products page\n\n## Demo\n\nStore page is on the `/store` route.\n\n- Docker: https://products-page.arm1.nemanjamitic.com/store\n- Fleek: https://ancient-garden-incalculable.functions.on-fleek.app/store\n\n## Screenshots\n\nhttps://github.com/user-attachments/assets/429a83b7-8762-468b-91a2-ed48a150e64b\n\n## Notes\n\n- I build it as a full stack SSR Next.js app. There is a simulated and `1s` delayed database call in `modules/database.ts` for fetching and filtering products. Search query term and display grid/list value are stored as url query param to keep SSR for products list, which is important for SEO and performance. Official docs linked in [References](#references) section also states this advantage.\n- I used Shadcn starter project which I updated.\n- Figma design should be closely matched with an additional side note that I used the closest available Tailwind value for maintainability purpose. For example `h-32` instead of `h-[120px]` for spacing, or `theme('colors.neutral.900')` instead of `#111111` for colors. For finding the closest available Tailwind palette color I used tool linked in [References](#references) section.\n- The design is fully responsive, including the collapsible navbar.\n- All 4 fetching states are handled, 1. data, 2. no data, 3. loading, 4 error. Loading is done using `\u003cSuspense /\u003e` boundary component and skeletons. Error boundary is done using `app/error.tsx` file boundary. You can trigger a test database error by typing `db-error` in search input.\n- Beside the dark theme from mockup there is an additional light theme with default colors from Shadcn starter.\n- The only details different for the Figma design are theme button and breakpoints indicator which I left intentionally in production for easier testing.\n- Images are served from `public/assets/images/` static folder.\n- Available editable config values are stored in `config/app.ts`:\n\n```ts\nexport const CONFIG = {\n  NAME: 'Level Up Gaming',\n  DESCRIPTION: 'Welcome to the Level Up Gaming store.',\n  WAIT_DATABASE: 1000,\n  WAIT_DEBOUNCE_SEARCH_INPUT: 300,\n  TRIGGER_ERROR_SEARCH_QUERY: 'db-error',\n} as const;\n```\n\n## Installation and running\n\nI used Node.js `v22.9.0`.\n\n```bash\n# install dependencies\nyarn install\n\n# run in dev mode, visit http://localhost:3000/store\nyarn dev\n\n# build\nyarn build\n\n# run in prod mode\nyarn cp\nnode .next/standalone/server.js\n# or\nyarn standalone\n```\n\n### Docker deployment\n\nSet the following Github secrets and use `build-push-docker.yml` and `deploy-docker.yml` Github Actions workflows to build, push and deploy Docker image to the remote server.\n\n```bash\nDOCKER_USERNAME\nDOCKER_PASSWORD\n\nREMOTE_HOST\nREMOTE_USERNAME\nREMOTE_KEY_ED25519\nREMOTE_PORT\n```\n\n### Fleek deployment\n\nTutorial: https://fleek.xyz/blog/announcements/nextjs-support-release/\n\n```bash\n# clone repo\ngit clone git@github.com:nemanjam/products-page.git\n\n# in next.config.mjs comment out this line\noutput: 'standalone',\n\n#install fleek cli\nnpm install -g @fleek-platform/cli\nfleek version\n\n# login to fleek cli\nfleek login\n\n# add @fleek-platform/next package\nnpm install @fleek-platform/next\n\n# use npm instead of yarn and install packages\nnpm install\n\n# build app\nnpx fleek-next build\n\n# create function and select project\nfleek functions create --name products-page-f1\n\n# deploy and select products-page-f1 function\nfleek functions deploy --bundle=false --path .fleek/dist/index.js --assets .fleek/static\n\n```\n\n## References\n\n- Shadcn starter project (needs updating) https://github.com/shadcn-ui/next-template\n- Search and pagination as url query params to keep SSR for filtering Products list https://nextjs.org/learn/dashboard-app/adding-search-and-pagination\n- Copy assets for `output: 'standalone'` build, needed for Docker: https://nextjs.org/docs/app/api-reference/next-config-js/output#automatically-copying-traced-files\n- Deploy full stack Next.js app as Fleek function https://fleek.xyz/blog/announcements/nextjs-support-release/\n- Find the nearest Tailwind palette color tool https://nearest-tailwind-color.netlify.app/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnemanjam%2Fnextjs-docker-development","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnemanjam%2Fnextjs-docker-development","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnemanjam%2Fnextjs-docker-development/lists"}