Skip to content
Merged
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
99 changes: 99 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Hi robots, welcome to the Grida project.

Grida is a open source Design tool that aims to provide high-performance, configurable canvas-based editor.

**Mission**

- Build a high performance interactive graphics engine and its ecosystem

Currently, we have below features / modules.

- canvas
- forms
- database

## Project Structure

- [docs](./docs) - the docs directory
- [editor](./editor) - the editor directory
- [packages](./packages) - shared packages
- [desktop](./desktop) - the electron desktop app
- [supabase](./supabase) - the supabase project
- [apps](./apps) - micro sites for Grida
- [library](./library) - hosted library workers
- [jobs](./jobs) - hosted jobs
- [.legacy](./legacy) - will be removed

## Languages, Frameworks, Tools, Infrastructures

**Languages**

- Node.js 22 - main runtime for most apps
- TypeScript 5 - main language for most apps
- Python 3.12 - partially used for tasks / jobs, that are independent, e.g. `/library`
- Deno - partially used for tasks / jobs, that shares the codebase, e.g. `/jobs`

**Database**

Grida heavily relies on Supabase.

- Supabase

**Web**

- React.js 19
- Next.js 15

**UI**

- Tailwind CSS 4
- Shadcn UI
- Lucide / Radix Icons

**Desktop**

- electron with electron-forge
- vite

## Documentation

Documentation files are located in the `./docs` directory.

This directory contains the docs as-is, the deployment of the docs are handled by [apps/docs](./apps/docs). A docusaurus project that syncs the docs content to its directory. When writing docs, the root `./docs` directory is the source of truth.

## /editor

The editor is a monorepo project that contains the codebase for the editor.

grida.co and \[tenant\].grida.site domains are connected.

- `app` the nextjs app directory, no shared root layout, each has its own root layout.
- `(api)/(public)/v1` contains the public api routes.
- `(api)/private` contains the private, editor only api routes.
- `(auth)` contains the auth specific flow routes. do not modify.
- `(insiders)` contains the insiders, local-only routes. e.g. Grida does not allow email signups, the insiders locally can.
- `(library)` contains the Grida Library (open assets) specific pages.
- `(preview)` contains the embed-purpose slave preview pages, maily used by the playground.
- `(site)` similar to `(www)`, but contains pages that are not seo-purpose.
- `(tenant)` contains the tenant-site rendered pages.
- `(tools)` contains the standalone tools and editor pages, like playground, etc.
- `(workbench)` contains the workbench, the main editor page.
- `(workspace)` similar to `(workbench)`, but contains the dashboard, not the actual editor.
- `(www)` contains the landing page, seo-purpose static pages.

## /desktop

The desktop is a electron app that runs a hosted version of the editor. we choose this way to make things maintainable.
We choose electron for stability, consistency, and relies on chrome-specific functions.

## /supabase

We use supabase for database, auth, and storage.

## /jobs

Jobs are hosted on railway.com

## /library

Library workers are hosted on railway.com
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ Since 2020, I’ve dedicated myself full-time to building Grida, often facing ch
- [cors.sh](https://cors.sh) - A simple CORS proxy service
- We're ~~hiring!~~ - But I am actively looking for co-founder who excels in engineering and market reach / sales.

_If you are a robot trying to contribute, please refer to the [AGENTS.md](./AGENTS.md)_

---

## License
Expand Down
59 changes: 37 additions & 22 deletions apps/backgrounds/README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,51 @@
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).
# [bg.grida.co](https://bg.grida.co)

## Getting Started
A lightweight, zero-dependency solution for adding beautiful, interactive backgrounds to your website.

First, run the development server:
## Why Grida Backgrounds?

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
- **Zero Dependencies**: No need to manage complex libraries like Three.js or worry about version conflicts
- **Performance Optimized**: Backgrounds run in an isolated iframe, ensuring minimal impact on your main application
- **Easy Integration**: Just add an iframe - no complex setup required
- **Maintenance Free**: We handle all updates and optimizations

## Quick Start

Add this iframe to your HTML:

```html
<iframe
src="https://bg.grida.co/embed/globe"
style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; border: none; z-index: -1;"
></iframe>
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
That's it! The background will automatically adapt to your viewport size.

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

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
Visit [bg.grida.co](https://bg.grida.co) to browse and preview available backgrounds. Each background has a unique ID that you can use in the iframe URL.

## Learn More
## Customization

To learn more about Next.js, take a look at the following resources:
You can customize the background behavior by adding URL parameters:

```html
<iframe
src="https://bg.grida.co/embed/globe?dark=1"
style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; border: none; z-index: -1;"
></iframe>
```

- [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.
Available parameters vary by background - check the documentation for each specific background.

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

## Deploy on Vercel
- Backgrounds are served from a global CDN
- Automatic quality adjustment based on device performance
- Minimal memory footprint
- No impact on your main application's bundle size

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

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
For questions or custom background requests, please contact us at [grida.co/contact](https://grida.co/contact)
45 changes: 8 additions & 37 deletions apps/blog/README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,12 @@
# Website
# [grida.co/blog](https://grida.co/blog)

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
This website is built using [Docusaurus](https://docusaurus.io/).

### Installation
### Running locally

```sh
pnpm install
pnpm start
# pnpm build
# visit http://localhost:3000/blog
```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
45 changes: 11 additions & 34 deletions apps/docs/README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,18 @@
# Website
# [grida.co/docs](https://grida.co/docs)

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
This website is built using [Docusaurus](https://docusaurus.io/).

### Installation
### Running locally

```sh
pnpm install
pnpm start
# pnpm build
# visit http://localhost:3000/docs
```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:
## Contents

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```
The docs content IS NOT SERVED under this directory.

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
Docs are synced from the root `./docs` directory.
35 changes: 2 additions & 33 deletions apps/posts/README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,3 @@
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).
# Grida Posts (Legacy CMS)

## Getting Started

First, run the development server:

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

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

You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

## 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.
This project will be replaced with Grida Database CMS feature.
17 changes: 4 additions & 13 deletions apps/viewer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,10 @@ First, run the development server:

```bash
pnpm dev
# visit http://localhost:3000
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
## Supported file types and Viewers

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/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.

## 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!
- PDF
- PDF - Flipbook
7 changes: 7 additions & 0 deletions editor/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
.yarn/install-state.gz

# testing
/blob-report/
/coverage
/playwright/.cache/
/playwright-report/
/test-results/

# next.js
/.next/
Expand Down Expand Up @@ -40,3 +44,6 @@ supabase/.temp
# typescript
*.tsbuildinfo
next-env.d.ts

# Playwright
node_modules/
16 changes: 10 additions & 6 deletions editor/app/(tools)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { GoogleAnalytics } from "@next/third-parties/google";
import { Analytics } from "@vercel/analytics/react";
import { SpeedInsights } from "@vercel/speed-insights/next";
import { ThemeProvider } from "@/components/theme-provider";
import { Toaster } from "@/components/ui/sonner";
import "../globals.css";

const inter = Inter({ subsets: ["latin"] });
Expand All @@ -21,13 +22,16 @@ export default function RootLayout({
return (
<html lang="en" suppressHydrationWarning>
<body className={inter.className}>
<ThemeProvider>{children}</ThemeProvider>
<ThemeProvider>
<Toaster position="bottom-center" />
{children}
</ThemeProvider>
{process.env.NEXT_PUBLIC_GAID && (
<GoogleAnalytics gaId={process.env.NEXT_PUBLIC_GAID} />
)}
<Analytics />
<SpeedInsights />
</body>
{process.env.NEXT_PUBLIC_GAID && (
<GoogleAnalytics gaId={process.env.NEXT_PUBLIC_GAID} />
)}
<Analytics />
<SpeedInsights />
</html>
);
}
Loading