{"id":7503,"date":"2026-08-08T09:15:25","date_gmt":"2026-08-08T00:15:25","guid":{"rendered":"https:\/\/www.freelifemakers.org\/wordpress\/?p=7503"},"modified":"2026-08-08T17:31:14","modified_gmt":"2026-08-08T08:31:14","slug":"nextjs-serveraction","status":"publish","type":"post","link":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/2026\/08\/08\/nextjs-serveraction\/","title":{"rendered":"[nextjs]\ubc29\uba85\ub85d + nextauth + ServerAction \/ Guestbook + nextauth + ServerAction"},"content":{"rendered":"\n<p>\ud83d\udc49\ud83c\udffb \uae30\uc874 \ud504\ub85c\uc81d\ud2b8(myapp7)\uc5d0 \uc11c\ubc84\uc561\uc158 \ubc29\uc2dd\uc744 \ucd94\uac00\ud588\uc2b5\ub2c8\ub2e4.<br>I added the Server Actions approach to the previous project (myapp7).<\/p>\n\n\n\n<p>\ud83d\udc49\ud83c\udffb \uc774\uc804 \ud3ec\uc2a4\ud2b8 \/ Previous post(myapp7)<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-freelifemakers-org wp-block-embed-freelifemakers-org\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"cdOcFDpZlI\"><a href=\"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/2026\/08\/06\/nextjs-guestbook-sqlite-nextauth\/\">[nextjs]\ubc29\uba85\ub85d + sqlite+nextauth \/ guestbook + sqlite + nextauth<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;[nextjs]\ubc29\uba85\ub85d + sqlite+nextauth \/ guestbook + sqlite + nextauth&#8221; &#8212; freelifemakers.org\" src=\"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/2026\/08\/06\/nextjs-guestbook-sqlite-nextauth\/embed\/#?secret=xtIQ3wnvCe#?secret=cdOcFDpZlI\" data-secret=\"cdOcFDpZlI\" width=\"560\" height=\"315\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>\ud83d\udcc1 \uc804\uccb4 \ud504\ub85c\uc81d\ud2b8 \uad6c\uc870 \/ Overall Project Structure(myapp8)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>myapp8\/ \n\u251c\u2500\u2500 app\/ (Next.js App Router)\n\u2502   \u251c\u2500\u2500 api\/ (Backend API)\n\u2502   \u2502   \u251c\u2500\u2500 auth\/ (Oauth API)\n\u2502   \u2502   \u2502   \u2514\u2500\u2500 &#91;...nextauth]\/ \n\u2502   \u2502   \u2502       \u2514\u2500\u2500 route.ts \n\u2502   \u2502   \u2514\u2500\u2500 guestbookapp\/ (CRUD API)\n\u2502   \u2502       \u251c\u2500\u2500 &#91;id]\/ \n\u2502   \u2502       \u2502   \u2514\u2500\u2500 route.ts\n\u2502   \u2502       \u2514\u2500\u2500 route.ts \n\u2502   \u251c\u2500\u2500 guestbookapp\/ (FrontEnd)\n\u2502   \u2502   \u251c\u2500\u2500 GuestbookClient.tsx (Component)\n\u2502   \u2502   \u2514\u2500\u2500 page.tsx (Main Page)\n\u2502   \u2502\n\u2502   \u251c\u2500\u2500 guestbookaction\/ (FrontEnd)\n\u2502   \u2502   \u251c\u2500\u2500 db.ts (sqlite3 db connection)\n\u2502   \u2502   \u251c\u2500\u2500 actions.ts (Server Action)\n\u2502   \u2502   \u251c\u2500\u2500 GuestbookClient.tsx (Component)\n\u2502   \u2502   \u2514\u2500\u2500 page.tsx (Main Page)\n\u2502   \u2502 \n\u2502   \u251c\u2500\u2500 auth.ts (NextAuth Login)\n\u2502   \u251c\u2500\u2500 favicon.ico \n\u2502   \u251c\u2500\u2500 globals.css \n\u2502   \u251c\u2500\u2500 layout.tsx \n\u2502   \u2514\u2500\u2500 page.tsx (Project Main page)\n\u251c\u2500\u2500 .env.local(Environment variable)\n\u2514\u2500\u2500 local.db (SQLite Database)\n<\/code><\/pre>\n\n\n\n<p>\ud83d\udcc1 \ud504\ub85c\uc81d\ud2b8 \uc124\uce58(myapp8)<br>Project Installation (myapp8)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npx create-next-app@latest<\/code><\/pre>\n\n\n\n<p>\ud83d\udcc1 sqlite3 \ubaa8\ub4c8 \uc124\uce58<br>Install the sqlite3 module.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install better-sqlite3<\/code><\/pre>\n\n\n\n<p>\ud83d\udcc1 NextAuth \ubaa8\ub4c8 \uc124\uce58<br>Install the NextAuth module.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install next-auth@beta<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\ud83d\udcc1 \uc11c\ubc84\uc2e4\ud589 \/ Start Servr<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm run dev<\/code><\/pre>\n\n\n\n<p>\ud83d\udcc1 \uc11c\ubc84 \uc811\uc18d \ubc0f \ud14c\uc2a4\ud2b8<br>Server Connection and Testing<\/p>\n\n\n\n<p>\u2714\ufe0f fetch\ubc29\uc2dd \/ fetch method<\/p>\n\n\n\n<p>http:\/\/localhost:3000\/guestbookapp \uc73c\ub85c \ube0c\ub77c\uc6b0\uc800\uc5d0 \uc811\uc18d\ud569\ub2c8\ub2e4.<br>Access http:\/\/localhost:3000\/guestbookapp in your browser.<\/p>\n\n\n\n<p>\u2714\ufe0f Server Action <\/p>\n\n\n\n<p><a href=\"http:\/\/localhost:3000\/guestbookapp \uc73c\ub85c \ube0c\ub77c\uc6b0\uc800\uc5d0 \uc811\uc18d\ud569\ub2c8\ub2e4.Access http:\/\/localhost:3000\/guestbookapp in your browser.\">http:\/\/localhost:3000\/guestbookaction \uc73c\ub85c \ube0c\ub77c\uc6b0\uc800\uc5d0 \uc811\uc18d\ud569\ub2c8\ub2e4.<br>Access http:\/\/localhost:3000\/guestbookaction in your browser.<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"745\" height=\"1024\" src=\"https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp8-2-745x1024.png\" alt=\"\" class=\"wp-image-7540\" srcset=\"https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp8-2-745x1024.png 745w, https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp8-2-218x300.png 218w, https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp8-2-768x1055.png 768w, https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp8-2-400x549.png 400w, https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp8-2-800x1099.png 800w, https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp8-2.png 974w\" sizes=\"auto, (max-width: 745px) 100vw, 745px\" \/><\/figure>\n\n\n\n<p>\ud83d\udcc1 \ucf54\ub4dc \uc124\uba85 \/ Code Explanation<\/p>\n\n\n\n<p>\u2714\ufe0f myapp7\uc5d0 \uc788\ub294 \uae30\uc874 \ud504\ub85c\uc81d\ud2b8\ub294 \uc720\uc9c0\ud558\uace0 guestabookaction\uc744 \ucd94\uac00\ud588\uc2b5\ub2c8\ub2e4.<br>I retained the existing project in myapp7 and added guestbookaction.<\/p>\n\n\n\n<p>\u2714\ufe0f \uc791\ub3d9\ubc29\uc2dd\uc5d0 \uc788\uc5b4\uc11c Server Action\ubc29\uc2dd\uc740 \uae30\uc874\uc758 PHP\uac19\uc740 Server Side Script\uc640 \uc720\uc0ac\ud55c \ubc29\uc2dd\uc785\ub2c8\ub2e4.<br>In terms of how it operates, the Server Action approach is similar to traditional server-side scripting methods like PHP.<\/p>\n\n\n\n<p>\u2714\ufe0f \ucc28\uc774\uc810\uc740 \ud398\uc774\uc9c0 \uc774\ub3d9\uc5c6\uc774 \ud568\uc218\uc2e4\ud589\ud558\ub294 \uac83\uc73c\ub85c \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0 \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud558\uac70\ub098 \uc0ad\uc81c \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<br>The difference is that you can save or delete data in the database by executing a function without navigating to a different page.<\/p>\n\n\n\n<p>\u2714\ufe0f  Server Action\uc740 \ud3b8\uc758\uc131\uc640 \ubcf4\uc548 \uce21\uba74\uc5d0\uc11c\ub294 \uc7a5\uc810\uc774\uc9c0\ub9cc \ubaa8\ubc14\uc77c \uc571\uc774\ub098 Tauri\uac19\uc740 \uc571\uacfc \uc5f0\ub3d9\uc774 \uc5b4\ub835\ub2e4\ub294 \ub2e8\uc810\uc774 \uc788\uc2b5\ub2c8\ub2e4.<br>While Server Actions offer advantages in terms of convenience and security, they have the drawback of being difficult to integrate with mobile apps or applications like Tauri.<\/p>\n\n\n\n<p>\u2714\ufe0f \uadf8\ub798\uc11c \uc774 \ud504\ub85c\uc81d\ud2b8\uc5d0\uc11c\ub294 myapp7\uacfc \ube44\uad50 \ud560 \uc218 \uc788\uac8c \uae30\uc874 \ub77c\uc6b0\ud2b8\ub294 \uc720\uc9c0\ud558\uace0 \uc0c8\ub85c guestabookaction \ub77c\uc6b0\ud2b8\ub97c \ucd94\uac00 \ud588\uc2b5\ub2c8\ub2e4. <br>Therefore, in this project, I kept the existing route and added a new <code>guestbookaction<\/code> route to allow for comparison with <code>myapp7<\/code>.<\/p>\n\n\n\n<p>\u2714\ufe0f ServerAction\uc744 \uc0ac\uc6a9\ud558\uba74 \uae43\ud5c8\ube0c\ub85c\uadf8\uc778\ubd80\ubd84\uc744 \uc81c\uc678\ud55c api\ubd80\ubd84\uc740 \uc0ac\uc6a9\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.<br>When using Server Actions, the API components\u2014with the exception of the GitHub login\u2014are not used.<\/p>\n\n\n\n<p>\u2714\ufe0f \uc774 \ud504\ub85c\uc81d\ud2b8\uc5d0\uc11c \uc11c\ubc84\uc561\uc158(\uae00 \uc800\uc7a5\uacfc \uc0ad\uc81c \uae30\ub2a5)\uc740 \uc544\ub798\uc758 \ud30c\uc77c\ub9cc \uc218\uc815\ud558\uba74 \ub429\ub2c8\ub2e4.<br>For this project, you only need to modify the following file for the server actions (post saving and deletion functions).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>myapp8\/ \n\u2514\u2500\u2500app\/ (Next.js App Router)\n   \u2514\u2500\u2500 guestbookaction\/ (FrontEnd)\n        \u251c\u2500\u2500 <strong>db.ts<\/strong> (sqlite3 db connection)\n        \u251c\u2500\u2500 <strong>actions.ts<\/strong> (Server Action)\n        \u251c\u2500\u2500 <strong>GuestbookClient.tsx<\/strong> (Component)\n        \u2514\u2500\u2500 <strong>page.tsx<\/strong> (Main Page)<\/code><\/pre>\n\n\n\n<p>\u2714\ufe0f \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\uacb0 <br>Database Connection<\/p>\n\n\n\n<p>&#8212; db.ts\ud30c\uc77c\uc5d0\uc11c \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\uacb0\uacfc \ucd08\uae30\ub370\uc774\ud130\ub97c \uc704\ud55c \ud568\uc218\ub97c \uc14b\ud305\ud569\ub2c8\ub2e4.<br>In the <code>db.ts<\/code> file, set up functions for the database connection and initial data.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ app\/guestbookaction\/db.ts\nimport path from 'path'\nimport Database from 'better-sqlite3'\n\nconst dbPath = path.join(process.cwd(), 'local.db')\n\nexport function getDb() {\n  const db = new Database(dbPath)\n  \n  \/\/ \ud14c\uc774\ube14 \uc0dd\uc131 \/ Create table if not exists\n  db.exec(`\n    CREATE TABLE IF NOT EXISTS posts (\n      id INTEGER PRIMARY KEY AUTOINCREMENT,\n      slug TEXT UNIQUE NOT NULL,\n      title TEXT NOT NULL,\n      content TEXT NOT NULL,\n      author_email TEXT,\n      created_at DATETIME DEFAULT CURRENT_TIMESTAMP\n    )\n  `)\n\n  \/\/ \ub370\uc774\ud130 \uc5c6\uc73c\uba74 \ucd08\uae30\ub370\uc774\ud130 \ub123\uae30 \/ If no data, insert initial data\n  const checkEmpty = db.prepare('SELECT COUNT(*) as count FROM posts').get() as { count: number }\n  \n  if (checkEmpty.count === 0) {\n    const insertInitial = db.prepare('INSERT INTO posts (slug, title, content) VALUES (?, ?, ?)')\n    const defaultTitle = '\ubc18\uac11\uc2b5\ub2c8\ub2e4! \uccab \ubc29\ubb38\uc744 \ud658\uc601\ud569\ub2c8\ub2e4.\\nWelcome! Thank you for visiting my blog.'\n    const defaultSlug = 'welcome-to-my-blog'\n    const defaultContent = `\uc548\ub155\ud558\uc138\uc694! \ube14\ub85c\uadf8 \uc2dc\uc2a4\ud15c\uc774 \uc131\uacf5\uc801\uc73c\ub85c \uad6c\ucd95\ub418\uc5c8\uc2b5\ub2c8\ub2e4.\\nHello! The blog system has been successfully set up.`\n    insertInitial.run(defaultSlug, defaultTitle, defaultContent)\n    console.log('\ucd08\uae30 \ub370\uc774\ud130 \uc0dd\uc131\ub428 \/ Initial data created')\n  }\n\n  return db\n}\n<\/code><\/pre>\n\n\n\n<p>\u2714\ufe0f \ub370\uc774\ud130\ubca0\uc774\uc2a4 \ud638\ucd9c<br>Database call<\/p>\n\n\n\n<p>&#8212; action.ts\uc640 page.ts\ud30c\uc77c\uc5d0\uc11c db.ts\ud30c\uc77c\uc744 \ud638\ucd9c\ud574\uc11c \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0 \uc5f0\uacb0\ud569\ub2c8\ub2e4.<br>Connect to the database by calling <code>db.ts<\/code> from the <code>action.ts<\/code> and <code>page.ts<\/code> files.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># action.ts\n<strong>import { getDb } from '.\/db'<\/strong>\n\nexport async function createPost(prevState: any, formData: FormData) {\n <strong> const db = getDb()<\/strong>\n}\n\nexport async function deletePost(id: number) {\n  <strong>const db = getDb()<\/strong>\n}\n\n# page.ts\n<strong>import { getDb } from '.\/db'<\/strong>\n\nasync function getPosts() {\n  <strong>const db = getDb()<\/strong>\n  const posts = db.prepare('SELECT * FROM posts ORDER BY id DESC').all()\n  db.close()\n  return posts as any&#91;]\n}\n\nexport default async function GuestbookPage() {\n  const session = await auth()\n  const posts = await getPosts() \n\n\n}\n<\/code><\/pre>\n\n\n\n<p>\u2714\ufe0f \ub370\uc774\ud130 \uc870\ud68c \ubc0f \ud45c\uc2dc\u00a0 \/ Data Fetching and Display<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># page.tsx\n    &lt;GuestbookClient\n      isLoggedIn={!!session?.user}\n      <strong>userEmail={session?.user?.email || \"\"} <\/strong>\n      <strong>posts={posts}<\/strong>\n    \/>\n\n# GuestbookClient.tsx\n\n  return (\n    &lt;>\n      &lt;ul className=\"flex flex-col gap-3 mt-8\">\n        {<strong>posts.map((post)<\/strong> => (\n          &lt;li key={post.id?? post.slug} className=\"border p-4 rounded flex justify-between items-start\">\n            &lt;div>\n              &lt;strong className=\"text-sm whitespace-pre-wrap\"><strong>{post.title}<\/strong>&lt;\/strong>\n              &lt;p className=\"text-sm text-gray-600 whitespace-pre-wrap\">{post.content}&lt;\/p>\n              &lt;p className=\"text-xs text-gray-400\"><strong>{post.author_email}<\/strong>&lt;\/p>\n            &lt;\/div>\n\n            {<strong>post.author_email === userEmail<\/strong> &amp;&amp; (\n              &lt;button\n                onClick={async () => {\n                  if (!confirm(\"\uc0ad\uc81c\ud560\uae4c\uc694? \/ Are you sure you want to delete this post?\")) return;\n                  await deletePost(post.id)\n                }}\n                className=\"bg-red-500 text-white px-2 py-1 rounded text-xs ml-4 shrink-0\"\n              >\n                \uc0ad\uc81c\/Delete\n              &lt;\/button>\n            )}\n          &lt;\/li>\n        ))}\n      &lt;\/ul>\n    &lt;\/>\n  )\n\n}<\/code><\/pre>\n\n\n\n<p>1)http:\/\/localhost:3000\/guestbookaction \uc774 \uc2e4\ud589\ub418\uba74 page.tsx\uac00 \uc2e4\ud589\ub429\ub2c8\ub2e4.<br>When http:\/\/localhost:3000\/guestbookaction is executed, page.tsx runs.<\/p>\n\n\n\n<p>2) page.tsx\uc5d0\uc11c \ub85c\uadf8\uc778\uc815\ubcf4\uc640 \uae00\uc744 GuestbookClient.tsx\ub85c \uac12\uc744 \ub118\uae41\ub2c8\ub2e4.(&lt;GuestbookClient isLogIn- &#8230; \/>)<br>Pass login information and posts from page.tsx to GuestbookClient.tsx. ()<\/p>\n\n\n\n<p>3)GuestbookClient.tsx\uc5d0\uc11c actions.ts\ud30c\uc77c\uc744 \ud638\ucd9c\ud558\uace0 \ub370\uc774\ud130\ub97c \ud45c\uc2dc(posts.map)\ud569\ub2c8\ub2e4.<br><code>GuestbookClient.tsx<\/code> calls the <code>actions.ts<\/code> file and displays the data (<code>posts.map<\/code>).<\/p>\n\n\n\n<p>4)\ub85c\uadf8\uc778\ud55c \uc0ac\uc6a9\uc790\uc758 \uc774\uba54\uc77c\uacfc \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc758 \uc774\uba54\uc77c\uc774 \uac19\uc73c\uba74 \uc0ad\uc81c\ubc84\ud2bc\uc744 \ub178\ucd9c\ud569\ub2c8\ub2e4.<br>If the logged-in user&#8217;s email matches the email in the database, the delete button is displayed.<\/p>\n\n\n\n<p>\u2714\ufe0f \uae00 \uc218\uc815 \ubc0f \uc0ad\uc81c<br>Edit or Delete Post<\/p>\n\n\n\n<p>&#8212; \uc2e4\uc81c\ub85c \uc11c\ubc84\uc561\uc158\uc744 \uc0ac\uc6a9\ud558\ub294 \ubd80\ubd84\uc785\ub2c8\ub2e4.<br>This is the part where Server Actions are actually used.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># GuestbookClient.tsx\n\n<strong>import { createPost, deletePost } from \".\/actions\"<\/strong>\n\n... ...\n\nexport default function GuestbookClient({\n  isLoggedIn,\n  userEmail,\n  posts\n}: {\n  isLoggedIn: boolean,\n  userEmail: string,\n  posts: GuestbookItem&#91;]\n}) {\n  const &#91;state, <strong>formAction<\/strong>, isPending] = useActionState(createPost, null)\n\n  return (\n    &lt;>\n      {isLoggedIn? (\n        &lt;form action={<strong>formAction<\/strong>} className=\"flex flex-col gap-2 my-6\">\n          &lt;input name=\"title\" placeholder=\"\uc81c\ubaa9\/Title\" className=\"border p-2 rounded\" required \/>\n          &lt;textarea name=\"content\" placeholder=\"\ub0b4\uc6a9\/Content\" className=\"border p-2 rounded\" required \/>\n          &lt;button disabled={isPending} type=\"submit\" className=\"bg-black text-white p-2 rounded\">\n            {<strong>isPending?<\/strong> '\uc800\uc7a5\uc911\/Submitting...' : '\ub4f1\ub85d\ud558\uae30\/Submit'}\n          &lt;\/button>\n        &lt;\/form>\n      ) : (\n        &lt;p className=\"my-6 text-gray-500\">\uae00\uc744 \uc4f0\ub824\uba74 \ub85c\uadf8\uc778\uc774 \ud544\uc694\ud574\uc694 \/ Login is required to write posts.&lt;\/p>\n      )}\n\n      ... ...\n\n            {post.author_email === userEmail &amp;&amp; (\n              &lt;button\n                onClick={async () => {\n                  if (!confirm(\"\uc0ad\uc81c\ud560\uae4c\uc694? \/ Are you sure you want to delete this post?\")) return;\n                  <strong>await deletePost(post.id)<\/strong>\n                }}\n                className=\"bg-red-500 text-white px-2 py-1 rounded text-xs ml-4 shrink-0\"\n              >\n                \uc0ad\uc81c\/Delete\n              &lt;\/button>\n            )}\n\n)\n}\n<\/code><\/pre>\n\n\n\n<p>1) form \ud0dc\uadf8\uc758 action\ubd80\ubd84\uc5d0 {formAction}\uc744 \uc0ac\uc6a9\ud574\uc11c \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud569\ub2c8\ub2e4.<br>Data is saved by using {formAction} in the action attribute of the form tag.<\/p>\n\n\n\n<p>2)deletePost\ud568\uc218\ub97c \ud638\ucd9c\ud574\uc11c \uae00\uc744 \uc0ad\uc81c\ud569\ub2c8\ub2e4.<br>Call the deletePost function to delete the post.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ud83d\udc49\ud83c\udffb \uae30\uc874 \ud504\ub85c\uc81d\ud2b8(myapp7)\uc5d0 \uc11c\ubc84\uc561\uc158 \ubc29\uc2dd\uc744 \ucd94\uac00\ud588\uc2b5\ub2c8\ub2e4.I added the Server Actions approach to the previous project (myapp7). \ud83d\udc49\ud83c\udffb \uc774\uc804 \ud3ec\uc2a4\ud2b8 \/ Previous post(myapp7) \ud83d\udcc1 \uc804\uccb4 \ud504\ub85c\uc81d\ud2b8 \uad6c\uc870 \/ Overall Project Structure(myapp8) \ud83d\udcc1 \ud504\ub85c\uc81d\ud2b8 \uc124\uce58(myapp8)Project Installation (myapp8) \ud83d\udcc1 sqlite3 \ubaa8\ub4c8 \uc124\uce58Install the sqlite3 module. \ud83d\udcc1 NextAuth \ubaa8\ub4c8 \uc124\uce58Install the NextAuth module. \ud83d\udcc1 \uc11c\ubc84\uc2e4\ud589 \/ Start Servr \ud83d\udcc1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27,1,7],"tags":[],"class_list":["post-7503","post","type-post","status-publish","format-standard","hentry","category-nextjs","category-uncategorized","category-website","missing-thumbnail"],"_links":{"self":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/7503","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=7503"}],"version-history":[{"count":75,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/7503\/revisions"}],"predecessor-version":[{"id":7593,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/7503\/revisions\/7593"}],"wp:attachment":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=7503"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=7503"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=7503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}