Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple and Clean #7

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

40 changes: 0 additions & 40 deletions .gitignore

This file was deleted.

201 changes: 0 additions & 201 deletions LICENSE.md

This file was deleted.

52 changes: 27 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
# Rill embedding example
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).

[![Netlify Status](https://api.netlify.com/api/v1/badges/fb82df0c-351e-4b2b-9e7c-30ff5418ff79/deploy-status)](https://app.netlify.com/sites/rill-embedding-example/deploys)
## Getting Started

This is a basic [Next.js](https://nextjs.org/) project that embeds a Rill dashboard. It embeds the [demo/rill-openrtb-prog-ads/bids](https://ui.rilldata.com/demo/rill-openrtb-prog-ads/bids) dashboard and is deployed using Netlify to [rill-embedding-example.netlify.app](https://rill-embedding-example.netlify.app/).
First, run the development server:

See the [Embed Dashboards](https://docs.rilldata.com/integration/embedding) docs page for more details.

## Developing

First, create a Rill service token:
```bash
rill service create rill-embedding-token
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Second, write it to a `.env` file (which is gitignored):
```bash
cat "RILL_SERVICE_TOKEN=<INSERT TOKEN>" > .env
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

Third, update the `rillOrg`, `rillProject`, and `rillDashboard` variables in `pages/api/iframe.js` to reflect the dashboard you want to embed:
```js
const rillOrg = "demo";
const rillProject = "rill-openrtb-prog-ads";
const rillDashboard = "bids";
```
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

Lastly, run the development server:
```bash
npm install
npm run dev
```
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.

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
## 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/app/building-your-application/deploying) for more details.
16 changes: 16 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { dirname } from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname,
});

const eslintConfig = [
...compat.extends("next/core-web-vitals", "next/typescript"),
];

export default eslintConfig;
8 changes: 0 additions & 8 deletions jsconfig.json

This file was deleted.

3 changes: 0 additions & 3 deletions netlify.toml

This file was deleted.

5 changes: 5 additions & 0 deletions 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/app/api-reference/config/typescript for more information.
Loading