{"id":13787228,"url":"https://github.com/omarkhatibco/adonis-nextjs","last_synced_at":"2025-03-17T00:47:38.746Z","repository":{"id":57173602,"uuid":"128263242","full_name":"omarkhatibco/adonis-nextjs","owner":"omarkhatibco","description":"A provider to initialize nextjs app with adonis.","archived":false,"fork":false,"pushed_at":"2020-06-09T08:04:54.000Z","size":19,"stargazers_count":34,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-16T15:28:41.382Z","etag":null,"topics":["adonis","nextjs","react"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/omarkhatibco.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-05T20:55:03.000Z","updated_at":"2024-06-20T09:33:30.000Z","dependencies_parsed_at":"2022-08-24T14:40:42.372Z","dependency_job_id":null,"html_url":"https://github.com/omarkhatibco/adonis-nextjs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omarkhatibco%2Fadonis-nextjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omarkhatibco%2Fadonis-nextjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omarkhatibco%2Fadonis-nextjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omarkhatibco%2Fadonis-nextjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omarkhatibco","download_url":"https://codeload.github.com/omarkhatibco/adonis-nextjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243955692,"owners_count":20374373,"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":["adonis","nextjs","react"],"created_at":"2024-08-03T20:00:31.630Z","updated_at":"2025-03-17T00:47:38.718Z","avatar_url":"https://github.com/omarkhatibco.png","language":"JavaScript","funding_links":[],"categories":["Third-party Service Integration"],"sub_categories":[],"readme":"# Adonis Nextjs 🚀\n\n\u003e A provider to initialize nextjs app with adonis.\n\n[![npm](https://img.shields.io/npm/v/adonis-nextjs.svg)](https://www.npmjs.com/package/adonis-nextjs)\n\n## Installation\n\nYou can install the package from npm.\n\nthis provider assume you have nextjs, React \u0026 React Dom\n\n```bash\nadonis install adonis-nextjs\n```\n\n## Configure\n\n### Register provider\n\nThe provider must be registered as a `provider`.\n\n```javascript\nconst providers = [...,'adonis-nextjs/providers/NextProvider'];\n```\n\n## Register your routes\n\n```javascript\nconst Route = use('Route');\nconst Next = use('Adonis/Addons/Next');\nconst handler = Next.getRequestHandler();\n\n// API Endpoint for your database\nRoute.get('/api', ({ request }) =\u003e {\n\treturn { greeting: \"I'm Api Endpoint\" };\n});\n\n// * Next Routes\nRoute.get('/b', ({ request, response }) =\u003e {\n\tconst query = request.get();\n\treturn Next.render(request.request, response.response, '/b', query);\n});\n\nRoute.get('/post/:id', ({ request, response, params }) =\u003e\n\tNext.render(request.request, response.response, '/b', {\n\t\tid: params.id\n\t})\n);\n\nRoute.get(\n\t'*',\n\t({ request, response }) =\u003e\n\t\tnew Promise((resolve, reject) =\u003e {\n\t\t\thandler(request.request, response.response, promise =\u003e {\n\t\t\t\tpromise.then(resolve).catch(reject);\n\t\t\t});\n\t\t})\n);\n```\n\n## Adding next.js folder\n\nThe next project directory is `next` by default, but you can change it using environment variables `NEXT_FOLDER`.\n\n## Register next.js Commands\n\n```json\n{\n\t\"scripts\": {\n\t\t\"dev\": \"node server.js\",\n\t\t\"build\": \"next build ./next\",\n\t\t\"export\": \"next export ./next\",\n\t\t\"start\": \"NODE_ENV=production node server.js\"\n\t}\n}\n```\n\n## Release History\n\nCheckout [CHANGELOG.md](https://github.com/omarkhatibco/adonis-nextjs/blob/master/CHANGELOG.md) file for release history.\n\n## Meta\n\n[@AdonisJs](http://adonisjs.com/)\n\n[@nextjs](https://github.com/zeit/next.js/)\n\nCheckout [LICENSE](https://github.com/omarkhatibco/adonis-nextjs/blob/master/LICENSE) for license information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomarkhatibco%2Fadonis-nextjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomarkhatibco%2Fadonis-nextjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomarkhatibco%2Fadonis-nextjs/lists"}