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.
- π― β
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.
- Getting Started
Start exploring Omelette for yourself! - Deployment
Learn how to deploy an Omelette project. - The Chemistry
Learn why each ingredient was chosen.
-
Clone this repository.
$ git clone https://github.com/AaronBeaudoin/omelette -
Install project dependencies.
$ npm install -
Run the development setup.
$ npm run dev -
Explore the project and make it your own! β¨
-
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.
-
Login to Wrangler, the CLI for working with Cloudflare Workers.
$ npx wrangler login -
Create a Workers KV namespace for production and another one for preview.
$ npx wrangler kv:namespace create PRODUCTION $ npx wrangler kv:namespace create PREVIEW -
Bind the namespaces to
FUNCTIONSin your worker environment. To do this, replaceidunder[[kv_namespaces]]in yourwrangler.tomlconfig with the ID of thePRODUCTIONnamespace you just created and replacepreview_idwith the ID of thePREVIEWnamespace.[[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 -
Update the name of your worker in your
wrangler.tomlconfig to whatever you want. -
Create a Workers Secret named
SECRETto enable function?preview=and?refresh=.$ npx wrangler secret put SECRET -
Preview your build output before actually deploying, if you want.
$ npm run preview -
Deploy your project and sit back and relax! Watch a movie. Whatever you want! πΉ
$ npm run deploy
-
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.
-
Copy the token into a GitHub Secret called
CLOUDFLARE_API_TOKENunder your repository. -
Copy your account ID into a GitHub Secret called
CLOUDFLARE_ACCOUNT_IDunder your repository. You can find your Cloudflare account ID on the right hand side of the Workers page in the dashboard. -
Push a new commit! From now on, pushing to the
mainbranch of your repository should use the.github/workflows/deploy.yamlGitHub Action to deploy your project automatically!
This section is a work in progress.