### Getting Started with AT Protocol Source: https://atproto.com/ Guides for creating an application and setting up your personal data server. ```APIDOC ## Getting Started ### Quick start Create an application and start building on the AT Protocol. [Read more](/guides/applications) ### Self-host Learn how to set up your own personal data server (PDS). [Read more](/guides/self-hosting) ### Glossary Definitions for all the terminology used in AT Protocol. [Read more](/guides/glossary) ### FAQ Frequently Asked Questions about the AT Protocol. [Read more](/guides/faq) ``` -------------------------------- ### Project Setup and Dependencies Source: https://github.com/openai/chatgpt-retrieval-plugin Instructions on how to install Poetry and set up a virtual environment for the project. It also covers installing application dependencies. ```APIDOC ## Project Setup and Dependencies ### Description This section details the steps required to set up the project environment, including installing Poetry, creating a Python 3.10 virtual environment, and installing project dependencies. ### Installation 1. **Install Poetry:** ```bash pip install poetry ``` 2. **Create and Activate Virtual Environment:** ```bash poetry env use python3.10 poetry shell ``` 3. **Install Dependencies:** ```bash poetry install ``` ### Notes If you add new dependencies to `pyproject.toml`, ensure you run `poetry lock` followed by `poetry install`. ``` -------------------------------- ### Opencast Setup - Prerequisites Source: https://github.com/stephancill/opencast Lists the prerequisites for running the Opencast project. It requires Docker for setup and mentions cloning the repository as the first step in the installation process. ```markdown Prerequisites Docker Clone the repo ``` -------------------------------- ### Hono Basic Example Source: https://hono.dev/ A simple 'Hello World' example using Hono. It demonstrates how to create a Hono application and define a basic GET route. ```javascript import { Hono } from 'hono' const app = new Hono() app.get('/', (c) => c.text('Hello Hono!')) export default app ``` -------------------------------- ### Install Dependencies and Run Litecast Web Source: https://github.com/dylsteck/litecast-web Instructions for setting up and running the litecast-web project locally. This involves installing Node.js dependencies, configuring environment variables with Neynar API keys, and starting the development server. ```bash npm install cp .env.example .env.local # Add your Neynar keys to .env.local npm run dev ``` -------------------------------- ### Run Locally (npm) Source: https://github.com/farhackxyz/farhack Starts the development server for the FarHack project. Requires dependencies to be installed first. ```bash npm dev ``` -------------------------------- ### Run Next.js Project Locally Source: https://vercel.com/blog/understanding-react-server-components-57brjqQf27QFQaFFm27gZ9 Instructions to install dependencies and start the Next.js development server. ```bash yarn yarn dev ``` -------------------------------- ### Dockerfile for Project Setup Source: https://github.com/openai/chatgpt-retrieval-plugin This Dockerfile outlines the steps to build a Docker image for the project. It specifies the base image, copies project files, installs dependencies using Poetry, and sets up the command to run the application. ```dockerfile FROM python:3.10 WORKDIR /app COPY ./requirements.txt /app/requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt COPY . . CMD ["python", "main.py"] ``` -------------------------------- ### Local API Setup and Execution Source: https://github.com/openai/chatgpt-retrieval-plugin Instructions for setting up environment variables and running the LLM Retrieval Plugin API locally. It also guides on accessing the API documentation and testing endpoints. ```APIDOC ## Local API Setup and Execution ### Description This section details the steps required to run the LLM Retrieval Plugin API on your local machine. It includes setting necessary environment variables and starting the API server. ### Method N/A (This describes a process, not a specific API endpoint) ### Endpoint N/A ### Parameters #### Environment Variables - **DATASTORE** (string) - Required - The datastore to be used. - **BEARER_TOKEN** (string) - Required - The bearer token for authentication. - **OPENAI_API_KEY** (string) - Required - Your OpenAI API key. - **Vector DB Environment Variables** - Required - Add environment variables specific to your chosen vector database. ### Request Example ```bash export DATASTORE= export BEARER_TOKEN= export OPENAI_API_KEY= ``` ### Running the API ```bash poetry run start ``` ### Accessing API Documentation Append `docs` to the URL shown in the terminal (e.g., `http://0.0.0.0:8000/docs`). ### Dependency Management If new dependencies are added to `pyproject.toml`, run the following commands: ```bash poetry lock poetry install ``` ### Response N/A ### Response Example N/A ``` -------------------------------- ### Deploy to Vercel with Supabase integration Source: https://github.com/supabase-community/nextjs-openai-doc-search Instructions for deploying the starter project to Vercel. The Supabase integration automatically configures environment variables and the database schema. Users only need to set their OPENAI_KEY to get started. ```shell Deploy this starter to Vercel. The Supabase integration will automatically set the required environment variables and configure your Database Schema. All you have to do is set your OPENAI_KEY and you're ready to go! ``` -------------------------------- ### Run Litecast Web Locally Source: https://github.com/dylsteck/litecast-web Starts the litecast-web application in development mode using npm. This command should be run after installing dependencies and configuring the environment. ```bash npm run dev ``` -------------------------------- ### Example Usage of Headers Function Source: https://beta.nextjs.org/docs/routing/route-handlers This example shows a typical server component or route handler setup in Next.js where the `headers` function is imported and used to retrieve header information. It highlights the import statement and the structure of a GET request handler. ```typescript import { headers } from 'next/headers' import type { NextRequest } from 'next/server' export async function GET(request: NextRequest) { const requestHeaders = headers() const authorization = requestHeaders.get('authorization') // ... other code ``` -------------------------------- ### Create Next App with Blog Starter Example (npm) Source: https://vercel.com/blog/understanding-react-server-components-57brjqQf27QFQaFFm27gZ9 This command bootstraps a new Next.js application using the blog-starter example with npm. It initializes the project and downloads the necessary dependencies. ```bash npx create-next-app --example blog-starter blog-starter-app ``` -------------------------------- ### Install Dependencies and Set Up Environment Source: https://github.com/openai/chatgpt-retrieval-plugin This section outlines the steps to install necessary tools like Python and poetry, clone the repository, create and activate a virtual environment, and install project dependencies using poetry. ```bash git clone https://github.com/openai/chatgpt-retrieval-plugin.git cd /path/to/chatgpt-retrieval-plugin pip install poetry poetry env use python3.10 poetry shell poetry install ``` -------------------------------- ### Get Started Section Header Text Source: https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/ This snippet defines the text content for a 'Get started' section, likely in a navigation menu. It includes a main title ('Get started') and a subtitle ('Useful information for newcomers'). Styling is handled by Tailwind CSS classes. ```jsx "$","div",null,{ "children":[ ["$","p",null,{ "className":"flex-1 text-md font-bold leading-tight text-body", "children":"Get started" }], ["$","p",null,{ "className":"text-sm font-normal leading-tight text-menu-2-subtext", "children":"Useful information for newcomers" }] ] } ``` -------------------------------- ### GPT-4 Chatbot Explains Appliance Configuration Source: https://context7_llms An example where GPT-4, provided with an image of an incorrectly configured appliance, explains the issue and guides the user on proper setup. This highlights GPT-4's image analysis and explanation capabilities. ```N/A This use case was described on the OpenAI website. The text does not include the actual dialogue or code used in the demonstration. ``` -------------------------------- ### Expandable Section: Get Started Source: https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/ This snippet implements an expandable UI section for 'Get started'. It includes icons for expanding/collapsing, descriptive text, and event tracking for section changes. ```javascript self.__next_f.push([ 1, "64:[[\"$\",\"$L55\",\"Get started\",{\"className\":\"border-t border-body-light last:border-b\",\"eventCategory\":\"Mobile navigation menu\",\"eventAction\":\"Level 1 section changed\",\"openEventName\":\"Open section: Get started - Your first steps...\",\"closeEventName\":\"Close section: Get started - Your first steps...\",\"children\":[[\"$\",\"$L4d\",null,{\"data-testid\":\"mobile-menu-collapsible-get-started\",\"className\":\"group/menu w-full flex-1 items-center gap-2 font-medium transition-all hover:bg-background-highlight hover:text-primary-hover focus-visible:outline-1 focus-visible:-outline-offset-1 focus-visible:outline-primary-hover group-data-[state=open]/menu:bg-background-highlight group-data-[state=open]/menu:text-primary-high-contrast md:px-4 [\u0026[data-state=open]:dir(rtl)_[data-label=icon-container]\u003esvg]:rotate-90 [\u0026[data-state=open]_[data-label=icon-container]\u003esvg]:-rotate-90 flex h-full justify-start whitespace-normal px-4 py-4 text-start no-underline text-body ps-8\",\"children\":[[[\"$\",\"svg\",null,{\"xmlns\":\"http://www.w3.org/2000/svg\",\"width\":24,\"height\":24,\"viewBox\":\"0 0 24 24\",\"fill\":\"none\",\"stroke\":\"currentColor\",\"strokeWidth\":2,\"strokeLinecap\":\"round\",\"strokeLinejoin\":\"round\",\"className\":\"lucide lucide-minus hidden size-6 stroke-[3] p-1 group-hover/menu:text-primary-hover group-data-[state=open]/menu:block\",\"aria-hidden\":\"true\",\"children\":[[\"$\",\"path\",\"1ays0h\",{\"d\":\"M5 12h14\"}],\"$undefined\"]}],[\"$\",\"svg\",null,{\"xmlns\":\"http://www.w3.org/2000/svg\",\"width\":24,\"height\":24,\"viewBox\":\"0 0 24 24\",\"fill\":\"none\",\"stroke\":\"currentColor\",\"strokeWidth\":2,\"strokeLinecap\":\"round\",\"strokeLinejoin\":\"round\",\"className\":\"lucide lucide-plus block size-6 stroke-[3] p-1 group-hover/menu:text-primary-hover group-data-[state=open]/menu:hidden\",\"aria-hidden\":\"true\",\"children\":[[\"$\",\"path\",\"1ays0h\",{\"d\":\"M5 12h14\"}],[\"$\",\"path\",\"s699le\",{\"d\":\"M12 5v14\"}],\"$undefined\"]}]],[\"$\",\"div\",null,{\"children\":[[\"$\",\"p\",null,{\"className\":\"flex-1 text-md font-bold leading-tight text-body\",\"children\":\"Get started\"}],[\"$\",\"p\",null,{\"className\":\"text-sm font-normal leading-tight text-menu-2-subtext\",\"children\":\"Your first steps to use Ethereum\"}]]}]],[\"$\",\"$L4e\",null,{\"className\":\"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down mt-0 p-0 bg-background-low\",\"children\":\"$L6c\"}]]}] ``` -------------------------------- ### Create Next App with Blog Starter Example (Yarn) Source: https://vercel.com/blog/understanding-react-server-components-57brjqQf27QFQaFFm27gZ9 This command bootstraps a new Next.js application using the blog-starter example with Yarn. It's an alternative to the npm command for project initialization. ```bash yarn create next-app --example blog-starter blog-starter-app ``` -------------------------------- ### Render 'Get started' collapsible section Source: https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/ Renders a collapsible section for 'Get started' with icons for expand/collapse states and associated text. It uses Tailwind CSS classes for styling and state management. ```javascript self.__next_f.push([ 1, "51:[\[\"$\",\"$L55\",\"Get started\",{\"className\":\"border-t border-body-light last:border-b\",\"eventCategory\":\"Mobile navigation menu\",\"eventAction\":\"Level 1 section changed\",\"openEventName\":\"Open section: Get started - Useful informati...\",\"closeEventName\":\"Close section: Get started - Useful informati...\",\"children\":[[\"$\",\"$L4d\",null,{\"data-testid\":\"mobile-menu-collapsible-get-started\",\"className\":\"group/menu w-full flex-1 items-center gap-2 font-medium transition-all hover:bg-background-highlight hover:text-primary-hover focus-visible:outline-1 focus-visible:-outline-offset-1 focus-visible:outline-primary-hover group-data-\[state=open]/menu:bg-background-highlight group-data-\[state=open]/menu:text-primary-high-contrast md:px-4 [\u0026[data-state=open]:dir(rtl)\_[data-label=icon-container]\u003esvg]:rotate-90 [\u0026[data-state=open]_[data-label=icon-container]\u003esvg]:-rotate-90 flex h-full justify-start whitespace-normal px-4 py-4 text-start no-underline text-body ps-8\",\"children\":[[[\"$\",\"svg\",null,{\"xmlns\":\"http://www.w3.org/2000/svg\",\"width\":24,\"height\":24,\"viewBox\":\"0 0 24 24\",\"fill\":\"none\",\"stroke\":\"currentColor\",\"strokeWidth\":2,\"strokeLinecap\":\"round\",\"strokeLinejoin\":\"round\",\"className\":\"lucide lucide-minus hidden size-6 stroke-\\[3] p-1 group-hover/menu:text-primary-hover group-data-\[state=open]/menu:block\",\"aria-hidden\":\"true\",\"children\":[[\"$\",\"path\",\"1ays0h\",{\"d\":\"M5 12h14\"}],\"$undefined\"]}],(\"$\",\"svg\",null,{\"xmlns\":\"http://www.w3.org/2000/svg\",\"width\":24,\"height\":24,\"viewBox\":\"0 0 24 24\",\"fill\":\"none\",\"stroke\":\"currentColor\",\"strokeWidth\":2,\"strokeLinecap\":\"round\",\"strokeLinejoin\":\"round\",\"className\":\"lucide lucide-plus block size-6 stroke-\\[3] p-1 group-hover/menu:text-primary-hover group-data-\[state=open]/menu:hidden\",\"aria-hidden\":\"true\",\"children\":[[\"$\",\"path\",\"1ays0h\",{\"d\":\"M5 12h14\"}],{\"d\":\"M12 5v14\"}],\"$undefined\"]})],(\"$\",\"div\",null,{\"children\":[[(\"$\",\"p\",null,{\"className\":\"flex-1 text-md font-bold leading-tight text-body\",\"children\":\"Get started\"})],(\"$\",\"p\",null,{\"className\":\"text-sm font-normal leading-tight text-menu-2-subtext\",\"children\":\"Cheaper and faster transactions for Ethereum\"})]})]})]}) ``` -------------------------------- ### Collapsible Section Header - Get Started (React) Source: https://ethereum.org/en/upgrades/merge/ Defines the header for a collapsible section titled 'Get started'. It includes icons for expanding/collapsing and descriptive text for newcomers. This component likely manages the open/closed state of its content. ```javascript { "data-testid": "mobile-menu-collapsible-get-started", "className": "group/menu w-full flex-1 items-center gap-2 font-medium transition-all hover:bg-background-highlight hover:text-primary-hover focus-visible:outline-1 focus-visible:-outline-offset-1 focus-visible:outline-primary-hover group-data-[state=open]/menu:bg-background-highlight group-data-[state=open]/menu:text-primary-high-contrast md:px-4 [\u0026[data-state=open]]:dir(rtl) [\u0026[data-state=open]] [data-label=icon-container]\u003esvg]:rotate-90 [\u0026[data-state=open]] [data-label=icon-container]\u003esvg]:-rotate-90 flex h-full justify-start whitespace-normal px-4 py-4 text-start no-underline text-body ps-8", "children": [ [ { "$": "svg", "xmlns": "http://www.w3.org/2000/svg", "width": 24, "height": 24, "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": 2, "strokeLinecap": "round", "strokeLinejoin": "round", "className": "lucide lucide-minus hidden size-6 stroke-[3] p-1 group-hover/menu:text-primary-hover group-data-[state=open]/menu:block", "aria-hidden": "true", "children": [ { "$": "path", "d": "M5 12h14" } ] } ], [ { "$": "svg", "xmlns": "http://www.w3.org/2000/svg", "width": 24, "height": 24, "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": 2, "strokeLinecap": "round", "strokeLinejoin": "round", "className": "lucide lucide-plus block size-6 stroke-[3] p-1 group-hover/menu:text-primary-hover group-data-[state=open]/menu:hidden", "aria-hidden": "true", "children": [ { "$": "path", "d": "M5 12h14" }, { "$": "path", "d": "M12 5v14" } ] } ], { "$": "div", "children": [ { "$": "p", "className": "flex-1 text-md font-bold leading-tight text-body", "children": "Get started" }, { "$": "p", "className": "text-sm font-normal leading-tight text-menu-2-subtext", "children": "Useful information for newcomers" } ] } ] } ``` -------------------------------- ### GET /rss.xml Source: https://beta.nextjs.org/docs/routing/route-handlers Example of a GET request handler that generates an RSS feed in XML format. ```APIDOC ## GET /rss.xml ### Description This endpoint returns an RSS feed in XML format, commonly used for content syndication. ### Method GET ### Endpoint /rss.xml ### Parameters #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **Content-Type**: text/xml - **Body**: XML content representing the RSS feed. #### Response Example ```xml Next.js Documentation https://nextjs.org/docs The React Framework for the Web ``` ``` -------------------------------- ### Mobile Navigation Menu - Get Started Section Source: https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/ This snippet defines the structure and behavior for the 'Get started' section in a mobile navigation menu. It includes icons for expanding/collapsing and text for the section title and subtitle, likely used in a React or similar framework. ```javascript self.__next_f.push([1,"50:[[\"$\",\"$L55\",\"Get started\",{\"className\":\"border-t border-body-light last:border-b\",\"eventCategory\":\"Mobile navigation menu\",\"eventAction\":\"Level 1 section changed\",\"openEventName\":\"Open section: Get started - Your first steps...\",\"closeEventName\":\"Close section: Get started - Your first steps...\",\"children\":[[\"$\",\"$L4d\",null,{\"data-testid\":\"mobile-menu-collapsible-get-started\",\"className\":\"group/menu w-full flex-1 items-center gap-2 font-medium transition-all hover:bg-background-highlight hover:text-primary-hover focus-visible:outline-1 focus-visible:-outline-offset-1 focus-visible:outline-primary-hover group-data-[state=open]/menu:bg-background-highlight group-data-[state=open]/menu:text-primary-high-contrast md:px-4 [\u0026[data-state=open]]:dir(rtl)_[data-label=icon-container]\u003esvg]:rotate-90 [\u0026[data-state=open]_[data-label=icon-container]\u003esvg]:-rotate-90 flex h-full justify-start whitespace-normal px-4 py-4 text-start no-underline text-body ps-8\",\"children\":[[[\"$\",\"svg\",null,{\"xmlns\":\"http://www.w3.org/2000/svg\",\"width\":24,\"height\":24,\"viewBox\":\"0 0 24 24\",\"fill\":\"none\",\"stroke\":\"currentColor\",\"strokeWidth\":2,\"strokeLinecap\":\"round\",\"strokeLinejoin\":\"round\",\"className\":\"lucide lucide-minus hidden size-6 stroke-[3] p-1 group-hover/menu:text-primary-hover group-data-[state=open]/menu:block\",\"aria-hidden\":\"true\",\"children\":[[\"$\",\"path\",\"1ays0h\",{\"d\":\"M5 12h14\"}],\"$undefined\"]}],[\"$\",\"svg\",null,{\"xmlns\":\"http://www.w3.org/2000/svg\",\"width\":24,\"height\":24,\"viewBox\":\"0 0 24 24\",\"fill\":\"none\",\"stroke\":\"currentColor\",\"strokeWidth\":2,\"strokeLinecap\":\"round\",\"strokeLinejoin\":\"round\",\"className\":\"lucide lucide-plus block size-6 stroke-[3] p-1 group-hover/menu:text-primary-hover group-data-[state=open]/menu:hidden\",\"aria-hidden\":\"true\",\"children\":[[\"$\",\"path\",\"1ays0h\",{\"d\":\"M5 12h14\"}],\[\"$\",\"path\",\"s699le\",{\"d\":\"M12 5v14\"}],\"$undefined\"]}]],[\"$\",\"div\",null,{\"children\":[[\"$\",\"p\",null,{\"className\":\"flex-1 text-md font-bold leading-tight text-body\",\"children\":\"Get started\"}],[\"$\",\"p\",null,{\"className\":\"text-sm font-normal leading-tight text-menu-2-subtext\",\"children\":\"Your first steps to use Ethereum\"}]]}]}]}],[\"$\",\"$L4e\",null,{\"className\":\"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down mt-0 p-0 bg-background-low\",\"children\":\"$L58\"}]]}"], ``` -------------------------------- ### Local API Setup Source: https://github.com/openai/chatgpt-retrieval-plugin Instructions on how to set environment variables and run the API locally. ```APIDOC ## Local API Setup ### Description Set up environment variables and start the API locally. ### Method N/A (Shell commands) ### Endpoint N/A ### Running the API 1. Set environment variables: ```bash export DATASTORE= export BEARER_TOKEN= export OPENAI_API_KEY= # Add environment variables for your chosen vector DB ``` 2. Start the API: ```bash poetry run start ``` 3. Access documentation at `http://0.0.0.0:8000/docs`. ### Dependencies Update If new dependencies are added to `pyproject.toml`: ```bash poetry lock poetry install ``` ``` -------------------------------- ### Mobile Navigation: Get Started Section Toggle Source: https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/ This snippet details the structure for a 'Get started' collapsible section in a mobile navigation menu. It includes parameters for managing the section's open/closed state, associated event tracking, and styling for interactive elements. The content focuses on providing useful information for users. ```javascript [\"$\",\"$L55\",\"Get started\",{\"className\":\"border-t border-body-light last:border-b\",\"eventCategory\":\"Mobile navigation menu\",\"eventAction\":\"Level 1 section changed\",\"openEventName\":\"Open section: Get started - Useful informati...\",\"closeEventName\":\"Close section: Get started - Useful informati...\",\"children\":[[\"$\",\"$L4d\",null,{\"data-testid\":\"mobile-menu-collapsible-get-started\",\"className\":\"group/menu w-full flex-1 items-center gap-2 font-medium transition-all hover:bg-background-highlight hover:text-primary-hover focus-visible:outline-1 focus-visible:-outline-offset-1 focus-visible:outline-primary-hover group-data-\[state=open\]/menu:bg-background-highlight group-data-\[state=open\]/menu:text-primary-high-contrast md:px-4 [\u0026\[data-state=open\]:dir(rtl)\_[data-label=icon-container]\u003esvg]:rotate-90 [\u0026\[data-state=open\]_[data-label=icon-container]\u003esvg]:-rotate-90 flex h-full justify-start whitespace-normal px-4 py-4 text-start no-underline text-body ps-8\"}]\]}] ``` -------------------------------- ### Ethereum Get Started Navigation Link Source: https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/ Defines the navigation link for the 'Start here' section, indicating the path and providing a brief description for users new to Ethereum. ```json { "href": "/start/", "children": [ [ "$", "p", null, { "className": "text-md font-bold text-body group-[.is-active]/lnk:text-primary-high-contrast", "children": "Start here" } ], [ "$", "p", null, { "className": "text-sm font-normal text-menu-3-subtext group-[.is-active]/lnk:text-primary-high-contrast", "children": "Get your Ethereum account ready" } ] ] } ``` -------------------------------- ### Next.js Blog Starter Example Description Source: https://vercel.com/blog/understanding-react-server-components-57brjqQf27QFQaFFm27gZ9 This section describes a Next.js blog starter example that uses static generation with Markdown files. It highlights the use of libraries like `remark`, `remark-html`, and `gray-matter` for processing Markdown content and metadata. ```markdown > A statically generated blog example using Next.js and Markdown This example showcases Next.js's [Static Generation](https://nextjs.org/docs/basic-features/pages) feature using Markdown files as the data source. The blog posts are stored in `/_posts` as Markdown files with front matter support. Adding a new Markdown file in there will create a new blog post. To create the blog posts we use [`remark`](https://github.com/remarkjs/remark) and [`remark-html`](https://github.com/remarkjs/remark-html) to convert the Markdown files into an HTML string, and then send it down as a prop to the page. The metadata of every post is handled by [`gray-matter`](https://github.com/jonschlinkert/gray-matter) and also sent in props to the page. ## Preview Preview the example live on [StackBlitz](http://stackblitz.com/): [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/vercel/next.js/tree/canary/examples/blog-starter) ## Demo [https://next-blog-starter.vercel.app/](https://next-blog-starter.vercel.app/) ## Deploy your own Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example): ``` -------------------------------- ### SQL Migration Example Source: https://github.com/mckaywrigley/chatbot-ui An example SQL snippet from a Supabase migration file. It shows placeholders for `project_url` and `service_role_key` that need to be replaced with actual values obtained from `supabase status`. ```sql -- Example SQL migration snippet -- ... other SQL statements ... -- REPLACE 'http://supabase_kong_chatbotui:8000' with your actual project_url -- REPLACE 'YOUR_SERVICE_ROLE_KEY' with your actual service_role_key ``` -------------------------------- ### Navigation Section: Start Here (JSON) Source: https://ethereum.org/en/upgrades/merge/ Defines the 'Start here' section of the navigation, including its descriptive text, associated links, and CSS classes for styling. It guides new users through initial steps. ```JSON { "className": "border-t border-body-light last:border-b", "children": [ "$", "$L43", null, { "className": "flex h-full justify-start whitespace-normal px-4 py-4 text-start text-body no-underline ps-20", "variant": "ghost", "asChild": true, "children": [ "$", "$L23", null, { "href": "/start/", "isPartiallyActive": false, "activeClassName": "is-active", "className": "group/lnk block", "customEventOptions": { "eventCategory": "Mobile navigation menu", "eventAction": "Menu: en - use", "eventName": "/start/" }, "children": [ ["$", "p", null, { "className": "text-md font-bold text-body group-[.is-active]/lnk:text-primary-high-contrast", "children": "Start here" }], ["$", "p", null, { "className": "text-sm font-normal text-menu-3-subtext group-[.is-active]/lnk:text-primary-high-contrast", "children": "Your first steps using Ethereum" }] ] } ] } ] } ``` -------------------------------- ### Define GET Request Handler in route.js Source: https://beta.nextjs.org/docs/routing/route-handlers Demonstrates how to define a GET request handler using the Web Response.json API. This is a basic example of creating an API endpoint. ```javascript export async function GET() { return Response.json({ message: 'Hello World' }) } ``` ```typescript export async function GET() { return Response.json({ message: 'Hello World' }) } ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/mckaywrigley/chatbot-ui Copies the example environment file and then uses `supabase status` to retrieve necessary API URLs and keys. These values are then populated into the `.env.local` file for configuration. ```bash cp .env.local.example .env.local ``` ```bash supabase status ``` -------------------------------- ### PostgreSQL with pgvector Setup Source: https://github.com/openai/chatgpt-retrieval-plugin Instructions for setting up a PostgreSQL database with the pgvector extension enabled for vector storage. This includes guidance on using Docker for local setup or managed solutions from cloud vendors. ```bash docker run --name pgvector -d -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword postgres psql -h localhost -p 5432 -U postgres -c "CREATE EXTENSION IF NOT EXISTS vector;" ``` -------------------------------- ### Route Handlers: GET Source: https://beta.nextjs.org/docs/routing/route-handlers Route Handlers allow you to create custom request handlers for a given route using the Web Request and Response APIs. This example demonstrates a simple GET request handler. ```APIDOC ## GET /api/route ### Description Handles GET requests for a specific route using Web APIs. ### Method GET ### Endpoint /api/route ### Request Body None ### Response #### Success Response (200) - **message** (string) - A confirmation message. #### Response Example ```json { "message": "Hello World" } ``` ``` -------------------------------- ### Animation Setup and Execution (JavaScript) Source: https://rainbow.me/ Handles the setup and execution of animations, including managing animation timelines and performance timing. It ensures animations are ready before execution and manages the start time. ```javascript let f = () => { C.cancel(); let a = R(e, t, r, o); N === void 0 && (N = performance.now()); a.startTime = N; b.set(i, { animation: a, startTime: N }); s && s(a); }; E.set(n, !1); C.ready ? C.ready.then(f).catch(j) : f(); ``` -------------------------------- ### Configure Litecast Web Environment Source: https://github.com/dylsteck/litecast-web Details the process of setting up the local environment for litecast-web. This involves copying an example environment file and adding API keys from Neynar. ```bash cp .env.example .env.local # Add your Neynar keys from dev.neynar.com ``` -------------------------------- ### Next.js Route Handler Example: GET Request with Dynamic Segment Source: https://beta.nextjs.org/docs/routing/route-handlers This TypeScript code snippet demonstrates a basic GET request handler in Next.js that can process dynamic route segments. It exports an async function named GET that accepts a request object. The code uses 'redirect' to navigate to an external URL. ```typescript export async function GET(request) { redirect('https://nextjs.org/') } ``` -------------------------------- ### Environment Configuration Source: https://github.com/supabase-community/nextjs-openai-doc-search This section outlines the steps to configure the local development environment. It involves copying an example environment file, setting the OpenAI API key, and Supabase keys. ```bash cp .env.example .env # Set your OPENAI_KEY in the newly created .env file. # Set NEXT_PUBLIC_SUPABASE_ANON_KEY and SUPABASE_SERVICE_ROLE_KEY run: ``` -------------------------------- ### Install and Use Poetry for Dependency Management (Python) Source: https://github.com/openai/chatgpt-retrieval-plugin This section details the steps to install Poetry, set up a virtual environment using Python 3.10, and install project dependencies. ```shell pip install poetry poetry env use python3.10 poetry shell poetry install ``` -------------------------------- ### Install Supabase CLI on Windows Source: https://github.com/mckaywrigley/chatbot-ui These commands install the Supabase CLI on Windows using Scoop. First, add the Supabase scoop bucket, then install the CLI. ```shell scoop bucket add supabase https://github.com/supabase/scoop-bucket.git scoop install supabase ``` -------------------------------- ### SVG Path 'M' Command Example Source: https://arc.net/ Shows an example of the 'M' (moveto) command in SVG path data. This command establishes a new current point, effectively starting a new subpath without drawing a line. ```svg M402.738,321.467 ``` -------------------------------- ### Serve Project with Deno Task Source: https://github.com/treehousedev/treehouse This command starts the development server for the project using Deno's task runner. It assumes a 'serve' task is defined in the Deno configuration. No external dependencies beyond Deno itself are required. ```shell deno task serve ``` -------------------------------- ### Managing Cookies in Route Handlers (Get and Set) Source: https://beta.nextjs.org/docs/routing/route-handlers Provides examples of how to read and set cookies within a Next.js route handler using the `cookies` function from `next/headers`. It shows getting a cookie by name and setting a new cookie. ```typescript import { cookies } from 'next/headers' export async function GET(request: NextRequest) { const cookieStore = await cookies() const a = cookieStore.get('a') const b = cookieStore.set('b', '1') const c = cookieStore.delete('c') } ``` -------------------------------- ### Next.js Runtime Initialization Source: https://opensea.io/assets/ethereum/0x2afc7e19c52a7fbd219744b1dc97e3bb605a0e93/62 This snippet shows a Next.js runtime function, likely responsible for initializing or managing the application's modules and routing. ```javascript self.__next_f.push([1,"79:I[74792,[\"90200\",\"static/chunks/a8084b24-026a6ecd2532ce0a.js\",\"71818\",\"static/chunks/448f644e-4e47a2697f2c0d2f.js\",\"3987\",\"static/chunks/09d899ad-8b89c8f75d9e6848.js\",\"27932\",\"static/chunks/306f2493-6c76aa0268f90d10.js\",\"73207\",\"static/ch ```