https://github.com/dodycode/remix-nextui-cloudflare
Remix + Vite + Next UI + Cloudflare starter template.
https://github.com/dodycode/remix-nextui-cloudflare
Last synced: about 1 year ago
JSON representation
Remix + Vite + Next UI + Cloudflare starter template.
- Host: GitHub
- URL: https://github.com/dodycode/remix-nextui-cloudflare
- Owner: dodycode
- Created: 2024-03-09T09:59:27.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-07-15T01:35:33.000Z (almost 2 years ago)
- Last Synced: 2024-07-15T02:42:37.601Z (almost 2 years ago)
- Language: TypeScript
- Homepage: https://remix-nextui-cloudflare.pages.dev/
- Size: 237 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Welcome to Remix + Vite + NextUI + Cloudflare
📖 See the [Remix docs](https://remix.run/docs) and the [Remix Vite docs](https://remix.run/docs/en/main/future/vite) for details on supported features.
## Getting Started
```shellscript
npx create-remix@latest --template https://github.com/dodycode/remix-nextui-cloudflare
```
## Built in theme switcher

# Hooks
This template comes with a few hooks to help you get started.
# API Wrapper
This template has a built in API wrapper that you can use to fetch data from your API in your loader functions or actions.
```js
import apiClient from "~/utils/api";
export const loader = async ({ request }) => {
const data = await apiClient.get("/api/data");
return json(data);
};
```
## Typegen
Generate types for your Cloudflare bindings in `wrangler.toml`:
```sh
npm run typegen
```
You will need to rerun typegen whenever you make changes to `wrangler.toml`.
## Development
Run the Vite dev server:
```sh
npm run dev
```
To run Wrangler:
```sh
npm run build
npm run start
```
## Deployment
> [!WARNING]
> Cloudflare does _not_ use `wrangler.toml` to configure deployment bindings.
> You **MUST** [configure deployment bindings manually in the Cloudflare dashboard][bindings].
First, build your app for production:
```sh
npm run build
```
Then, deploy your app to Cloudflare Pages:
```sh
npm run deploy
```
[bindings]: https://developers.cloudflare.com/pages/functions/bindings/