{"id":22558019,"url":"https://github.com/jd-apprentice/next-mongoose","last_synced_at":"2026-04-28T23:39:03.702Z","repository":{"id":39855902,"uuid":"494950655","full_name":"jd-apprentice/Next-Mongoose","owner":"jd-apprentice","description":"🇳 NextJs + Mongo + Mongoose","archived":false,"fork":false,"pushed_at":"2022-07-09T20:20:33.000Z","size":146,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T11:34:29.898Z","etag":null,"topics":["mongodb","mongoose","nextjs"],"latest_commit_sha":null,"homepage":"https://next-pet.vercel.app/","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/jd-apprentice.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}},"created_at":"2022-05-22T03:36:39.000Z","updated_at":"2023-01-06T13:06:48.000Z","dependencies_parsed_at":"2022-09-02T16:12:17.158Z","dependency_job_id":null,"html_url":"https://github.com/jd-apprentice/Next-Mongoose","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jd-apprentice/Next-Mongoose","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jd-apprentice%2FNext-Mongoose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jd-apprentice%2FNext-Mongoose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jd-apprentice%2FNext-Mongoose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jd-apprentice%2FNext-Mongoose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jd-apprentice","download_url":"https://codeload.github.com/jd-apprentice/Next-Mongoose/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jd-apprentice%2FNext-Mongoose/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278827852,"owners_count":26053212,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["mongodb","mongoose","nextjs"],"created_at":"2024-12-07T20:10:40.489Z","updated_at":"2025-10-07T18:45:18.326Z","avatar_url":"https://github.com/jd-apprentice.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MongoDB and Mongoose with Next.js\n\nThis example shows how you can use a MongoDB database to support your Next.js application.\n\n**Pet** is an application that allows users to add their pets' information (e.g., name, owner's name, diet, age, dislikes, likes, and photo). They can also delete it or edit it anytime.\n\n## Deploy your own\n\nOnce you have access to [the environment variables you'll need](#step-2-set-up-environment-variables), deploy the example using [Vercel](https://vercel.com?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=next-example):\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-mongodb-mongoose\u0026project-name=with-mongodb-mongoose\u0026repository-name=with-mongodb-mongoose\u0026env=MONGODB_URI\u0026envDescription=Required%20to%20connect%20the%20app%20with%20MongoDB\u0026envLink=https://github.com/vercel/next.js/tree/canary/examples/with-mongodb-mongoose%23step-2-set-up-environment-variables)\n\n## How to use\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-mongodb-mongoose with-mongodb-mongoose-app\n# or\nyarn create next-app --example with-mongodb-mongoose with-mongodb-mongoose-app\n# or\npnpm create next-app -- --example with-mongodb-mongoose with-mongodb-mongoose-app\n```\n\n## Configuration\n\n### Step 1. Get the connection string of your MongoDB server\n\nIn the case of MongoDB Atlas, it should be a string like this:\n\n```\nmongodb+srv://\u003cusername\u003e:\u003cpassword\u003e@my-project-abc123.mongodb.net/test?retryWrites=true\u0026w=majority\n```\n\nFor more details, follow this [MongoDB Guide](https://docs.mongodb.com/guides/server/drivers/) on how to connect to MongoDB.\n\n### Step 2. Set up environment variables\n\nCopy the `.env.local.example` file in this directory to `.env.local` (which will be ignored by Git):\n\n```bash\ncp .env.local.example .env.local\n```\n\nThen set each variable on `.env.local`:\n\n- `MONGODB_URI` should be the MongoDB connection string you got from step 1.\n\n### Step 3. Run Next.js in development mode\n\n```bash\nnpm install\nnpm run dev\n\n# or\n\nyarn install\nyarn dev\n```\n\nYour app should be up and running on [http://localhost:3000](http://localhost:3000)! If it doesn't work, post on [GitHub discussions](https://github.com/vercel/next.js/discussions).\n\n## Deploy on Vercel\n\nYou can deploy this app to the cloud with [Vercel](https://vercel.com?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).\n\n#### Deploy Your Local Project\n\nTo deploy your local project to Vercel, push it to GitHub/GitLab/Bitbucket and [import to Vercel](https://vercel.com/import/git?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=next-example).\n\n**Important**: When you import your project on Vercel, make sure to click on **Environment Variables** and set them to match your `.env.local` file.\n\n#### Deploy from Our Template\n\nAlternatively, you can deploy using our template by clicking on the Deploy button below.\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-mongodb-mongoose\u0026project-name=with-mongodb-mongoose\u0026repository-name=with-mongodb-mongoose\u0026env=MONGODB_URI\u0026envDescription=Required%20to%20connect%20the%20app%20with%20MongoDB\u0026envLink=https://github.com/vercel/next.js/tree/canary/examples/with-mongodb-mongoose%23step-2-set-up-environment-variables)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjd-apprentice%2Fnext-mongoose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjd-apprentice%2Fnext-mongoose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjd-apprentice%2Fnext-mongoose/lists"}