Coder Social home page Coder Social logo

cloudflare-d1-drizzle-honox-starter's Introduction

cloudflare-d1-drizzle-honox-starter

A starter project showing how you can integrate Drizzle ORM and Cloudflare D1 with a HonoX application to build awesome full-stack apps.

Tip

If the above paragraph was a bunch of buzzwords that seem confusing, here's the simple version:

  • HonoX is a full-stack framework combining backend API endpoints with the ability to render frontend applications with React
  • Cloudflare D1 is a SQL database
  • Drizzle ORM provides an ORM wrapper around D1, to allow data models and querying using a straightforward syntax

Installation

0. Clone the template and install all dependencies

git clone [email protected]:yusukebe/cloudflare-d1-drizzle-honox-starter.git starter
cd starter
npm install

1. Create a new D1 database using Wrangler

npx wrangler@latest d1 create d1-todo

Note that if you haven't yet used Wrangler, you will be prompted to login to Cloudflare.

Copy the output of this command, which is structured TOML configuration, into your wrangler.toml.

2. Create a new migration file

npm run migration:generate

3. Apply the migration to your local database

npm run migration:apply:local

4. When you're ready, deploy your application

npm run deploy

5. Once you've deployed your application, you can apply the migrations to your remote (production) D1 database

npm run migration:apply:remote

Prisma Version

You can see the starter using Prisma instead of Drizzle ORM:

Author

Yusuke Wada https://github.com/yusukebe

License

MIT

cloudflare-d1-drizzle-honox-starter's People

Contributors

yusukebe 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

Watchers

 avatar  avatar

cloudflare-d1-drizzle-honox-starter's Issues

Not accessible in development mode

pnpm run dev

> sendx@ dev /Users/doit/sendx
> vite

Proxy environment variables detected. We'll use your proxy for fetch requests.
(!) Could not auto-determine entry point from rollupOptions or html files and there are no explicit optimizeDeps.include patterns. Skipping dependency pre-bundling.

  VITE v5.2.10  ready in 1623 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
Sourcemap for "/Users/guanwei/i/doit/sendx/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/drizzle-zod/index.mjs" points to missing source files
POST  /
GET   /
POST  /todos/clear_completed
POST  /todos/:id/toggle

Deploy or package preview locally, all access is normal

http://localhost:5173/ There has been no response to web visits

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.