Code Monkey home page Code Monkey logo

omelette's Introduction


🍳 Omelette

Omelette is an opinionated recipe that demonstrates how to build a fast dynamic website/application. It was created as a foundation for a real-world ecommerce website and jump-starts you with:

  • A flexible architecture suitable for production websites.
  • Hand-picked tools and libraries for painless development.
  • A cost-effective and scalable preset deployment platform.

Core Ingredients

  • 🍯 β€” brillout/vite-plugin-ssr β€”Β The binding agent that makes everything stick!
  • πŸ₯˜ β€” vitejs/vite β€”Β The base that gives the recipe its delicious flavor.
  • 🍫 β€” vuejs/core β€” The sweetener that makes the recipe so good.
  • πŸ‡ β€” unocss/unocss β€” The garnish for decorating the recipe.
  • 🍽 β€” Cloudflare Workers β€”Β The dish for serving the recipe.

For a less silly deep dive into the reasoning behind why these ingredients were chosen over potential alternatives, see the chemistry section below. The section also explains some of the recipe's custom features.


πŸ“™ Table of Contents


🐣 Getting Started

  1. Clone this repository.

    $ git clone https://github.com/AaronBeaudoin/omelette
    
  2. Install project dependencies.

    $ npm install
    
  3. Run the development setup.

    $ npm run dev
    
  4. Explore the project and make it your own! ✨


πŸš€ Deployment

  1. Create a Cloudflare account here if you don't already have one. After doing so, make sure to go to the Workers page in the dashboard and complete the setup steps.

  2. Login to Wrangler, the CLI for working with Cloudflare Workers.

    $ npx wrangler login
    
  3. Create a Workers KV namespace for production and another one for preview.

    $ npx wrangler kv:namespace create PRODUCTION
    $ npx wrangler kv:namespace create PREVIEW
    
  4. Bind the namespaces to FUNCTIONS in your worker environment. To do this, replace id under [[kv_namespaces]] in your wrangler.toml config with the ID of the PRODUCTION namespace you just created and replace preview_id with the ID of the PREVIEW namespace.

    [[kv_namespaces]]
    id = "<your-production-namespace-id-here>"
    preview_id = "<your-preview-namespace-id-here>"
    binding = "FUNCTIONS"

    The ID for each namespace should be in the terminal output under each command from the last step. If you can't find them, you can easily get them again via another command.

    $ npx wrangler kv:namespace list
    
  5. Update the name of your worker in your wrangler.toml config to whatever you want.

  6. Create a Workers Secret named SECRET to enable function ?preview= and ?refresh=.

    $ npx wrangler secret put SECRET
    
  7. Preview your build output before actually deploying, if you want.

    $ npm run preview
    
  8. Deploy your project and sit back and relax! Watch a movie. Whatever you want! 🍹

    $ npm run deploy
    

Deploy on Push β€” Optional

  1. Create an API token in your Cloudflare account here. If you're not sure exactly what permissions you want, just use the Edit Cloudflare Workers template.

  2. Copy the token into a GitHub Secret called CLOUDFLARE_API_TOKEN under your repository.

  3. Copy your account ID into a GitHub Secret called CLOUDFLARE_ACCOUNT_ID under your repository. You can find your Cloudflare account ID on the right hand side of the Workers page in the dashboard.

  4. Push a new commit! From now on, pushing to the main branch of your repository should use the .github/workflows/deploy.yaml GitHub Action to deploy your project automatically!


πŸ₯Ό The Chemistry

This section is a work in progress.

omelette's People

Contributors

aaronbeaudoin avatar

Watchers

 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.