{"id":24901766,"url":"https://github.com/goose97/visualize-algo","last_synced_at":"2025-03-27T18:19:54.421Z","repository":{"id":42247500,"uuid":"244676835","full_name":"Goose97/visualize-algo","owner":"Goose97","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-13T12:08:30.000Z","size":3764,"stargazers_count":0,"open_issues_count":15,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T21:17:34.928Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Goose97.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}},"created_at":"2020-03-03T15:47:58.000Z","updated_at":"2020-08-12T00:17:28.000Z","dependencies_parsed_at":"2023-01-28T12:01:40.901Z","dependency_job_id":null,"html_url":"https://github.com/Goose97/visualize-algo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Goose97%2Fvisualize-algo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Goose97%2Fvisualize-algo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Goose97%2Fvisualize-algo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Goose97%2Fvisualize-algo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Goose97","download_url":"https://codeload.github.com/Goose97/visualize-algo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245898314,"owners_count":20690466,"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-02-01T21:17:42.095Z","updated_at":"2025-03-27T18:19:54.400Z","avatar_url":"https://github.com/Goose97.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# with Firebase Hosting example\n\nThe goal is to host the Next.js app on Firebase Cloud Functions with Firebase Hosting rewrite rules so our app is served from our Firebase Hosting URL. Each individual `page` bundle is served in a new call to the Cloud Function which performs the initial server render.\n\nIf you are having issues, feel free to tag @jthegedus in the [issue you create on the next.js repo](https://github.com/vercel/next.js/issues/new)\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eMake sure that firebase is set up and you have the projectID\u003c/b\u003e\u003c/summary\u003e\n\n- Install Firebase Tools: `npm i -g firebase-tools`\n- Create a project through the [firebase web console](https://console.firebase.google.com/)\n- Login to the Firebase CLI tool with `firebase login`\n- Grab the **projectID** from [`firebase projects:list`](https://firebase.google.com/docs/cli#admin-commands) or the web consoles URL: `https://console.firebase.google.com/project/\u003cprojectID\u003e`\n  \u003c/details\u003e\n\n## How to use\n\n### Using `create-next-app`\n\nExecute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:\n\n```bash\nnpx create-next-app --example with-firebase-hosting with-firebase-hosting-app\n# or\nyarn create next-app --example with-firebase-hosting with-firebase-hosting-app\n```\n\nUpdate `.firebaserc`: adding your firebase project ID\n\n### Download manually\n\nDownload the example:\n\n```bash\ncurl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-firebase-hosting\ncd with-firebase-hosting\n```\n\nUpdate `.firebaserc`: adding your firebase project ID\n\nInstall it and run:\n\n```bash\nnpm install\nnpm run dev\n# or\nyarn\nyarn dev\n\n# to run Firebase locally for testing:\nnpm run serve\n\n# to deploy it to the cloud with Firebase:\nnpm run deploy\n```\n\n## Typescript\n\nTo use Typescript, simply follow [Typescript setup](https://nextjs.org/learn/excel/typescript/setup) as normal (package.json scripts are already set).\n\ni.e: `npm install --save-dev typescript @types/react @types/node`\n\nThen you can create components and pages in `.tsx` or `.ts`\n\n**Only `src/next.config.js` and `firebaseFunctions.js` must remain in `*.js` format.**\n\n## Good to know\n\n- [`firebase.json`](firebase.json:#L7) outlines the catchall rewrite rule for our Cloud Function.\n- The empty `public/.gitignore` file is to ensure `public/` dir exists as it is required for Firebase Hosting. It is [configured](firebase.json:#L4) (by [default](https://firebase.google.com/docs/hosting/full-config#ignore)) that dotfiles (`public/.*`) are ignored from bein publicly served.\n- The Cloud Function is named `nextjsFunc` (changeable in [firebaseFunctions.js](firebaseFunctions.js#L16) and [firebase.json](firebase.json#L8)).\n- `public/*` files are statically served through [Firebase hosting](https://firebase.google.com/docs/hosting/full-config#public), not through [NextJs server](https://nextjs.org/docs/basic-features/static-file-serving).\n- Specifying [`\"engines\": {\"node\": \"10\"}`](package.json#L5-L7) in `package.json` is required and the [latest supported](https://firebase.google.com/docs/functions/manage-functions#set_nodejs_version) by firebase functions.\n\n#### Customization\n\nNext App is in `src/` directory.\n\nThe crucial files for the setup:\n\n- `.firebaserc`\n- `firebase.json`\n- `firebaseFunctions.js`\n- `src/next.config.js`\n- In `package.json`: `firebase-*` packages and `engines` field\n\n## Caveat\n\nBecause firebase functions require `\"engines\": {\"node\": \"10\"}` (or 8) to be specified (in `package.json`), if you are using `yarn` (instead of `npm`), you will need to add flag [`--ignore-engines`](https://classic.yarnpkg.com/en/docs/cli/install/#toc-yarn-install-ignore-engines).\n\n## References\n\n- [geovanisouza92/serverless-firebase](https://github.com/geovanisouza92/serverless-firebase) repo\n- [jthegedus/firebase-functions-next-example](https://github.com/jthegedus/firebase-functions-next-example) repo\n- [this medium article](https://medium.com/@jthegedus/next-js-on-cloud-functions-for-firebase-with-firebase-hosting-7911465298f2)\n- [Crash Course: Node.js apps on Firebase Hosting](https://youtu.be/LOeioOKUKI8)\n- [Official documentation](https://firebase.google.com/docs/cli).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoose97%2Fvisualize-algo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoose97%2Fvisualize-algo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoose97%2Fvisualize-algo/lists"}