Skip to content

webgptorg/hello-world-next-js

Repository files navigation

✨ Hello World!

Welcome! In this repository, you'll find a simple example of how to write your first Book and run it using the Promptbook Engine via the CLI.

TODO: !!!!!! Merge Book and Next Getting Started

Getting Started

Follow these steps to get up and running:

1. Clone the Repository

First, clone this repository to your local machine.

2. Install Promptbook

Navigate to the root of the project and run the following command to install Promptbook:

npm i ptbk

Note: Currently, installation is supported only via NPM. We are actively working on adding support for other package managers and installer files such as .msi, .rpm, and .deb.

3. Configure Environment Variables

Create a .env file in the root of the project to configure the necessary API keys for the model providers you plan to use:

# You only need to configure one provider:

# OpenAI
OPENAI_API_KEY=sk-proj-...

# Anthropic Claude
ANTHROPIC_CLAUDE_API_KEY=sk-ant-api03-...

# Azure OpenAI
AZUREOPENAI_API_KEY=...
AZUREOPENAI_RESOURCE_NAME=...
AZUREOPENAI_DEPLOYMENT_NAME=...

4. Run the Example

From the root of the repository, execute the following command to run the example:

npx ptbk books/hello.book.md

Expected Output

If everything is set up correctly, you should see the following output:

$ npx ptbk books/hello.book.md
√ yourName ... The World

--- Result: ---
greeting: Hello World!

🚀✨ Congratulations! You've successfully created your first book with Promptbook! Now you can continue with the examples or the book language blueprint to dive deeper into the book language, integrate books into your app or create instant miniapps without classical programming.

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

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

Open 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 to automatically optimize and load Geist, a new font family for Vercel.

Learn More

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

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

About

Sample Book project using Promptbook and Next.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published