From 461ac752a008c93db5f282f41262ecdee32db216 Mon Sep 17 00:00:00 2001 From: Julian Duque Date: Tue, 24 Sep 2024 09:54:12 -0400 Subject: [PATCH] add readme and schema --- .env.sample | 7 +++++ README.md | 80 ++++++++++++++++--------------------------------- data/schema.sql | 10 +++++++ 3 files changed, 42 insertions(+), 55 deletions(-) create mode 100644 .env.sample create mode 100644 data/schema.sql diff --git a/.env.sample b/.env.sample new file mode 100644 index 0000000..2c080b2 --- /dev/null +++ b/.env.sample @@ -0,0 +1,7 @@ +OPENAI_API_KEY= +LANGCHAIN_TRACING_V2="true" +LANGCHAIN_API_KEY= +LANGCHAIN_PROJECT="ProjectName" +LANGCHAIN_CALLBACKS_BACKGROUND=true +OPENWEATHER_API_KEY= +DATABASE_URL= \ No newline at end of file diff --git a/README.md b/README.md index b3cd416..1297b42 100644 --- a/README.md +++ b/README.md @@ -1,79 +1,49 @@ -# Welcome to Remix + Vite + shadcn/ui! +# Build AI Applications with Node.js and LangChain -📖 See the [Remix docs](https://remix.run/docs) and the [Remix Vite docs](https://remix.run/docs/en/main/future/vite) for details on supported features. +## Install -## Getting Started +Use pnpm! -Node Server: - -```sh -npx create-remix@latest --template jacob-ebey/remix-shadcn +```shell +corepack install pnpm ``` -Cloudflare Pages: - -```shellscript -npx create-remix@latest --template https://github.com/jacob-ebey/remix-shadcn/tree/cloudflare -``` - -Or for a more flushed out template with a login flow and a SQLite database backed by Drizzle ORM: - -Node Server: +Then install dependencies -```shellscript -npx create-remix@latest --template https://github.com/jacob-ebey/remix-shadcn/tree/drizzle +```shell +pnpm install ``` -Cloudflare Pages: - -```shellscript -npx create-remix@latest --template https://github.com/jacob-ebey/remix-shadcn/tree/drizzle-cloudflare -``` - -## Built in theme switcher - -![image](https://github.com/jacob-ebey/remix-shadcn/assets/12063586/c6ed812c-764f-46b7-af30-26284f55535c) +## Development -![image](https://github.com/jacob-ebey/remix-shadcn/assets/12063586/4e378230-3b4b-4b78-8af4-096b30aacf79) +Setup `.env` file following `.env.sample` example -## Development +- Register for OpenAI API +- Register for Langsmith API -Run the Vite dev server: +Run development mode -```sh -npm run dev +```shell +pnpm dev ``` ## Deployment -First, build your app for production: +Create an Heroku app and add Postgres support -```sh -npm run build +```shell +heroku create +heroku addons:create heroku-postgresql:essential-0 ``` -Setup your environment: +Setup the schema -```sh -NODE_ENV='production' +```shell +heroku pg:psql -f data/schema.sql ``` -Then run the app in production mode: +Deploy to Heroku! -```sh -npm start +```shell +git push heroku main ``` - -Now you'll need to pick a host to deploy it to. - -### DIY - -If you're familiar with deploying Node applications, the built-in Remix app server is production-ready. - -Make sure to deploy the output of `npm run build` and the server - -- `server.js` -- `build/server` -- `build/client` - -Take a look at the provided Dockerfile for further details on how to configure a production environment. diff --git a/data/schema.sql b/data/schema.sql new file mode 100644 index 0000000..b3af3c6 --- /dev/null +++ b/data/schema.sql @@ -0,0 +1,10 @@ +CREATE EXTENSION IF NOT EXISTS vector; + +CREATE TABLE IF NOT EXISTS videos ( + id SERIAL PRIMARY KEY, + title TEXT, + description TEXT, + source TEXT +); + +-- video_embeddings table will be created by LangChain \ No newline at end of file