This project is a monorepo generated using Nx. It implements a chatbot application using the ts-rest framework.
- client: the client application
- client-e2e: the e2e tests for the client application. Generated by nx but left empty.
- server: the server implementation
- server-e2e: the e2e tests for the server application. Generated by nx but left empty.
- api: API contracts definition
- api-errors: API errors shared accross the libs and services
- completion-client: completion service definition and implementations
- scan-client: the scanner service definition and implementations (unused)
- storage-client: the storage service definition and implementations (unused)
In order to run the project, you need to set up a Clerk account and a Clerk project. You can create an account for free.
Except for the Clerk account, you don't need to set up any other environment variables, just copy/paste the .env.example file to .env.
The config file for LiteLLM is located in the infra/litellm folder and is an example of how to configure LiteLLM. The models will not be downloaded automatically, you need to download them manually.
To do so, run ollama pull <model_name> in the ollama container and update the litellm config file with the model name.
- Clone the repository
- Start docker services
docker-compose up -d- Install dependencies
pnpm install- Run the server
pnpm dev-server- Run the client
pnpm dev-front- Open the client application in your browser
http://localhost:4200Define your API contracts in the libs/api/src/presentation folder.
Add the contract your created in the libs/api/src/presentation/api.ts file.
This will automatically add it to the client in the frontend.
-
Create a controller for the manipulated objects in the
services/server/src/applicationfolder. -
Create a repository for the controller in the
services/server/src/domainfolder. Add an implementation of this repository. If this implementation is in memory, you can implement in in the same file. Otherwise, create it in the infrastructure folder. -
Create a router for the controller in the
services/server/src/presentation/routesfolder. -
Add the router to your app in the
services/server/src/app.tsfile.