npx create-next-app@latest ./
for the database, its a severless grapql platform, that enables us to ship high performance applications faster
to initialize the new grafbase project npx init --config-format typescript
this will create the grafbase config file
in there we can create a schema for the user model
then import our git repo to the grafbase(create project), it will generate the api endpoint and the api key.
as soon as we connect our repository to the grafbase, we can query our objs/model with all the generated CRUD operation (graph ql) for us.
to spin up the local grafbase server npx [email protected] dev
http://localhost:4000/graphql`
in the path finder we can see all our objs(in the schema) we can select em and create the query and copy and use in the actions (for the CRUD operations)
Note : as per the next 13 doc, any client side functionality such as onClick() we need to convert this into a client comp and then use it in the server side comp (such as NavBar)
this is gon be a special page in next js, we can create inside the app/create-project/page.tsx/ -> because nextjs is doing a file page routing called create-project
it doesn't really need any routing.
npm i @headlessui/react
for the combo box and the drop down elems
npm i cloudinary
for the image upload
npm i jsonwebtoken @types/jsonwebtoken graphql-request next-auth
for the auth and the graphql req/.
to create a next auth secret the recommended way is to use the openssl rand -base64 32
we can grab and use this secret.
for the next auth to fetch the providers, we ve to initialize the new route handler by configuring the "/app/api/auth/[...next-auth]/route.ts/" file
and the tokens (or the bearer to send with the req header) in order to access the db, the next auth exposes the REST endpoint/API ie used by nextauth js client, and the default endpoint is "api/auth/token" , we dont ve to create this, not fully still we ve to create some endpts
npm i @grafbase/sdk --save dev
this sdk will speed up our workflow with the grafbase..