-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from JosephJL/dependabot/npm_and_yarn/protobufj…
…s-and-contentlayer-and-next-contentlayer-7.2.4 Bump protobufjs, contentlayer and next-contentlayer
- Loading branch information
Showing
9 changed files
with
6,879 additions
and
1,034 deletions.
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
.contentlayer/.cache/v0.3.4/compiled-contentlayer-config-AVG4FCS3.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// contentlayer.config.ts | ||
import { defineDocumentType, makeSource } from "contentlayer/source-files"; | ||
import readingTime from "reading-time"; | ||
var Post = defineDocumentType(() => ({ | ||
name: "Post", | ||
contentType: "mdx", | ||
filePathPattern: "posts/*.mdx", | ||
fields: { | ||
title: { | ||
type: "string", | ||
required: true | ||
}, | ||
description: { | ||
type: "string", | ||
required: true | ||
}, | ||
tags: { | ||
type: "list", | ||
of: { type: "string" }, | ||
required: false | ||
}, | ||
publishedAt: { | ||
type: "date", | ||
description: "The date the post was published", | ||
required: true | ||
}, | ||
lastUpdatedAt: { | ||
type: "date", | ||
description: "The date the article was last updated", | ||
required: true | ||
} | ||
}, | ||
computedFields: { | ||
slug: { | ||
type: "string", | ||
resolve: (post) => post._raw.sourceFileName.replace(/\.mdx$/, "") | ||
}, | ||
readingTime: { | ||
type: "json", | ||
resolve: (doc) => readingTime(doc.body.raw) | ||
} | ||
} | ||
})); | ||
var contentlayer_config_default = makeSource({ | ||
contentDirPath: "content", | ||
documentTypes: [Post] | ||
// mdx: { | ||
// remarkPlugins: [remarkGfm], | ||
// rehypePlugins: [ | ||
// rehypeSlug, | ||
// [ | ||
// rehypeAutolinkHeadings, | ||
// { | ||
// properties: { | ||
// className: ["anchor"], | ||
// }, | ||
// }, | ||
// ], | ||
// ], | ||
// }, | ||
}); | ||
export { | ||
contentlayer_config_default as default | ||
}; | ||
//# sourceMappingURL=compiled-contentlayer-config-AVG4FCS3.mjs.map |
7 changes: 7 additions & 0 deletions
7
.contentlayer/.cache/v0.3.4/compiled-contentlayer-config-AVG4FCS3.mjs.map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"version": 3, | ||
"sources": ["../../../contentlayer.config.ts"], | ||
"sourcesContent": ["import { defineDocumentType, makeSource } from \"contentlayer/source-files\";\n\nimport remarkGfm from \"remark-gfm\";\nimport rehypeSlug from \"rehype-slug\";\nimport rehypeAutolinkHeadings from \"rehype-autolink-headings\";\nimport readingTime from \"reading-time\";\n\nconst Post = defineDocumentType(() => ({\n name: \"Post\",\n contentType: \"mdx\",\n filePathPattern: \"posts/*.mdx\",\n fields: {\n title: {\n type: \"string\",\n required: true,\n },\n description: {\n type: \"string\",\n required: true,\n },\n tags: {\n type: \"list\",\n of: { type: \"string\" },\n required: false,\n },\n publishedAt: {\n type: \"date\",\n description: \"The date the post was published\",\n required: true,\n },\n lastUpdatedAt: {\n type: \"date\",\n description: \"The date the article was last updated\",\n required: true,\n },\n },\n computedFields: {\n slug: {\n type: \"string\",\n resolve: (post) =>\n post._raw.sourceFileName\n // hello-world.mdx => hello-world\n .replace(/\\.mdx$/, \"\"),\n },\n readingTime: {\n type: \"json\",\n resolve: (doc) => readingTime(doc.body.raw),\n },\n },\n}));\n\nexport default makeSource({\n contentDirPath: \"content\",\n documentTypes: [Post],\n // mdx: {\n // remarkPlugins: [remarkGfm],\n // rehypePlugins: [\n // rehypeSlug,\n // [\n // rehypeAutolinkHeadings,\n // {\n // properties: {\n // className: [\"anchor\"],\n // },\n // },\n // ],\n // ],\n // },\n});\n"], | ||
"mappings": ";AAAA,SAAS,oBAAoB,kBAAkB;AAK/C,OAAO,iBAAiB;AAExB,IAAM,OAAO,mBAAmB,OAAO;AAAA,EACrC,MAAM;AAAA,EACN,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,QAAQ;AAAA,IACN,OAAO;AAAA,MACL,MAAM;AAAA,MACN,UAAU;AAAA,IACZ;AAAA,IACA,aAAa;AAAA,MACX,MAAM;AAAA,MACN,UAAU;AAAA,IACZ;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,IAAI,EAAE,MAAM,SAAS;AAAA,MACrB,UAAU;AAAA,IACZ;AAAA,IACA,aAAa;AAAA,MACX,MAAM;AAAA,MACN,aAAa;AAAA,MACb,UAAU;AAAA,IACZ;AAAA,IACA,eAAe;AAAA,MACb,MAAM;AAAA,MACN,aAAa;AAAA,MACb,UAAU;AAAA,IACZ;AAAA,EACF;AAAA,EACA,gBAAgB;AAAA,IACd,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS,CAAC,SACR,KAAK,KAAK,eAEP,QAAQ,UAAU,EAAE;AAAA,IAC3B;AAAA,IACA,aAAa;AAAA,MACX,MAAM;AAAA,MACN,SAAS,CAAC,QAAQ,YAAY,IAAI,KAAK,GAAG;AAAA,IAC5C;AAAA,EACF;AACF,EAAE;AAEF,IAAO,8BAAQ,WAAW;AAAA,EACxB,gBAAgB;AAAA,EAChB,eAAe,CAAC,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAetB,CAAC;", | ||
"names": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"cacheItemsMap": { | ||
"posts/Setting-up-a-basic-springboot-mongodb-application-with-docker.mdx": { | ||
"document": { | ||
"title": "Setting up a basic Spring Boot MongoDB application", | ||
"description": "Aggregation of the resources used and the steps I took to set up my Spring Boot MongoDB application", | ||
"tags": [ | ||
"Resource" | ||
], | ||
"publishedAt": "2023-05-13T14:00:00.000Z", | ||
"lastUpdatedAt": "2023-05-13T14:00:00.000Z", | ||
"body": { | ||
"raw": "\n## Introduction\n\nThrough the process of building a form management system with Spring Boot and MongoDB, I found that there were many different approaches to setting up your own Spring Boot project. From choosing your IDE to setting up your database I found myself going through many different sources to find out how to piece everything together.\n\nThe repo for that project is a little big (Actually I just haven't really configured the security properly), so I wanted to use a separate sample project to show how I set up my Spring Boot + MongoDB project. The idea is that through this post you would have access to all you need to know to have a working setup with Spring Boot, and can then focus more of your time on design your REST endpoints + tackling your business needs rather than figuring out how to start.\n\nDo note that I am not an expert in Spring Boot, and this is merely a aggregation of resources and the steps I took to set up my Spring Boot + MongoDB project.\n\n## Setting up Spring Boot\n\nI mainly used vscode for my projects , so in this case I did the setup using Vscode’s Spring Boot Extension ([link here](https://code.visualstudio.com/docs/java/java-spring-boot)) . One of the extensions allows you to use Spring Initializr to setup your project in vscode which I found convenient to use.\n\n![](/img/springboot-mongodb/vscode.png)\n\nUsing the shortcut (Cmd + Shift + P ) for Mac and (Ctrl + Shift + P) for Windows , select “Spring Initializr: Create a Maven Project” and configure according to the version of Java you have on your machine as well as the dependencies you’ll need. For this example this is the configuration I’ll be using\n\nSpring Boot Version : 3.0.6\nProject Language : Java\nGroupId : com.example\nArtifactId : demo\nPackaging type : Jar\nJava version : 17\nDependencies : Spring Web, Spring Data MongoDB\n\nYou’ll need to install maven to run your Spring Boot project\nTheres extensive documentation on how to do so by both [Spring Boot](https://docs.spring.io/spring-boot/docs/current/reference/html/getting-started.html) and [Apache Maven](https://maven.apache.org/download.cgi)\n\nTheres also a guide by [Baeldung on installing Maven](https://www.baeldung.com/install-maven-on-windows-linux-mac)\n\nAfter installing Maven we’ll load the dependencies for your project\n\n```sh title=\"bash\"\n$ mvn install\n```\n\nThen to test and see if Spring Boot is running succesfully we’ll run\n\n```sh title=\"bash\"\n$ mvn spring-boot:run\n```\n\nOpen up [localhost:8080](http://localhost:8080) and you should see the following\n\n![](/img/springboot-mongodb/springbootDefaultPage.png)\n\nThis means that the development server is up and running\n\n## Deciding what File Structure to use\n\nTwo approaches\n\n1. organise folders by function\n2. organise by layer\n\nYou can find out more about folder structures for Spring Boot [here](https://www.javaguides.net/2019/01/standard-project-structure-for-spring-boot-projects.html)\n\nFor this project we went with the first approach, I felt that it was much clearer to have all the function related files in the same folder.\n\n## Setting up MongoDB with Docker\n\nWe’ll be using the [official docker image for mongo](https://hub.docker.com/_/mongo)\n\nTo start the mongoDB instance\n\n```sh title=\"bash\"\n$ docker run -d -p 27017:27017 --name demo-mongo mongo:latest\n```\n\n[https://earthly.dev/blog/mongodb-docker/](https://earthly.dev/blog/mongodb-docker/)\n\nI used [MongoDB Compass](https://www.mongodb.com/try/download/compass) to view the data in the MongoDB container.\n\n## Connecting Spring Boot to MongoDB Docker Container\n\n```sh title=\"bash\"\n$ docker run -d -p 27017:27017 --name test-mongo mongo:latest\n```\n\nSince the docker port was configured to 27017, this means that Spring Boot can cannect to your MongoDB instance through this port.\n\nWe [configure the database connection](https://www.baeldung.com/spring-data-mongodb-connection) in the application.properties folder under src/main/resources\n\n```sh title=\"bash\"\nspring.data.mongodb.database=smartform_db\nspring.data.mongodb.host=localhost\nspring.data.mongodb.port=27017\n```\n\nNow when you run the Spring Boot application, you should see something like this\n![](/img/springboot-mongodb/springbootMongoConnection.png)\n\nThats it! You can start building your API Routes with a working environment. I'll go through how I built some of the system functions in another post.\n", | ||
"code": "var Component=(()=>{var l=Object.create;var i=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var f=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),w=(o,e)=>{for(var t in e)i(o,t,{get:e[t],enumerable:!0})},s=(o,e,t,a)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let r of g(e))!m.call(o,r)&&r!==t&&i(o,r,{get:()=>e[r],enumerable:!(a=p(e,r))||a.enumerable});return o};var y=(o,e,t)=>(t=o!=null?l(u(o)):{},s(e||!o||!o.__esModule?i(t,\"default\",{value:o,enumerable:!0}):t,o)),b=o=>s(i({},\"__esModule\",{value:!0}),o);var c=f((D,h)=>{h.exports=_jsx_runtime});var j={};w(j,{default:()=>S,frontmatter:()=>v});var n=y(c()),v={title:\"Setting up a basic Spring Boot MongoDB application\",description:\"Aggregation of the resources used and the steps I took to set up my Spring Boot MongoDB application\",publishedAt:\"2023-5-14\",lastUpdatedAt:\"2023-5-14\",tags:[\"Resource\"]};function d(o){let e=Object.assign({h2:\"h2\",p:\"p\",a:\"a\",img:\"img\",pre:\"pre\",code:\"code\",ol:\"ol\",li:\"li\"},o.components);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e.h2,{children:\"Introduction\"}),`\n`,(0,n.jsx)(e.p,{children:\"Through the process of building a form management system with Spring Boot and MongoDB, I found that there were many different approaches to setting up your own Spring Boot project. From choosing your IDE to setting up your database I found myself going through many different sources to find out how to piece everything together.\"}),`\n`,(0,n.jsx)(e.p,{children:\"The repo for that project is a little big (Actually I just haven't really configured the security properly), so I wanted to use a separate sample project to show how I set up my Spring Boot + MongoDB project. The idea is that through this post you would have access to all you need to know to have a working setup with Spring Boot, and can then focus more of your time on design your REST endpoints + tackling your business needs rather than figuring out how to start.\"}),`\n`,(0,n.jsx)(e.p,{children:\"Do note that I am not an expert in Spring Boot, and this is merely a aggregation of resources and the steps I took to set up my Spring Boot + MongoDB project.\"}),`\n`,(0,n.jsx)(e.h2,{children:\"Setting up Spring Boot\"}),`\n`,(0,n.jsxs)(e.p,{children:[\"I mainly used vscode for my projects , so in this case I did the setup using Vscode\\u2019s Spring Boot Extension (\",(0,n.jsx)(e.a,{href:\"https://code.visualstudio.com/docs/java/java-spring-boot\",children:\"link here\"}),\") . One of the extensions allows you to use Spring Initializr to setup your project in vscode which I found convenient to use.\"]}),`\n`,(0,n.jsx)(e.p,{children:(0,n.jsx)(e.img,{src:\"/img/springboot-mongodb/vscode.png\",alt:\"\"})}),`\n`,(0,n.jsx)(e.p,{children:\"Using the shortcut (Cmd + Shift + P ) for Mac and (Ctrl + Shift + P) for Windows , select \\u201CSpring Initializr: Create a Maven Project\\u201D and configure according to the version of Java you have on your machine as well as the dependencies you\\u2019ll need. For this example this is the configuration I\\u2019ll be using\"}),`\n`,(0,n.jsx)(e.p,{children:`Spring Boot Version : 3.0.6\nProject Language : Java\nGroupId : com.example\nArtifactId : demo\nPackaging type : Jar\nJava version : 17\nDependencies : Spring Web, Spring Data MongoDB`}),`\n`,(0,n.jsxs)(e.p,{children:[`You\\u2019ll need to install maven to run your Spring Boot project\nTheres extensive documentation on how to do so by both `,(0,n.jsx)(e.a,{href:\"https://docs.spring.io/spring-boot/docs/current/reference/html/getting-started.html\",children:\"Spring Boot\"}),\" and \",(0,n.jsx)(e.a,{href:\"https://maven.apache.org/download.cgi\",children:\"Apache Maven\"})]}),`\n`,(0,n.jsxs)(e.p,{children:[\"Theres also a guide by \",(0,n.jsx)(e.a,{href:\"https://www.baeldung.com/install-maven-on-windows-linux-mac\",children:\"Baeldung on installing Maven\"})]}),`\n`,(0,n.jsx)(e.p,{children:\"After installing Maven we\\u2019ll load the dependencies for your project\"}),`\n`,(0,n.jsx)(e.pre,{children:(0,n.jsx)(e.code,{className:\"language-sh\",children:`$ mvn install\n`})}),`\n`,(0,n.jsx)(e.p,{children:\"Then to test and see if Spring Boot is running succesfully we\\u2019ll run\"}),`\n`,(0,n.jsx)(e.pre,{children:(0,n.jsx)(e.code,{className:\"language-sh\",children:`$ mvn spring-boot:run\n`})}),`\n`,(0,n.jsxs)(e.p,{children:[\"Open up \",(0,n.jsx)(e.a,{href:\"http://localhost:8080\",children:\"localhost:8080\"}),\" and you should see the following\"]}),`\n`,(0,n.jsx)(e.p,{children:(0,n.jsx)(e.img,{src:\"/img/springboot-mongodb/springbootDefaultPage.png\",alt:\"\"})}),`\n`,(0,n.jsx)(e.p,{children:\"This means that the development server is up and running\"}),`\n`,(0,n.jsx)(e.h2,{children:\"Deciding what File Structure to use\"}),`\n`,(0,n.jsx)(e.p,{children:\"Two approaches\"}),`\n`,(0,n.jsxs)(e.ol,{children:[`\n`,(0,n.jsx)(e.li,{children:\"organise folders by function\"}),`\n`,(0,n.jsx)(e.li,{children:\"organise by layer\"}),`\n`]}),`\n`,(0,n.jsxs)(e.p,{children:[\"You can find out more about folder structures for Spring Boot \",(0,n.jsx)(e.a,{href:\"https://www.javaguides.net/2019/01/standard-project-structure-for-spring-boot-projects.html\",children:\"here\"})]}),`\n`,(0,n.jsx)(e.p,{children:\"For this project we went with the first approach, I felt that it was much clearer to have all the function related files in the same folder.\"}),`\n`,(0,n.jsx)(e.h2,{children:\"Setting up MongoDB with Docker\"}),`\n`,(0,n.jsxs)(e.p,{children:[\"We\\u2019ll be using the \",(0,n.jsx)(e.a,{href:\"https://hub.docker.com/_/mongo\",children:\"official docker image for mongo\"})]}),`\n`,(0,n.jsx)(e.p,{children:\"To start the mongoDB instance\"}),`\n`,(0,n.jsx)(e.pre,{children:(0,n.jsx)(e.code,{className:\"language-sh\",children:`$ docker run -d -p 27017:27017 --name demo-mongo mongo:latest\n`})}),`\n`,(0,n.jsx)(e.p,{children:(0,n.jsx)(e.a,{href:\"https://earthly.dev/blog/mongodb-docker/\",children:\"https://earthly.dev/blog/mongodb-docker/\"})}),`\n`,(0,n.jsxs)(e.p,{children:[\"I used \",(0,n.jsx)(e.a,{href:\"https://www.mongodb.com/try/download/compass\",children:\"MongoDB Compass\"}),\" to view the data in the MongoDB container.\"]}),`\n`,(0,n.jsx)(e.h2,{children:\"Connecting Spring Boot to MongoDB Docker Container\"}),`\n`,(0,n.jsx)(e.pre,{children:(0,n.jsx)(e.code,{className:\"language-sh\",children:`$ docker run -d -p 27017:27017 --name test-mongo mongo:latest\n`})}),`\n`,(0,n.jsx)(e.p,{children:\"Since the docker port was configured to 27017, this means that Spring Boot can cannect to your MongoDB instance through this port.\"}),`\n`,(0,n.jsxs)(e.p,{children:[\"We \",(0,n.jsx)(e.a,{href:\"https://www.baeldung.com/spring-data-mongodb-connection\",children:\"configure the database connection\"}),\" in the application.properties folder under src/main/resources\"]}),`\n`,(0,n.jsx)(e.pre,{children:(0,n.jsx)(e.code,{className:\"language-sh\",children:`spring.data.mongodb.database=smartform_db\nspring.data.mongodb.host=localhost\nspring.data.mongodb.port=27017\n`})}),`\n`,(0,n.jsxs)(e.p,{children:[`Now when you run the Spring Boot application, you should see something like this\n`,(0,n.jsx)(e.img,{src:\"/img/springboot-mongodb/springbootMongoConnection.png\",alt:\"\"})]}),`\n`,(0,n.jsx)(e.p,{children:\"Thats it! You can start building your API Routes with a working environment. I'll go through how I built some of the system functions in another post.\"})]})}function B(o={}){let{wrapper:e}=o.components||{};return e?(0,n.jsx)(e,Object.assign({},o,{children:(0,n.jsx)(d,o)})):d(o)}var S=B;return b(j);})();\n;return Component;" | ||
}, | ||
"_id": "posts/Setting-up-a-basic-springboot-mongodb-application-with-docker.mdx", | ||
"_raw": { | ||
"sourceFilePath": "posts/Setting-up-a-basic-springboot-mongodb-application-with-docker.mdx", | ||
"sourceFileName": "Setting-up-a-basic-springboot-mongodb-application-with-docker.mdx", | ||
"sourceFileDir": "posts", | ||
"contentType": "mdx", | ||
"flattenedPath": "posts/Setting-up-a-basic-springboot-mongodb-application-with-docker" | ||
}, | ||
"type": "Post", | ||
"slug": "Setting-up-a-basic-springboot-mongodb-application-with-docker", | ||
"readingTime": { | ||
"text": "4 min read", | ||
"minutes": 3.055, | ||
"time": 183300, | ||
"words": 611 | ||
} | ||
}, | ||
"documentHash": "1684297563918", | ||
"hasWarnings": false, | ||
"documentTypeName": "Post" | ||
} | ||
} | ||
} |
Oops, something went wrong.
9c83509
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
joseph-portfolio – ./
joseph-portfolio-git-main-josephjl.vercel.app
joseph-portfolio-one.vercel.app
joseph-portfolio-josephjl.vercel.app