Skip to content

Commit c756499

Browse files
committed
added .env.example for both frontend and backend - Adithya S K
1 parent a744d68 commit c756499

File tree

4 files changed

+242
-4
lines changed

4 files changed

+242
-4
lines changed

backend/.env.example

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
# The Llama Cloud API key.
2+
# ----------------------------------------
3+
# Compulsory: Set this to your Llama Cloud API key if using Llama models.
4+
# Default: (leave empty if not using Llama models)
5+
# LLAMA_CLOUD_API_KEY=
6+
7+
# The provider for the AI models to use.
8+
# ----------------------------------------
9+
# Compulsory: Define which AI model provider to use. This could be 'openai', 'llama', etc.
10+
# Default: 'openai'
11+
MODEL_PROVIDER=openai
12+
13+
# The name of the LLM model to use.
14+
# ----------------------------------------
15+
# Compulsory: Specify the LLM model name. This depends on the provider.
16+
# Default: 'gpt-4o-mini' (an example model name)
17+
MODEL=gpt-4o-mini
18+
19+
# Name of the embedding model to use.
20+
# ----------------------------------------
21+
# Compulsory: Define the embedding model name.
22+
# Default: 'text-embedding-3-small' (an example model name)
23+
EMBEDDING_MODEL=text-embedding-3-small
24+
25+
# Dimension of the embedding model to use.
26+
# ----------------------------------------
27+
# Compulsory: Set the dimensionality of the embedding model.
28+
# Default: 1536 (an example dimension)
29+
EMBEDDING_DIM=1536
30+
31+
# The questions to help users get started (multi-line).
32+
# ----------------------------------------
33+
# Compulsory: Provide a comma-separated list of starter questions.
34+
# Example: 'Tell me about CognitiveLab, What are some open source projects, Tell me about Open Source AI, What are AI Agents'
35+
CONVERSATION_STARTERS="What is RAG?\nWhat is Llama Index?"
36+
37+
# The OpenAI API key to use.
38+
# ----------------------------------------
39+
# Compulsory: Set your OpenAI API key here.
40+
OPENAI_API_KEY=
41+
42+
# Temperature for sampling from the model.
43+
# ----------------------------------------
44+
# Optional: Set the temperature for controlling the randomness of the model's output.
45+
# Default: (leave empty to use provider's default)
46+
# LLM_TEMPERATURE=
47+
48+
# Maximum number of tokens to generate.
49+
# ----------------------------------------
50+
# Optional: Define the maximum number of tokens the model should generate in a single response.
51+
# Default: (leave empty to use provider's default)
52+
# LLM_MAX_TOKENS=
53+
54+
# The number of similar embeddings to return when retrieving documents.
55+
# ----------------------------------------
56+
# Optional: Specify how many top-K similar embeddings to return.
57+
# Default: (leave empty to use provider's default)
58+
# TOP_K=
59+
60+
# The time in milliseconds to wait for the stream to return a response.
61+
# ----------------------------------------
62+
# Compulsory: Set the stream timeout duration.
63+
# Default: 60000 milliseconds (60 seconds)
64+
STREAM_TIMEOUT=60000
65+
66+
# The qualified REST URL of the Qdrant server.
67+
# ----------------------------------------
68+
# Compulsory: Provide the full URL for the Qdrant server.
69+
# Example: 'http://localhost:6333'
70+
QDRANT_URL=
71+
72+
# The name of Qdrant collection to use.
73+
# ----------------------------------------
74+
# Compulsory: Specify the Qdrant collection name.
75+
QDRANT_COLLECTION=
76+
77+
# Optional API key for authenticating requests to Qdrant.
78+
# ----------------------------------------
79+
# Optional: Provide an API key if authentication is required for Qdrant.
80+
QDRANT_API_KEY=
81+
82+
# The URL prefix of the server storing the images generated by the interpreter.
83+
# ----------------------------------------
84+
# Compulsory: Set the URL prefix for the file server.
85+
# Default: 'http://localhost:8000/api/files'
86+
FILESERVER_URL_PREFIX=http://localhost:8000/api/files
87+
88+
# The address to start the backend app.
89+
# ----------------------------------------
90+
# Compulsory: Specify the host address for the backend application.
91+
# Default: '0.0.0.0' (bind to all network interfaces)
92+
APP_HOST=0.0.0.0
93+
94+
# The port to start the backend app.
95+
# ----------------------------------------
96+
# Compulsory: Specify the port for the backend application.
97+
# Default: 8000
98+
APP_PORT=8000
99+
100+
# The system prompt for the AI model.
101+
# ----------------------------------------
102+
# Compulsory: Provide a system prompt to guide the AI model's behavior.
103+
# Default: 'You are a helpful assistant who helps users with their questions.'
104+
SYSTEM_PROMPT=You are a helpful assistant who helps users with their questions.
105+
106+
# An additional system prompt to add citation when responding to user questions.
107+
# ----------------------------------------
108+
# Optional: Include a prompt for the AI to add citations in its responses.
109+
SYSTEM_CITATION_PROMPT='You have provided information from a knowledge base that has been passed to you in nodes of information. Each node has useful metadata such as node ID, file name, page, etc. Please add the citation to the data node for each sentence or paragraph that you reference in the provided information. The citation format is: . [citation:<node_id>]()
110+
111+
Example:
112+
We have two nodes:
113+
node_id: xyz
114+
file_name: llama.pdf
115+
116+
node_id: abc
117+
file_name: animal.pdf
118+
119+
User question: Tell me a fun fact about Llama.
120+
Your answer:
121+
A baby llama is called "Cria" [citation:xyz]().
122+
It often lives in desert [citation:abc]().'
123+
124+
# The JWT secret key for authentication.
125+
# ----------------------------------------
126+
# Compulsory: Set the secret key for signing JWT tokens.
127+
JWT_SECRET_KEY=
128+
129+
# The JWT refresh secret key.
130+
# ----------------------------------------
131+
# Compulsory: Set the secret key for signing JWT refresh tokens.
132+
JWT_REFRESH_SECRET_KEY=
133+
134+
# MongoDB connection URI.
135+
# ----------------------------------------
136+
# Compulsory: Provide the URI for connecting to MongoDB.
137+
MONGODB_URI=
138+
139+
# The MongoDB database name.
140+
# ----------------------------------------
141+
# Compulsory: Specify the MongoDB database name.
142+
# Default: 'RAGSAAS'
143+
MONGODB_NAME=RAGSAAS
144+
145+
# Administrator email for the application.
146+
# ----------------------------------------
147+
# Compulsory: Provide the admin email for application login.
148+
ADMIN_EMAIL=admin@ragsaas.com
149+
150+
# Administrator password for the application.
151+
# ----------------------------------------
152+
# Compulsory: Set the admin password for application login.
153+
ADMIN_PASSWORD=ragsaas
154+
155+
# AWS Access Key ID for accessing AWS services.
156+
# ----------------------------------------
157+
# Compulsory: Set your AWS Access Key ID.
158+
AWS_ACCESS_KEY_ID=
159+
160+
# AWS Secret Access Key for accessing AWS services.
161+
# ----------------------------------------
162+
# Compulsory: Set your AWS Secret Access Key.
163+
AWS_SECRET_ACCESS_KEY=
164+
165+
# AWS Region for your services.
166+
# ----------------------------------------
167+
# Compulsory: Specify the AWS region where your services are hosted.
168+
AWS_REGION=
169+
170+
# The name of the S3 bucket to use.
171+
# ----------------------------------------
172+
# Compulsory: Set the name of the S3 bucket for storing files.
173+
BUCKET_NAME=
174+
175+
# Uncomment and set the following variables if you have specific values to use.
176+
# AWS_ACCESS_KEY_ID = <your-access-key-id>
177+
# AWS_SECRET_ACCESS_KEY = <your-secret-access-key>
178+
# AWS_S3_BUCKET_NAME = <your-s3-bucket-name>
179+
# AWS_REGION = <your-aws-region>

frontend/.env.example

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
1-
NEXT_SERVER_URL=
2-
NEXT_PUBLIC_CHAT_API=
1+
# Frontend Environment Configuration
2+
# ==================================
3+
4+
# Server URL
5+
# ----------
6+
# Compulsory: Set this to your server's URL
7+
NEXT_PUBLIC_SERVER_URL=
8+
9+
# Public Chat API URL
10+
# -------------------
11+
# Compulsory: This is typically derived from NEXT_SERVER_URL
12+
# We can set NEXT_PUBLIC_CHAT_API dynamically in the application
13+
NEXT_PUBLIC_CHAT_API=${NEXT_PUBLIC_SERVER_URL}/api/chat

frontend/Dockerfile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
FROM node:18-alpine AS base
2+
3+
FROM base AS deps
4+
5+
RUN apk add --no-cache libc6-compat
6+
WORKDIR /app
7+
8+
COPY package.json ./
9+
10+
RUN npm update && npm install
11+
12+
# If you want yarn update and install uncomment the bellow
13+
14+
# RUN yarn install && yarn upgrade
15+
16+
17+
18+
FROM base AS builder
19+
WORKDIR /app
20+
COPY --from=deps /app/node_modules ./node_modules
21+
COPY . .
22+
23+
RUN npm run build
24+
25+
FROM base AS runner
26+
WORKDIR /app
27+
28+
ENV NODE_ENV production
29+
RUN addgroup --system --gid 1001 nodejs
30+
RUN adduser --system --uid 1001 nextjs
31+
32+
COPY --from=builder /app/public ./public
33+
34+
RUN mkdir .next
35+
RUN chown nextjs:nodejs .next
36+
37+
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
38+
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
39+
40+
USER nextjs
41+
42+
EXPOSE 3000
43+
44+
ENV PORT 3000
45+
46+
CMD ["node", "server.js"]

frontend/next.config.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/** @type {import('next').NextConfig} */
2-
const nextConfig = {};
2+
const nextConfig = {
3+
output: "standalone",
4+
};
35

4-
export default nextConfig;
6+
export default nextConfig;

0 commit comments

Comments
 (0)