Coder Social home page Coder Social logo

vienpt / coffee-or-tea Goto Github PK

View Code? Open in Web Editor NEW

This project forked from atinux/coffee-or-tea

0.0 0.0 0.0 692 KB

Demo of Nuxt with Edge-Side Rendering on CloudFlare Pages.

Home Page: https://vue-london.pages.dev

TypeScript 40.33% Vue 59.67%

coffee-or-tea's Introduction

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 to make it easier to get started with CloudFlare Pages & D1.

Demo is on https://coffee-or-tea.pages.dev

demo-screenshot

Setup

Make sure to install the dependencies:

# 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 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

pnpm dev

Production

Build the application for production:

pnpm build

Locally preview production build:

pnpm preview

Check out the deployment documentation 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:

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

coffee-or-tea's People

Contributors

atinux avatar

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.