Git Product home page Git Product logo

next13-pocketbase-demo's Introduction

Next 13 Demo

Build a basic note-taking app with Next.js 13 and Pocketbase.

Setup

  1. Create a new Next.js app: npx create-next-app@latest --ts

  2. Download Pocketbase from pocketbase.io

  3. Navigate to the unzipped directory cd pocketbase_0.7.9_darwin_arm64

  4. Start Pocketbase: ./pocketbase serve

  5. Open the Admin UI, create collection, and update security rules to allow read/write access.

  6. Add experimental: { appDir: true } to next.config.js

next13-pocketbase-demo's People

Contributors

codediodeio avatar klutchdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

next13-pocketbase-demo's Issues

Authentication

Is there anybody out there who has solved the authentication and route protection problems, and actually share an example code?

Won't the "use client" inside CreateNote expose the pocketbase endpoint to the client/public

Hello Jeff!

Thank you for all the hard work you have put in your videos. They are my go to for leasure and to learn something new.

IN your latest one: https://www.youtube.com/watch?v=__mSgDEOyv8

I noticed that when you create a note you make a fetch request from the client, I am correct to assume this URL will be exposed to the public?

Link to the line:
https://github.com/fireship-io/next13-pocketbase-demo/blob/main/app/notes/CreateNote.tsx#L20

Thanks again to Jeff (and to all the people more smarter then me).

Does not work in Firefox

In Firefox, when creating a new note the site crashes and an unhanded network fetch error is displayed for a split second.
Tested same instance in edge and chrome witch both worked fine.

./Notes.module.css not found

Having issues with routing in the ./Notes.module.css and the ./CreateNote routes in the notes/page.tsx. It is not able to find the file. If I change the route on the createNote I am able to get it to work. Cannot resolve the ./Notes.module.css error.

./Create does not exist

Problem

When trying to run this codebase upon reaching the notes directory I am confronted by an error stating that it was unable to resolve relate "./Create". It is possible that this is a NEXT 13 issue as it is so new but I'm not so sure

Error

error - [resolve] [project-with-next]/app/notes/page.tsx  Error resolving esm request
  unable to resolve relative "./Create"
  
  | It was not possible to find the requested file.
  | Parsed request as written in source code: relative "./Create"
  | Path where resolving has started: [project-with-next]/app/notes/page.tsx
  | Type of request: esm request

Prefetch error for dynamic route

I'm seeing an issue at this point in the tutorial:

function Note({ note }: any) {
  const { id, title, content, created } = note || {};

  return (
    **<Link href={`/notes/${id}`}>**
      <div className={styles.note}>
        <h2>{title}</h2>
        <h5>{content}</h5>
        <p>{created}</p>
      </div>
    </Link>
  );
}

When I change it to "/" or "/notes" it works fine, but when I try to do this I get the following error:

PREFETCH ERROR Error: Functions cannot be passed directly to Client Components because they're not serializable.

Does anyone know how to handle this error? I have been researching this for the past few hours but no luck so far.. thanks.

loading and error fails to work

The folloing
error.tsx and loading.tsx fails and gives the following error

Unhandled Runtime Error
1 of 1
Error: Functions cannot be passed directly to Client Components because they're not serializable.
<... parallelRouterKey=... segmentPath=... error={function} errorStyles=... loading=... loadingStyles=... hasLoading=... template=... templateStyles=... notFound=... notFoundStyles=... childProp=... rootLayoutIncluded=...>
^^^^^^^^^^

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.