GithubHelp home page GithubHelp logo

brightonmboya / app-turso-next Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 73 KB

A demo showing how to integrate Turso DB In a next App.

Home Page: https://app-turso-next.vercel.app

License: MIT License

JavaScript 22.61% TypeScript 74.29% CSS 3.10%

app-turso-next's Introduction

Hi ๐Ÿ‘‹, I'm Brighton

GIF



I Build Stuff on the web.

Brighton Mboya

  • ๐ŸŒฑ Currently pursuing web-engineering
  • ๐Ÿฅ… 2023 Goals: Healthy, and more importantly Happy.
  • โšก Fun fact: I love jamming on piano, yes I do !!

Brighton Mboya's streak

Brighton's GitHub stats
Top Langs

Skills ย 

I am an expert on using the t3stack NextJS, Tailwind, Prisma, tRPC and TypeScript to build web-apps

Currently experimenting with subtle animations and threeJS experiences

Connect with me

BrightonMboya BrightonMboya https://www.linkedin.com/in/brighton-mboya-52b455158/

app-turso-next's People

Contributors

brightonmboya avatar

Stargazers

 avatar  avatar

Watchers

 avatar

app-turso-next's Issues

Suggestions for inclusion on turso-extended

  1. Instead of showing the CLI installation instructions, link to the documentation in case they ever change? We're going to apply the same change to our other repos.

  2. Put the instructions to create tables right after the shell command. That's what you'd probably want people to do right away after starting the shell.

  3. Prefer to use npm over pnpm since the former is always present.

  4. Add an instruction to install node modules before running the dev script (otherwise it will fail).

  5. When I ran the dev script, it failed with:

    โŒ Invalid environment variables:
     url: Required
     authToken: Required
    
    error - Failed to load next.config.mjs, see more info here https://nextjs.org/docs/messages/next-config-error
    Error: Invalid environment variables
        at file:///Users/doug/work/chiselstrike/codingdoug/app-turso-next/src/env/server.mjs:16:9
        at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
    

    So, for the env vars, point out specifically which file needs to be modified to include the db url and auth token. I wasn't familiar with nextjs at all, so I had to go look up how this works. Perhaps you could instruct the user to first copy the .env.sample file to .env.local and provide the required values in it.

  6. The newest version of the CLI actually creates token with no expiration by default, so you can remove the --expiration flag if you want. But if you want to leave it on, the new proper value is never (none still works but is likely going to be deprecated).

  7. pages/index.ts shows a lint error

    Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator.eslint@typescript-eslint/no-floating-promises

    Also, I'm thinking API calls like this should also be in a react hook rather than right there in the component. What do you think? Try a web search for "react hook make api calls" for guidance from the internet.

  8. I see you copied James's responseDataAdapter. This function is no longer needed at all because the client ResultSet now allow Row objects to be indexed by both column name and number. See the documentation for example code and details. We'll be removing it from other examples as well.

  9. Update @libsql/client to the latest version 0.1.4. There might be breakage in future versions of the SDK, so we might reach out to you again to update it in order to keep this code relevant going forward.

  10. The LICENSE file should be at the root of the repo, not under src.

Optional but I think very helpful for others (fix or disable the lint rules that are causing them):

  1. src/db/turso.ts shows a lint warning:

    Unexpected default export of anonymous functioneslintimport/no-anonymous-default-export
    Maybe find a way to remove that by naming the export and import it by name?

  2. pages/api/turso.ts shows a bunch of lint errors about the use of any. Strict checking turns these checks on because use of any has been shown to lead to bugs due to lack of proper type information.
  3. next.config.mjs: In the first line env is unused and can be removed. This perhaps means that src/env/server.mjs is also unnecessary?

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.