Skip to content

Commit

Permalink
Merge pull request #5 from 0xsarwagya/main
Browse files Browse the repository at this point in the history
Update CONTRIBUTING.md, Add Routes, and Improve UI
  • Loading branch information
0xsarwagya authored Oct 23, 2024
2 parents d875ccb + ea49338 commit 06aafbb
Show file tree
Hide file tree
Showing 65 changed files with 2,565 additions and 175 deletions.
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"rebackk",
"chatbots",
"repobeats",
"octocat"
"octocat",
"zustand"
],
"flagWords": [],
"ignorePaths": [
Expand Down
Empty file removed .github/workflows/prs.yaml
Empty file.
8 changes: 3 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,16 @@ Please review our [Code of Conduct](./CODE_OF_CONDUCT.md). By participating, you

## :bulb: Asking Questions

If you have any question that does not relate to a bug or a feature request, please use [GitHub Discussions](https://github.com/ghUserName/packageName/discussions) instead of GitHub issues.
If you have any question that does not relate to a bug or a feature request, please use [GitHub Discussions](https://github.com/RebackkHQ/NextJSRAG/discussions) instead of GitHub issues.

## :inbox_tray: How can I Contribute?

**GitHub issues**

If you encounter a problem with this library or if you have a new feature you'd like to see in this project, please create [a new issue](https://github.com/Rebackk-Team/pocketbase-adapter/issues/new/choose).
If you encounter a problem with this library or if you have a new feature you'd like to see in this project, please create [a new issue](https://github.com/RebackkHQ/NextJSRAG/issues/new/choose).

**GitHub Pull requests**

Please leverage the repository's own tools to make sure the code is aligned with our standards:

1. Run all check commands before submitting the PR (`type:check`, `lint:check`, `test:coverage` and `spell:check`)
2. Please commit your changes and run a `setup` command so you can actually check how would the template look like once cleaned up
3. Always leverage the `cz` command to create a commit. We heavily rely on this for automatic releases.
1. Run all check commands before submitting the PR (`type:check`, `lint:check`, `test:coverage` and `spell:check`)
7 changes: 5 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
},
"files": {
"ignoreUnknown": false,
"ignore": []
"ignore": [
"node_modules",
".next"
]
},
"formatter": {
"enabled": true,
Expand All @@ -19,7 +22,7 @@
"linter": {
"enabled": true,
"rules": {
"recommended": true
"recommended": false
}
},
"javascript": {
Expand Down
20 changes: 20 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/app/globals.css",
"baseColor": "zinc",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
}
}
20 changes: 20 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '3.8'

services:
ollama:
build:
context: .
dockerfile: ./docker/Dockerfile.ollama
ports: [ "11434:11434" ]
volumes:
- ollama_data:/root/.ollama
networks:
- net

volumes:
ollama_data:
driver: local

networks:
net:
driver: bridge
17 changes: 17 additions & 0 deletions docker/Dockerfile.ollama
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Use the Ollama base image as the builder stage
FROM ollama/ollama as builder

# Copy the setup script from the local 'scripts' directory to the root of the container
COPY ./scripts/setup-ollama.sh ./setup-ollama.sh

# Execute the setup script to configure the Ollama environment
RUN bash ./setup-ollama.sh

# Start a new stage from the Ollama base image to create the final image
FROM ollama/ollama

# Copy the configured Ollama setup from the builder stage to the final image
COPY --from=builder /root/.ollama /root/.ollama

# Expose port 11434 for external access to the application
EXPOSE 11434
20 changes: 20 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import createMDX from "@next/mdx";

/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
pageExtensions: ["mdx", "ts", "tsx"],
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
};

const withMDX = createMDX({
extension: /\.mdx?$/,
});

export default withMDX(nextConfig);
12 changes: 0 additions & 12 deletions next.config.ts

This file was deleted.

64 changes: 59 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "test",
"name": "@rebackk/nextjs-rag",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "biome lint",
Expand All @@ -13,12 +13,66 @@
"spell:check": "cspell \"{README.md,CODE_OF_CONDUCT.md,CONTRIBUTING.md,.github/*.md,src/**/*.ts}\""
},
"dependencies": {
"next": "15.0.1",
"react": "19.0.0-rc-69d4b800-20241021",
"react-dom": "19.0.0-rc-69d4b800-20241021"
"@hookform/resolvers": "^3.9.0",
"@mdx-js/loader": "^3.1.0",
"@mdx-js/react": "^3.1.0",
"@next/mdx": "^15.0.1",
"@radix-ui/react-accordion": "^1.2.1",
"@radix-ui/react-alert-dialog": "^1.1.2",
"@radix-ui/react-aspect-ratio": "^1.1.0",
"@radix-ui/react-avatar": "^1.1.1",
"@radix-ui/react-checkbox": "^1.1.2",
"@radix-ui/react-collapsible": "^1.1.1",
"@radix-ui/react-context-menu": "^2.2.2",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-hover-card": "^1.1.2",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-menubar": "^1.1.2",
"@radix-ui/react-navigation-menu": "^1.2.1",
"@radix-ui/react-popover": "^1.1.2",
"@radix-ui/react-progress": "^1.1.0",
"@radix-ui/react-radio-group": "^1.2.1",
"@radix-ui/react-scroll-area": "^1.2.0",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slider": "^1.2.1",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-switch": "^1.1.1",
"@radix-ui/react-tabs": "^1.1.1",
"@radix-ui/react-toast": "^1.2.2",
"@radix-ui/react-toggle": "^1.1.0",
"@radix-ui/react-toggle-group": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.3",
"@types/mdx": "^2.0.13",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"cmdk": "1.0.0",
"date-fns": "^4.1.0",
"embla-carousel-react": "^8.3.0",
"immer": "^10.1.1",
"input-otp": "^1.2.4",
"lucide-react": "^0.453.0",
"next": "14.2.14",
"next-themes": "^0.3.0",
"react": "18.3.1",
"react-day-picker": "8.10.1",
"react-dom": "18.3.1",
"react-hook-form": "^7.53.1",
"react-resizable-panels": "^2.1.4",
"recharts": "^2.13.0",
"shadcn-ui": "^0.9.2",
"sonner": "^1.5.0",
"tailwind-merge": "^2.5.4",
"tailwindcss-animate": "^1.0.7",
"vaul": "^1.1.0",
"zod": "^3.23.8",
"zustand": "^5.0.0"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@tailwindcss/typography": "^0.5.15",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion public/file.svg

This file was deleted.

1 change: 0 additions & 1 deletion public/globe.svg

This file was deleted.

32 changes: 32 additions & 0 deletions public/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion public/next.svg

This file was deleted.

1 change: 0 additions & 1 deletion public/vercel.svg

This file was deleted.

1 change: 0 additions & 1 deletion public/window.svg

This file was deleted.

12 changes: 12 additions & 0 deletions scripts/setup-ollama.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# This line indicates that the script should be run using the Bash shell.
# It uses /usr/bin/env to locate Bash in the user's environment.

# Start the Ollama server in the background
ollama serve &

# Pause the script for 10 seconds to allow the server to initialize
sleep 10

# Pull the 'orca-mini' model from the Ollama repository
ollama pull qwen2.5:1.5b
14 changes: 14 additions & 0 deletions src/ mdx-components.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { MDXComponents } from "mdx/types";

export function useMDXComponents(components: MDXComponents): MDXComponents {
console.log("components", components);
return {
...components,
h1: (props) => <h1 style={{ color: "tomato" }} />,
h2: (props) => <h2 style={{ color: "tomato" }} />,
h3: (props) => <h3 style={{ color: "tomato" }} />,
h4: (props) => <h4 style={{ color: "tomato" }} />,
h5: (props) => <h5 style={{ color: "tomato" }} />,
h6: (props) => <h6 style={{ color: "tomato" }} />,
};
}
20 changes: 20 additions & 0 deletions src/app/(chat)/knowledge-base/add/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { ContentLayout } from "@/components/admin-panel/content-layout";
import Image from "next/image";

export default function AddToKnowledgeBase() {
return (
<ContentLayout title="Add To Knowledge Base">
<div className="flex flex-col items-center justify-center w-full h-full space-y-4">
<Image src="/logo.svg" alt="Rebackk Logo" width={100} height={100} />
<h1 className="text-4xl font-bold text-center">
Rebackk RAG Demo | Add To Knowledge Base
</h1>
<p className="text-lg text-center">
Add a new knowledge base entry to the Rebackk RAG Demo. The entry will
be used to train the model and improve the generation of responses
tailored to the user's input.
</p>
</div>
</ContentLayout>
);
}
25 changes: 25 additions & 0 deletions src/app/(chat)/knowledge-base/list/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { ContentLayout } from "@/components/admin-panel/content-layout";
import Image from "next/image";

export default function ListKnowledgeBase() {
return (
<ContentLayout title="Knowledge Base List">
<div className="flex flex-col items-center justify-center w-full h-full space-y-4">
<Image
src="/logo.svg"
alt="Rebackk Logo"
width={100}
height={100}
/>
<h1 className="text-4xl font-bold text-center">
Rebackk RAG Demo | Knowledge Base List
</h1>
<p className="text-lg text-center">
View the knowledge base entries in the Rebackk RAG Demo. The entries
are used to train the model and improve the generation of responses
tailored to the user's input.
</p>
</div>
</ContentLayout>
);
}
25 changes: 25 additions & 0 deletions src/app/(chat)/knowledge-base/remove/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { ContentLayout } from "@/components/admin-panel/content-layout";
import Image from "next/image";

export default function RemoveFromKnowledgeBase() {
return (
<ContentLayout title="Remove From Knowledge Base">
<div className="flex flex-col items-center justify-center w-full h-full space-y-4">
<Image
src="/logo.svg"
alt="Rebackk Logo"
width={100}
height={100}
/>
<h1 className="text-4xl font-bold text-center">
Rebackk RAG Demo | Remove From Knowledge Base
</h1>
<p className="text-lg text-center">
Remove a knowledge base entry from the Rebackk RAG Demo. The entry will
be removed from the training data and will no longer be used to generate
responses tailored to the user's input.
</p>
</div>
</ContentLayout>
);
}
Loading

0 comments on commit 06aafbb

Please sign in to comment.