Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ npx nx eslint @hatchifyjs/koa
.
├── CONTRIBUTING.md # This file
├── README.md # Getting started guide, currently in https://bitovi.atlassian.net/l/cp/BAsHxXaC
├── example # An example app created by following the guide above and used by Playwright
├── examples # An examples app created by following the guide above and used by Playwright
│ ├── hatchify-app
│ │ ├── backend
│ │ │ └── index.ts
Expand Down
8 changes: 4 additions & 4 deletions docs/code-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ We provide a few code examples for you to learn or use a start project:

## Examples

### [Getting Started](../example/getting-started/) ([StackBlitz](https://stackblitz.com/fork/github/bitovi/hatchify/tree/main/example/getting-started?file=schemas.ts&terminal=dev))
### [Getting Started](../examples/getting-started/) ([StackBlitz](https://stackblitz.com/fork/github/bitovi/hatchify/tree/main/example/getting-started?file=schemas.ts&terminal=dev))

The end result of following the Getting Started example in the [main readme](../README.md).

### [Grid Demo](../example/grid-demo/) ([StackBlitz](https://stackblitz.com/fork/github/bitovi/hatchify/tree/main/example/grid-demo?file=schemas.ts&terminal=dev))
### [Grid Demo](../examples/grid-demo/) ([StackBlitz](https://stackblitz.com/fork/github/bitovi/hatchify/tree/main/example/grid-demo?file=schemas.ts&terminal=dev))

A different example with documents, users and customized fields. Deployed via a [workflow](../.github/workflows/push.yml) to AWS EC2 with:

Expand All @@ -17,10 +17,10 @@ A different example with documents, users and customized fields. Deployed via a
- [Express + SQLite](https://hatchify-grid-demo.bitovi-sandbox.com:3002/)
- [Express + Postgres](https://hatchify-grid-demo.bitovi-sandbox.com:3003/)

### [React Rest](../example/react-rest/) ([StackBlitz](https://stackblitz.com/fork/github/bitovi/hatchify/tree/main/example/react-rest?file=src/App.tsx&terminal=dev))
### [React Rest](../examples/react-rest/) ([StackBlitz](https://stackblitz.com/fork/github/bitovi/hatchify/tree/main/example/react-rest?file=src/App.tsx&terminal=dev))

An example of [React Rest](../packages/react-rest/README.md) where you plug your own backend at `/api`.

### [React Rest Hatchify Backend](../example/react-rest-hatchify-backend/) ([StackBlitz](https://stackblitz.com/fork/github/bitovi/hatchify/tree/main/example/react-rest-hatchify-backend?file=schemas.ts&terminal=dev))
### [React Rest Hatchify Backend](../examples/react-rest-hatchify-backend/) ([StackBlitz](https://stackblitz.com/fork/github/bitovi/hatchify/tree/main/example/react-rest-hatchify-backend?file=schemas.ts&terminal=dev))

An example of [React Rest](../packages/react-rest/README.md) with a [Hatchify backend](../packages/koa/README.md).
4 changes: 2 additions & 2 deletions e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default defineConfig({
port: 3000,
},
{
command: "cd ../example/react-rest && npm install && npm run dev",
command: "cd ../examples/react-rest && npm install && npm run dev",
reuseExistingServer: !process.env.CI,
port: 5174,
},
Expand All @@ -92,7 +92,7 @@ export default defineConfig({
},
{
command:
"cd ../example/grid-demo && npm install && APP_PORT=3001 npm run dev:koa:sqlite",
"cd ../examples/grid-demo && npm install && APP_PORT=3001 npm run dev:koa:sqlite",
reuseExistingServer: !process.env.CI,
port: 3001,
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions examples/nextjs/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
36 changes: 36 additions & 0 deletions examples/nextjs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
36 changes: 36 additions & 0 deletions examples/nextjs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
5 changes: 5 additions & 0 deletions examples/nextjs/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
4 changes: 4 additions & 0 deletions examples/nextjs/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};

export default nextConfig;
32 changes: 32 additions & 0 deletions examples/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "nextjs",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.0",
"@hatchifyjs/react": "^0.1.61",
"@mui/material": "^5.15.12",
"@hatchifyjs/core": "^0.3.22",
"@hatchifyjs/koa": "^1.3.57",
"next": "14.1.4",
"react": "^18",
"react-dom": "^18",
"sequelize": "^6.37.2",
"sqlite3": "^5.1.7"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "14.1.4",
"typescript": "^5"
}
}
Binary file added examples/nextjs/src/app/favicon.ico
Binary file not shown.
107 changes: 107 additions & 0 deletions examples/nextjs/src/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
:root {
--max-width: 1100px;
--border-radius: 12px;
--font-mono: ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono",
"Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro",
"Fira Mono", "Droid Sans Mono", "Courier New", monospace;

--foreground-rgb: 0, 0, 0;
--background-start-rgb: 214, 219, 220;
--background-end-rgb: 255, 255, 255;

--primary-glow: conic-gradient(
from 180deg at 50% 50%,
#16abff33 0deg,
#0885ff33 55deg,
#54d6ff33 120deg,
#0071ff33 160deg,
transparent 360deg
);
--secondary-glow: radial-gradient(
rgba(255, 255, 255, 1),
rgba(255, 255, 255, 0)
);

--tile-start-rgb: 239, 245, 249;
--tile-end-rgb: 228, 232, 233;
--tile-border: conic-gradient(
#00000080,
#00000040,
#00000030,
#00000020,
#00000010,
#00000010,
#00000080
);

--callout-rgb: 238, 240, 241;
--callout-border-rgb: 172, 175, 176;
--card-rgb: 180, 185, 188;
--card-border-rgb: 131, 134, 135;
}

@media (prefers-color-scheme: dark) {
:root {
--foreground-rgb: 255, 255, 255;
--background-start-rgb: 0, 0, 0;
--background-end-rgb: 0, 0, 0;

--primary-glow: radial-gradient(rgba(1, 65, 255, 0.4), rgba(1, 65, 255, 0));
--secondary-glow: linear-gradient(
to bottom right,
rgba(1, 65, 255, 0),
rgba(1, 65, 255, 0),
rgba(1, 65, 255, 0.3)
);

--tile-start-rgb: 2, 13, 46;
--tile-end-rgb: 2, 5, 19;
--tile-border: conic-gradient(
#ffffff80,
#ffffff40,
#ffffff30,
#ffffff20,
#ffffff10,
#ffffff10,
#ffffff80
);

--callout-rgb: 20, 20, 20;
--callout-border-rgb: 108, 108, 108;
--card-rgb: 100, 100, 100;
--card-border-rgb: 200, 200, 200;
}
}

* {
box-sizing: border-box;
padding: 0;
margin: 0;
}

html,
body {
max-width: 100vw;
overflow-x: hidden;
}

body {
color: rgb(var(--foreground-rgb));
background: linear-gradient(
to bottom,
transparent,
rgb(var(--background-end-rgb))
)
rgb(var(--background-start-rgb));
}

a {
color: inherit;
text-decoration: none;
}

@media (prefers-color-scheme: dark) {
html {
color-scheme: dark;
}
}
19 changes: 19 additions & 0 deletions examples/nextjs/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { Metadata } from "next"
import "./globals.css"

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
}

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode
}>): React.ReactElement {
return (
<html lang="en">
<body>{children}</body>
</html>
)
}
Loading