- A Next.js Guestbook app with Fauna backend using GraphQL, boilerplate code from Vercel
- Note: to open web links in a new window use: ctrl+click on link
![GitHub last commit](https://camo.githubusercontent.com/cc7242942588d82e2b4ac42804b9fc8f74f3c42342040ced397a342b886ff099/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f416e647265774a426174656d616e2f6e6578742d6661756e612d646174613f7374796c653d706c6173746963)
![Example screenshot](./imgs/db.png)
npm run dev
runs the app in the development mode. Open http://localhost:3000 to view it in the browser. Note: requires Fauna API key
npm run build
builds the app for production to the build
folder. Note: requests Fauna API key
npm run start
to run the built app.
๐ป Code Examples - taken from Vercel boilerplate code
lib/fauna.js
mutation function to create a new guestbook entry
export const createGuestbookEntry = (newEntry) => {
const mutation = gql`
mutation CreateGuestbookEntry($input: GuestbookEntryInput!) {
createGuestbookEntry(data: $input) {
_id
_ts
name
message
createdAt
}
}
`
return graphQLClient.request(mutation, { input: newEntry })
}
- Status: Working. Deployed to Vercel
- To-Do: Add extra fields and a user image/icon. Need Fauna API key to run dev. server