This is a Redis LLM chatbot for JS and Node using:
Copy and edit the .env
file:
cp .env.example .env
Your .env
file should contain the connection string you copied from Redis Cloud.
Next, spin up docker containers:
bun docker
NOTE: If you only want to run Redis in docker and then run the app in dev mode, use
bun docker:redis
instead.
You should have a server running on http://localhost:<port>
where the port is set in your .env
file (default is 8080). Go to that URL in your browser and you should see the chat.
There are some tests in the __tests__
folder that can be run with the following command:
bun test --timeout 15000
These tests setup and teardown on their own. You can modify them if you want to leave data in Redis.
To run the development server outside of docker:
bun install
# then, only if you want to run Redis in docker
bun docker:redis
# finally
bun dev
Formatting code:
bun format
Updating dependencies:
bun update
This is a no-build JavaScript project, but you can still run type checking:
bun ts
If you don't yet have a database setup in Redis Cloud get started here for free.
To connect to a Redis Cloud database, log into the console and find the following:
- The
public endpoint
(looks likeredis-#####.c###.us-east-1-#.ec2.redns.redis-cloud.com:#####
) - Your
username
(default
is the default username, otherwise find the one you setup) - Your
password
(either setup through Data Access Control, or available in theSecurity
section of the database page.
Combine the above values into a connection string and put it in your .env
and .env.docker
accordingly. It should
look something like the following:
REDIS_URL="redis://default:<password>@redis-#####.c###.us-west-2-#.ec2.redns.redis-cloud.com:#####"
Run the tests to verify that you are connected properly.
To learn more about Redis, take a look at the following resources:
- Redis Documentation - learn about Redis products, features, and commands.
- Learn Redis - read tutorials, quick starts, and how-to guides for Redis.
- Redis Demo Center - watch short, technical videos about Redis products and features.