https://github.com/atinux/coffee-or-tea
Demo of Nuxt with Edge-Side Rendering on CloudFlare Pages.
https://github.com/atinux/coffee-or-tea
d1 drizzle-orm edge-side-rendering nuxt sqlite
Last synced: 8 months ago
JSON representation
Demo of Nuxt with Edge-Side Rendering on CloudFlare Pages.
- Host: GitHub
- URL: https://github.com/atinux/coffee-or-tea
- Owner: atinux
- Created: 2023-05-12T07:41:51.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-20T16:01:59.000Z (over 2 years ago)
- Last Synced: 2025-02-28T23:25:33.110Z (8 months ago)
- Topics: d1, drizzle-orm, edge-side-rendering, nuxt, sqlite
- Language: Vue
- Homepage: https://vue-london.pages.dev
- Size: 676 KB
- Stars: 25
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Coffee or Tea?
A demo applicatio using Nuxt with edge-side rendering on CloudFlare Pages with D1 as database.
Currently based on [nuxt-space-layer](https://www.npmjs.com/package/nuxt-space-layer) to make it easier to get started with CloudFlare Pages & D1.
Demo is on https://coffee-or-tea.pages.dev
[](https://coffee-or-tea.pages.dev)
## Setup
Make sure to install the dependencies:
```bash
# pnpm
pnpm install
```
Copy the `.env.example` to `.env` and fill the env variables, `NUXT_SESSION_PASSWORD` is a random string of at least 32 characters.
Create a [GitHub OAuth app](https://github.com/settings/applications/new) and add the client id and secret to the `.env` file, homepage and callback url can be set to `http://localhost:3000`.
## Development Server
Start the development server on `http://localhost:3000`
```bash
pnpm dev
```
## Production
Build the application for production:
```bash
pnpm build
```
Locally preview production build:
```bash
pnpm preview
```
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
## Deploy on CloudFlare Pages
Make sure to create a GitHub OAuth application for your production deployment.
Once you linked your GitHub/GitLab repository, add the following env variable:
```bash
NODE_VERSION=18
NUXT_SESSION_PASSWORD=your-secret-password-of-at-least-32-chars
NUXT_OAUTH_GITHUB_CLIENT_ID=your-github-oauth-client-id
NUXT_OAUTH_GITHUB_CLIENT_SECRET=your-github-oauth-client-secret
```
Make sure to create a D1 database use the SQL console of it to add your migrations from the `server/db/migrations` folder.
Link your D1 database with the `D1_DB` variable name to your CF Pages project (Settings -> Functions -> D1 database bindings). You may have to retry the latest deployment to make sure the binding is active.
## License
MIT