Skip to content

Commit

Permalink
add readme and schema
Browse files Browse the repository at this point in the history
  • Loading branch information
julianduque committed Sep 24, 2024
1 parent a2e4cb4 commit 461ac75
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 55 deletions.
7 changes: 7 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -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=
80 changes: 25 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 <app-name>
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.
10 changes: 10 additions & 0 deletions data/schema.sql
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 461ac75

Please sign in to comment.