<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Zarrar Shaikh on Medium]]></title>
        <description><![CDATA[Stories by Zarrar Shaikh on Medium]]></description>
        <link>https://medium.com/@zlash65?source=rss-7e5eab13c4b2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_qJl6LO5iBcQYaHprZqkyg.jpeg</url>
            <title>Stories by Zarrar Shaikh on Medium</title>
            <link>https://medium.com/@zlash65?source=rss-7e5eab13c4b2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 21:43:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zlash65/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building an AI Chatbot with LangChain, FastAPI & Streamlit]]></title>
            <link>https://medium.com/@zlash65/building-an-ai-chatbot-with-langchain-fastapi-streamlit-cf74f413ec15?source=rss-7e5eab13c4b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf74f413ec15</guid>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[fastapi]]></category>
            <category><![CDATA[langchain]]></category>
            <category><![CDATA[streamlit]]></category>
            <dc:creator><![CDATA[Zarrar Shaikh]]></dc:creator>
            <pubDate>Tue, 01 Jul 2025 18:36:22 GMT</pubDate>
            <atom:updated>2025-07-01T18:36:22.519Z</atom:updated>
            <content:encoded><![CDATA[<p>In this comprehensive guide, we’ll build a robust and modular AI chatbot from scratch using powerful, free-to-use large language models (LLMs) like Groq and Gemini. We’ll integrate optional web search functionality to enhance the chatbot’s responses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*wNSPXjijfLAiLGlZ9LfIcQ.gif" /><figcaption>Agentic AI Chatbot — demo</figcaption></figure><p>Throughout this project, we’ll learn,</p><ul><li>How to dynamically select AI models</li><li>Create responsive AI agents</li><li>Develop structured backend services</li><li>Design an intuitive frontend user interface</li></ul><p>By the end of this guide, we’ll have a solid understanding of how to integrate AI models into practical applications and how to maintain code modularity, enabling easy extension and future-proofing of our projects.</p><h3>Key Technologies Explained</h3><ul><li><strong>LLM (Large Language Model)</strong>: Advanced AI models capable of understanding context and generating human-like text.<br> — <a href="https://en.wikipedia.org/wiki/Large_language_model">Read more</a></li><li><strong>Groq</strong>: Provides extremely fast inference using open-source models like LLaMA. It’s free to use and ideal for rapid prototyping.<br> — <a href="https://groq.com/">Learn more</a></li><li><strong>Gemini</strong>: Google’s advanced LLM with strong performance in reasoning and dialogue tasks.<br> — <a href="https://ai.google.dev/">Explore Gemini</a></li><li><strong>LangChain</strong>: Simplifies the use of LLMs by providing tools for prompts, memory management, chaining models with various tools and APIs.<br> — <a href="https://python.langchain.com/docs/get_started/introduction">LangChain documentation</a></li><li><strong>LangGraph</strong>: A LangChain extension to structure and manage stateful AI agents, allowing complex decision-making processes.<br> — <a href="https://github.com/langchain-ai/langgraph">LangGraph Overview</a></li><li><strong>FastAPI</strong>: A modern, high-performance Python framework for quickly building robust APIs. It’s intuitive, fast, and easy to learn.<br> — <a href="https://fastapi.tiangolo.com/">FastAPI docs</a></li><li><strong>Streamlit</strong>: Enables us to build interactive and attractive web applications quickly and effortlessly using Python.<br> — <a href="https://streamlit.io/">Streamlit official site</a></li></ul><h4>Why Groq and Gemini and not OpenAI?</h4><p>We chose Groq and Gemini instead of OpenAI primarily because OpenAI models are not available for free. Groq and Gemini, on the other hand, provide free access to advanced, capable language models like LLaMA and Google’s own Gemini models, making them perfect for experimenting, learning, and prototyping without worrying about burning through our pocket money and living like a hermit for the rest of the month.</p><h3>Project Overview</h3><h4>Code Structure</h4><p>You can find the source code here — <a href="https://github.com/Zlash65/agentic-ai-chatbot-example">Zlash65/agentic-ai-chatbot-example</a></p><pre>agentic-ai-chatbot-example/<br>├── .env<br>├── requirements.txt<br>├── main.py                     # Entry point for FastAPI backend<br>├── agents/                     # Phase 1: AI Agent logic<br>│   ├── llm_provider.py         # Returns LLM instance based on provider (Groq/Gemini)<br>│   ├── tools.py                # Adds Tavily search tool if enabled<br>│   └── ai_agent.py             # Creates LangGraph agent and returns response<br>├── backend/                    # Phase 2: Backend API<br>│   ├── config.py               # Loads environment variables from .env<br>│   ├── schema.py               # Defines request structure using Pydantic<br>│   ├── router.py               # Defines /chat endpoint and handles validation<br>├── frontend/                   # Phase 3: Streamlit UI<br>│   └── streamlit_app.py        # Streamlit app for interacting with chatbot</pre><h4>System Design</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UR4h7Gl7i1SRYmOqb3YyBQ.png" /></figure><h4>Phase 1: AI Agent (LangChain &amp; LangGraph)</h4><p>In this phase, we’ll:</p><ul><li>Implement dynamic selection and initialization of Groq or Gemini LLMs based on user preference.</li><li>Integrate optional web search capabilities using Tavily.</li><li>Assemble a responsive AI agent to generate responses based on user input.</li></ul><h4>Phase 2: Backend (FastAPI)</h4><p>In this phase, we’ll:</p><ul><li>Securely load environment variables using dotenv.</li><li>Define structured request and response schemas to ensure reliable communication.</li><li>Develop a backend API endpoint (/chat) to handle frontend requests, validate input, and return AI-generated responses.</li></ul><h4>Phase 3: Frontend (Streamlit)</h4><p>In this phase, we’ll:</p><ul><li>Design an intuitive user interface for selecting models and providers.</li><li>Enable dynamic model selection to avoid mismatched combinations.</li><li>Integrate frontend with backend, enabling smooth user interaction and real-time AI responses.</li></ul><h3>Phase 1: AI Agent Configuration</h3><h4>llm_provider.py</h4><pre>from langchain_groq import ChatGroq<br>from langchain_google_genai import ChatGoogleGenerativeAI<br>from backend.config import GROQ_API_KEY, GOOGLE_API_KEY<br><br>def get_llm(model_provider: str, model_name: str):<br>  if model_provider == &quot;groq&quot;:<br>    if not GROQ_API_KEY:<br>      raise ValueError(&quot;GROQ_API_KEY is not set&quot;)<br>    return ChatGroq(model=model_name, api_key=GROQ_API_KEY)<br><br>  elif model_provider == &quot;gemini&quot;:<br>    if not GOOGLE_API_KEY:<br>      raise ValueError(&quot;GOOGLE_API_KEY is not set&quot;)<br>    return ChatGoogleGenerativeAI(model=model_name, api_key=GOOGLE_API_KEY)<br><br>  else:<br>    raise ValueError(f&quot;Invalid model provider: {model_provider}&quot;)</pre><p>This code snippet dynamically chooses the appropriate AI model provider (Groq or Gemini). We structured this code to be modular, allowing easy future addition of more LLM providers.</p><h4>tools.py</h4><pre>from langchain_community.tools.tavily_search import TavilySearchResults<br><br><br>def get_tools(allow_search: bool):<br>  tools = []<br>  if allow_search:<br>    tools.append(TavilySearchResults())<br><br>  return tools</pre><p>We conditionally include a web search tool. This gives users the flexibility to enable or disable web searching as needed.</p><h4>ai_agent.py</h4><pre>from langgraph.prebuilt import create_react_agent<br>from langchain_core.messages import SystemMessage, HumanMessage, AIMessage<br>from agents.llm_provider import get_llm<br>from agents.tools import get_tools<br><br>def get_response_from_agent(<br>  model_provider: str,<br>  model_name: str,<br>  allow_search: bool,<br>  user_messages: list[str],<br>  system_prompt: str<br>) -&gt; str:<br>  llm = get_llm(model_provider, model_name)<br>  tools = get_tools(allow_search)<br><br>  agent = create_react_agent(model=llm, tools=tools)<br><br>  state = {<br>    &quot;messages&quot;: [<br>      SystemMessage(content=system_prompt),<br>      HumanMessage(content=user_messages[-1])<br>    ]<br>  }<br><br>  response = agent.invoke(state)<br>  messages = response.get(&quot;messages&quot;, [])<br><br>  ai_messages = [msg.content for msg in messages if isinstance(msg, AIMessage)]<br>  return ai_messages[-1] if ai_messages else &quot;No response from AI&quot;</pre><p>This function is the <strong>core engine</strong> of our AI chatbot. It’s what actually calls the LLM (Groq or Gemini), optionally enables tools like web search, and returns the AI-generated message.</p><ul><li>get_llm() dynamically loads the correct model depending on the selected provider.</li><li>get_tools() returns a list of tools, like TavilySearchResults, only if allow_search is True.</li><li>We uses <strong>LangGraph’s</strong> built-in create_react_agent to construct an agent using the selected model and tools.</li><li>“ReAct” stands for <strong>Reasoning + Acting</strong> — the agent can think and take actions like calling search tools before replying.</li><li>agent.invoke() runs the agent using the defined state. The result is a dictionary with a &quot;messages&quot; key, containing a list of all replies (including tool actions, thoughts, and final answer).</li><li>We loop through the messages, filter those sent by the AI (AIMessage) and return the <strong>last one</strong>, which should be the AI’s final answer.</li></ul><pre>state = {<br>    &quot;messages&quot;: [<br>        SystemMessage(content=system_prompt),<br>        HumanMessage(content=user_messages[-1])<br>    ]<br>}</pre><p>This sets up the context for the AI agent.</p><ul><li>SystemMessage tells the agent <strong>how to behave</strong> (&quot;act like a mentor&quot;, &quot;be sarcastic&quot;, etc).</li><li>HumanMessage is the <strong>latest message</strong> from the user.</li></ul><p>🔍 <strong>Why only the last user message?</strong></p><ul><li>We’re simulating a stateless, simple interaction to keep responses fast and reduce LLM token usage.</li><li>If we passed all previous messages, the LLM would remember context and have a longer conversation memory.</li><li>We can extend this later by feeding in more HumanMessage and AIMessage history for memory support.</li></ul><h3>Phase 2: Backend Setup (FastAPI)</h3><h4>config.py</h4><pre>from dotenv import load_dotenv<br>import os<br><br>load_dotenv()<br><br>OPENAI_API_KEY = os.getenv(&quot;OPENAI_API_KEY&quot;)<br>GROQ_API_KEY = os.getenv(&quot;GROQ_API_KEY&quot;)<br>GOOGLE_API_KEY = os.getenv(&quot;GOOGLE_API_KEY&quot;)<br>TAVILY_API_KEY = os.getenv(&quot;TAVILY_API_KEY&quot;)</pre><p>Securely load environment variables from the .env file</p><h4>schema.py</h4><pre>from pydantic import BaseModel<br>from typing import List<br><br>class ChatRequest(BaseModel):<br>  model_name: str<br>  model_provider: str<br>  system_prompt: str<br>  messages: List[str]<br>  allow_search: bool</pre><p>Define structured input from the frontend.</p><h4>router.py</h4><pre>from fastapi import APIRouter<br>from backend.schema import ChatRequest<br>from agents.ai_agent import get_response_from_agent<br><br>router = APIRouter()<br><br>ALLOWED_PROVIDERS = [&quot;groq&quot;, &quot;gemini&quot;]<br>ALLOWED_MODELS = [&quot;llama-3.1-8b-instant&quot;, &quot;llama3-70b-8192&quot;, &quot;gemini-2.0-flash&quot;, &quot;gemini-2.5-flash&quot;]<br><br>@router.post(&quot;/chat&quot;)<br>def chat(request: ChatRequest):<br>  model_provider = request.model_provider.lower()<br>  model_name = request.model_name<br>  allow_search = request.allow_search<br><br>  if model_provider not in ALLOWED_PROVIDERS:<br>    raise ValueError(f&quot;Invalid model provider: {request.model_provider}. Must be one of {ALLOWED_PROVIDERS}.&quot;)<br>  if model_name not in ALLOWED_MODELS:<br>    raise ValueError(f&quot;Invalid model name: {model_name}. Must be one of {ALLOWED_MODELS}.&quot;)<br><br>  response = get_response_from_agent(<br>    model_provider=model_provider,<br>    model_name=model_name,<br>    allow_search=allow_search,<br>    user_messages=request.messages,<br>    system_prompt=request.system_prompt<br>  )<br><br>  return { &quot;response&quot;: response }</pre><ul><li>ALLOWED_PROVIDERS &amp; ALLOWED_MODELS — this is a <strong>safety check</strong>. We don’t want users or the frontend sending random model names or providers.<br> — If someone tries to use &quot;openai&quot; or &quot;gpt-4&quot; (which isn’t supported or is paid), it will be rejected early.<br> — Keeps the backend clean and avoids wasting resources or hitting unsupported APIs.</li><li>We define a <strong>POST</strong> endpoint at /chat<br> — The request body must match the ChatRequest model (which includes model name, provider, system prompt, message list, etc).<br> — FastAPI will <strong>auto-validate</strong> the request and raise an error if any field is missing or of the wrong type.</li><li>We extract values from the request object and block unsupported data.</li><li>We pass the validated data to get_response_from_agent(), which:<br> — Initializes the right LLM<br> — Adds search tools if needed<br> — Builds a LangGraph agent<br> — Returns a response based on system prompt + user message</li><li>The final response is returned as JSON and displayed in the chat UI.</li></ul><h3>Phase 3: Frontend Setup (Streamlit)</h3><h4>streamlit_app.py</h4><p>Please find the full code <a href="https://github.com/Zlash65/agentic-ai-chatbot-example/blob/main/frontend/streamlit_app.py"><strong>here</strong></a></p><h4>Dynamic Model Selection</h4><pre>MODEL_OPTIONS = {<br>    &quot;Groq&quot;: [&quot;llama-3.1-8b-instant&quot;, &quot;llama3-70b-8192&quot;],<br>    &quot;Gemini&quot;: [&quot;gemini-2.0-flash&quot;, &quot;gemini-2.5-flash&quot;]<br>}<br><br>model_provider = st.selectbox(&quot;🔌 Model Provider&quot;, list(MODEL_OPTIONS.keys()))<br>model_choices = MODEL_OPTIONS[model_provider]<br><br>if &quot;model_name&quot; in st.session_state and st.session_state.model_name not in model_choices:<br>    st.session_state.model_name = model_choices[0]<br><br>model_name = st.selectbox(&quot;🧠 Model Name&quot;, model_choices)</pre><p>To prevent invalid provider-model combinations, we dynamically update model selections based on the chosen provider. This ensures compatibility and smooth user interactions.</p><h3>Running our Application</h3><ul><li><strong>Backend:</strong></li></ul><pre># Terminal Tab 1<br><br>source .venv/bin/activate<br>uvicorn main:app --reload</pre><ul><li><strong>Frontend:</strong></li></ul><pre># Terminal Tab 2<br><br>source .venv/bin/activate<br>streamlit run frontend/streamlit_app.py</pre><p><strong>Here’s what the final chatbot looks like in action:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5ovXZEESscx4ND3eT2FFwg.png" /></figure><h3>🧠 Wrapping Up</h3><p>By following this detailed guide, we’ve learned how to:</p><ul><li>Dynamically integrate multiple powerful AI providers.</li><li>Construct structured backend services using FastAPI.</li><li>Create user-friendly interfaces with Streamlit.</li><li>Keep our code modular and easy to extend.</li></ul><h3>🔧 What We Can Explore Next</h3><p>Now that we have a solid foundation, here’s a few ideas to level up:</p><ul><li><strong>Add context memory</strong><br> — Right now, the chatbot replies only based on our latest message. We can add conversation memory to retain previous questions and answers, making responses smarter.</li><li><strong>Enable streaming responses</strong><br> — Stream long responses token by token for a smoother user experience (like ChatGPT does).</li><li><strong>Plug in more tools</strong><br> — Want the AI to do math, call APIs, or browse docs? LangChain has a tool for that.</li><li><strong>Deploy our app</strong><br> — Use platforms like <strong>Render</strong>, <strong>Railway</strong>, or <strong>Hugging Face Spaces</strong> to share our chatbot with the world.</li></ul><h3>🚀 Final Thoughts</h3><p>This project isn’t just a chatbot — it’s a starter kit for any LLM-powered product. Whether you&#39;re prototyping an assistant, automating research, or experimenting with multi-agent workflows, this architecture gives you room to grow.</p><p>So tweak it, break it, improve it — and most importantly, <strong>have fun while learning</strong>.</p><p>Happy building! 💻✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf74f413ec15" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Gen-AI Dockerfile Generator with AWS Bedrock and Terraform]]></title>
            <link>https://medium.com/@zlash65/build-a-gen-ai-dockerfile-generator-with-aws-bedrock-and-terraform-927f6aba0781?source=rss-7e5eab13c4b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/927f6aba0781</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[amazon-bedrock]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Zarrar Shaikh]]></dc:creator>
            <pubDate>Mon, 30 Jun 2025 14:04:01 GMT</pubDate>
            <atom:updated>2025-06-30T19:11:47.731Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s be honest — AWS is powerful but not always the friendliest thing to set up. What started as a simple curiosity — “<strong>Can I generate a Dockerfile using an Amazon Bedrock</strong>?” — quickly turned into a full-blown, end-to-end project.</p><p>In the process, I learned how to:</p><ul><li>Set up and use Amazon Bedrock</li><li>Create an AWS Lambda function that talks to an LLM</li><li>Use Terraform to build and tear down infrastructure automatically</li><li>Deal with Bedrock’s quirks and debug confusing prompt behavior</li></ul><p>If you’re new to Bedrock, this project is a great way to learn how to actually use it — not just browse through the documentation. We’ll build a real service that accepts a programming language name via an HTTP request and returns a Dockerfile generated by an LLM. All of this is done using AWS Lambda, API Gateway, S3, and Bedrock — with Terraform managing the setup.</p><p>Here’s what we’re building:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2hc9VpBOI7xNsQRBE6kTYw.png" /></figure><p>We’ll go step by step. You don’t need to know everything up front. By the end, you’ll understand how to:</p><ul><li>Configure Amazon Bedrock and request model access</li><li>Write a Python-based Lambda function that calls Bedrock</li><li>Store and retrieve files in S3 securely</li><li>Wire everything together with API Gateway</li><li>Use Terraform to deploy and manage all of it</li></ul><p>Let’s get started.</p><h3>Create an AWS Account (Skip if already have one)</h3><p>Go to <a href="https://aws.amazon.com/">aws.amazon.com</a> and create an account. Once you’re in, head to the AWS Management Console.</p><h3>Enable Bedrock and Request Model Access</h3><p>In the search bar, type <strong>Amazon Bedrock</strong> and open it. Choose a region that supports Bedrock models — I’ll use ap-south-1.</p><p>Now, on the left side, click <strong>Model access</strong> and request access to <strong>Meta Llama 3 8B Instruct</strong>. That’s the model we’ll use to generate the Dockerfile.<br>It might take a few minutes to get access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nWAr5h80BcH0e7t8gI_XMA.png" /><figcaption>AWS &gt; Amazon Bedrock</figcaption></figure><p>You can also use other model of your liking. I chose this model because of its low price and because I have been using Llama model for local LLM.</p><h3>Install Terraform CLI</h3><p>We’ll use Terraform to set up all the infrastructure — Lambda, API Gateway, IAM roles, and so on. Install Terraform CLI locally:</p><p>On macOS:</p><pre>brew tap hashicorp/tap<br>brew install hashicorp/tap/terraform</pre><p>Or follow the instructions for your OS: <a href="https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli">Install Terraform</a></p><h3>Create a Terraform Cloud Account</h3><p>Go to <a href="https://app.terraform.io/">Terraform Cloud</a> and sign up.</p><ul><li>Create a new organization. I named mine zlash65-ai-ml.</li><li>Inside the org, create a workspace named aws-bedrock-example.</li></ul><p>We’ll connect this workspace to GitHub later to deploy infrastructure from code.</p><h3>Set Up AWS Credentials for Terraform</h3><p>In the AWS Console:</p><ol><li>Go to <strong>IAM &gt; Users</strong></li><li>Create a user called Terraform User</li><li>Enable <strong>programmatic access</strong></li><li>Attach the <strong>AdministratorAccess</strong> policy</li></ol><ul><li>This gives Terraform permission to create any AWS resource</li><li>If you’re a paranoid person (and that’s valid), you can limit the scope to only services you need — like Lambda, S3, IAM, Bedrock, etc.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8STfZ8lESIN83iIHLXsy9A.png" /></figure><p>Now back in Terraform Cloud:</p><ol><li>Go to <strong>Organization Settings &gt; Variable Sets</strong></li><li>Create a new variable set</li><li>Add:</li></ol><ul><li>AWS_ACCESS_KEY_ID</li><li>AWS_SECRET_ACCESS_KEY</li></ul><p>Attach the variable set to the aws-bedrock-example workspace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yu4umlLw_R4Wceeu28aplA.png" /></figure><h3>Why Terraform?</h3><p>If you’ve never used Terraform before, think of it like this: instead of setting everything up manually in the AWS Console — clicking through pages, configuring settings, creating roles — you write everything you need in a few .tf files. Terraform reads those files and builds the infrastructure for you.</p><p>That might sound like extra work upfront, but here’s why it’s actually a huge win:</p><ul><li><strong>Trackability</strong>: Everything is written in code. You can track it in version control, collaborate with others, and roll back changes if something breaks.</li><li><strong>Reusability</strong>: Want to recreate the same setup for another region or project? Just tweak a variable and redeploy.</li><li><strong>Automation</strong>: With a single command, Terraform provisions AWS services like Lambda, API Gateway, S3, IAM roles, and more.</li><li><strong>Clean Teardown</strong>: Done with your experiment? A simple terraform destroy removes every resource you created. No more forgetting something and getting billed for it.</li></ul><p>For this project specifically, Terraform helps us avoid a manual setup that would’ve involved:</p><ul><li>Creating a Lambda function and uploading a custom package</li><li>Writing IAM roles and policies manually</li><li>Setting up an S3 bucket with the correct permissions</li><li>Building an API Gateway that connects to the Lambda function</li><li>Wiring it all together</li></ul><p>By using Terraform, we’re making this setup:</p><ul><li>Faster to build</li><li>Easier to understand</li><li>Simpler to reproduce and delete</li></ul><p>If you’re building anything that involves multiple AWS services, Terraform isn’t just a nice-to-have — it’s a necessity.</p><p>Instead of creating Lambda, S3, and API Gateway one by one, we’ll just run a command and let Terraform do the work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8iUViqIJgs55cKfwCHLSlw.png" /></figure><h3>Set Up Project Structure</h3><p>Create a GitHub repo called <strong>aws-bedrock-example</strong>. Then clone it:</p><pre>git clone https://github.com/YOUR_USERNAME/aws-bedrock-example.git<br>cd aws-bedrock-example</pre><p>Create this structure:</p><pre>aws-bedrock-example/<br>├── .gitignore<br>├── build.sh<br>├── lambda/<br>│   ├── app.py<br>│   └── requirements.txt<br>└── terraform/<br>    ├── backends.tf<br>    ├── bedrock.tf<br>    ├── main.tf<br>    ├── outputs.tf<br>    ├── providers.tf<br>    └── variables.tf</pre><p>Add <a href="https://github.com/Zlash65/aws-bedrock-example/blob/main/.gitignore"><strong>.gitignore</strong></a> and <a href="https://github.com/Zlash65/aws-bedrock-example/blob/main/.terraformignore"><strong>.terraformignore</strong></a> with Python and Terraform-specific ignores.</p><h3>Write Lambda Code</h3><p>We’ll use <strong>Python</strong> and <strong>boto3</strong> to talk to Amazon Bedrock.</p><p>Add the following to <a href="https://github.com/Zlash65/aws-bedrock-example/blob/main/lambda/requirements.txt"><strong>requirements.txt</strong></a></p><pre>boto3</pre><h4>Lambda Code: Unpacked</h4><p>The <a href="https://github.com/Zlash65/aws-bedrock-example/blob/main/lambda/app.py"><strong>app.py</strong></a> file is the heart of our project. Here&#39;s a breakdown of what each function does.</p><h4>✅ generate_dockerfile(language: str) -&gt; str</h4><p>This function creates a structured prompt and sends it to Amazon Bedrock to generate a Dockerfile based on the language input.</p><pre>def generate_dockerfile(language: str) -&gt; str:<br>  formatted_prompt = f&quot;&quot;&quot;<br>  ONLY generate an ideal Dockerfile for {language} with best practices. Do not provide any explanation.<br>  Include:<br>  - Base image<br>  - Installing dependencies<br>  - Setting working directory<br>  - Adding source code<br>  - Running the application<br>  &quot;&quot;&quot;</pre><p>We build a plain prompt that tells the model exactly what to return. Avoiding extra formatting like chat headers helps get a usable output. We’ll use a simplified prompt format (more on that later).</p><pre>body = {<br>    &quot;prompt&quot;: formatted_prompt,<br>    &quot;max_gen_len&quot;: 1024,<br>    &quot;temperature&quot;: 0.5,<br>    &quot;top_p&quot;: 0.9<br>  }</pre><p>These parameters control the model’s output length and creativity.</p><pre>try:<br>    bedrock = boto3.client(&quot;bedrock-runtime&quot;, region_name=&quot;ap-south-1&quot;,<br>                            config=botocore.config.Config(read_timeout=300, retries={&quot;max_attempts&quot;: 3}))<br>    response = bedrock.invoke_model(body=json.dumps(body), modelId=&quot;meta.llama3-8b-instruct-v1:0&quot;)</pre><pre>    response_content = response.get(&quot;body&quot;).read().decode(&quot;utf-8&quot;)<br>    response_data = json.loads(response_content)<br>    print(response_data)</pre><pre>    dockerfile = response_data[&quot;generation&quot;]<br>    return dockerfile</pre><pre>  except Exception as e:<br>    print(&quot;Error generating Dockerfile:&quot;, e)<br>    return &quot;&quot;</pre><p>This block calls Bedrock, reads the JSON response, and extracts the generated Dockerfile.</p><h4>✅ save_dockerfile(s3_key, s3_bucket, dockerfile)</h4><p>This function uploads the Dockerfile to S3 and returns a presigned URL.</p><pre>def save_dockerfile(s3_key: str, s3_bucket: str, dockerfile: str, expiry: int = 3600) -&gt; str:<br>  s3 = boto3.client(&quot;s3&quot;, region_name=&quot;ap-south-1&quot;, endpoint_url=&quot;https://s3.ap-south-1.amazonaws.com&quot;)</pre><pre>  try:<br>    s3.put_object(<br>      Body=dockerfile,<br>      Bucket=s3_bucket,<br>      Key=s3_key,<br>      ContentType=&quot;text/plain&quot;<br>    )</pre><pre>    print(&quot;Dockerfile saved to S3&quot;)</pre><p>Uploads the Dockerfile into a folder named dockerfiles/ inside the specified bucket.</p><pre>return s3.generate_presigned_url(https://medium.com/&quot;get_object&quot;,%20Params=%7B&quot;Bucket&quot;:%20s3_bucket,%20&quot;Key&quot;:%20s3_key%7D,%20ExpiresIn=expiry)</pre><p>Returns a temporary, secure URL so anyone can download the file without needing AWS credentials.</p><h4>✅ handler(event, context)</h4><p>This is the entrypoint Lambda uses when triggered by API Gateway.</p><pre>def handler(event, context):<br>    event = json.loads(event[&quot;body&quot;])<br>    language = event[&quot;language&quot;]</pre><p>Extracts the language from the incoming POST body.</p><pre>dockerfile = generate_dockerfile(language)<br>  current_time = datetime.now().strftime(&quot;%H-%M-%S&quot;)<br>  s3_bucket = &quot;zlash65-aws-bedrock-example&quot;</pre><pre>  if dockerfile:<br>    s3_key = f&quot;dockerfiles/{language}-{current_time}.Dockerfile&quot;<br>    dockerfile_url = save_dockerfile(s3_key, s3_bucket, dockerfile)<br>    return {<br>      &quot;statusCode&quot;: 200,<br>      &quot;body&quot;: json.dumps({<br>        &quot;message&quot;: &quot;Dockerfile generated&quot;,<br>        &quot;url&quot;: dockerfile_url<br>      })<br>    }<br>  else:<br>    return {<br>      &quot;statusCode&quot;: 500,<br>      &quot;body&quot;: json.dumps({&quot;message&quot;: &quot;Failed to generate Dockerfile&quot;})<br>    }If the Dockerfile was generated successfully, we:</pre><p>If the Dockerfile was generated successfully, we:</p><ul><li>Store it in S3 with a timestamped key</li><li>Generate a presigned URL</li><li>Return a 200 status with the URL</li></ul><p>If something failed, we return a 500 error.</p><h3>Create Lambda Build Script</h3><p>In the root directory, add <a href="https://github.com/Zlash65/aws-bedrock-example/blob/main/build.sh"><strong>build.sh</strong></a>:</p><pre>#!/bin/bash</pre><pre>rm -rf lambda_build lambda.zip<br>mkdir -p lambda_build</pre><pre>pip3 install -r lambda/requirements.txt -t lambda_build</pre><pre>cp lambda/app.py lambda_build<br>cd lambda_build &amp;&amp; zip -r ../lambda.zip .</pre><pre>cd ..</pre><p>Run:</p><pre>chmod +x build.sh<br>./build.sh</pre><p>This creates <strong>lambda.zip</strong> for Terraform to use.</p><h3>Write Terraform Code</h3><p>Inside the terraform/ folder, create the following files and fill them with:</p><p><a href="https://github.com/Zlash65/aws-bedrock-example/blob/main/terraform/backends.tf"><strong>backends.tf</strong></a><strong> — </strong>Connects to your Terraform Cloud workspace.</p><p><a href="https://github.com/Zlash65/aws-bedrock-example/blob/main/terraform/providers.tf"><strong>providers.tf</strong></a><strong> — </strong>Sets the AWS provider and region.</p><p><a href="https://github.com/Zlash65/aws-bedrock-example/blob/main/terraform/variables.tf"><strong>variables.tf</strong></a><strong> — </strong>Stores common variables like region.</p><p><a href="https://github.com/Zlash65/aws-bedrock-example/blob/main/terraform/outputs.tf"><strong>outputs.tf</strong></a><strong> — </strong>Outputs the API URL and Lambda function name.</p><p><a href="https://github.com/Zlash65/aws-bedrock-example/blob/main/terraform/bedrock.tf"><strong>bedrock.tf</strong></a> — This code sets up logging for Amazon Bedrock model invocations using CloudWatch Logs. Basically, if your Bedrock model fails or returns an unexpected response and you don’t see anything in the Lambda logs — this setup helps capture what’s happening behind the scenes in Bedrock itself.</p><h4><a href="https://github.com/Zlash65/aws-bedrock-example/blob/main/terraform/main.tf">main.tf</a></h4><h4>🔧 What This File Does Overall</h4><p>This Terraform file provisions everything needed to expose our Lambda function as an API, give it permissions, and wire it up to Amazon Bedrock and S3. It’s the core infrastructure-as-code file for the project.</p><ul><li>Creates a Lambda function that:<br> — Invokes Amazon Bedrock to generate Dockerfiles<br> — Stores the output in an S3 bucket</li><li>Sets up an S3 bucket to:<br> — Store the generated Dockerfiles<br> — Allow presigned access for download</li><li>Configures API Gateway to:<br> — Expose the Lambda as a public-facing HTTP POST endpoint (`/generate-dockerfile`)</li><li>Grants IAM permissions to the Lambda function so it can:<br> — Write logs to CloudWatch<br> — Read and write objects in S3<br> — Call Bedrock models via `bedrock:InvokeModel` permission</li></ul><p>In short: this file is the heart of our project infrastructure. Once applied, we get a fully working, callable API that uses AI (via Bedrock) to return a Dockerfile and give a downloadable link via S3.</p><p>Format everything:</p><pre>cd terraform<br>terraform fmt</pre><h3>Push Code to GitHub and Deploy</h3><p>Commit and push your code to GitHub.</p><pre>git add .<br>git commit -m &quot;feat: lambda and infra code for aws-bedrock-example&quot;</pre><p>Then in Terraform Cloud:</p><ul><li>Connect the repo to your aws-bedrock-example workspace</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*90fpfTFrrCgY0zAGR8mn3w.png" /></figure><ul><li>Trigger a new run</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P2eyYoyaQ1ScvWFe6QpAJA.png" /></figure><ul><li>Review and <strong>Confirm &amp; Apply</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RAtkHGbyBoo4Gw_LbXThXw.png" /></figure><p>Terraform will create everything: Lambda, Gateway, S3, permissions — all in one go.</p><h3>Test Using Postman</h3><p>Once deployed, Terraform will show the <strong>API Gateway URL</strong> in outputs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*drAZrx6aJiwxfxhoPnZ8qA.png" /></figure><p>In Postman:</p><ul><li>Set method: POST</li><li>URL: API Gateway URL from Terraform output</li><li>Body: {&quot;language&quot;: &quot;node&quot;}</li><li>Click <strong>Send</strong></li></ul><p>If everything went well, you’ll get a presigned URL pointing to your generated Dockerfile in S3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZcEGA6t8uekbhsP5vut3MA.png" /></figure><h3>Debugging: The Prompt Format Got Me</h3><p>This part tripped me up for an hour or some.</p><p>I followed <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-runtime_example_bedrock-runtime_InvokeModel_MetaLlama3_section.html">this official example</a> and wrote my prompt like this:</p><pre>formatted_prompt = f&quot;&quot;&quot;<br>&lt;|begin_of_text|&gt;&lt;|start_header_id|&gt;user&lt;|end_header_id|&gt;<br>ONLY Generate an ideal Dockerfile for {language}...<br>&lt;|eot_id|&gt;&lt;|start_header_id|&gt;assistant&lt;|end_header_id|&gt;<br>&quot;&quot;&quot;</pre><p>Looks right, but it didn’t work.</p><p>My Lambda ran fine. No errors. But the response from Bedrock was -</p><blockquote>{‘generation’: ‘’, ‘prompt_token_count’: 64, ‘generation_token_count’: 1, ‘stop_reason’: ‘stop’}</blockquote><p>Turns out this prompt format is for <strong>chat-based streaming</strong>. What I needed was a <strong>simple single-shot prompt</strong>:</p><pre>formatted_prompt = f&quot;&quot;&quot;<br>ONLY generate an ideal Dockerfile for {language} with best practices. Do not provide any explanation.<br>Include:<br>- Base image<br>- Installing dependencies<br>- Setting working directory<br>- Adding source code<br>- Running the application<br>&quot;&quot;&quot;</pre><p>Once I removed all the fancy tokens, it worked instantly.</p><p>This is also why we enabled Bedrock logging in bedrock.tf. If Lambda logs don’t help, Bedrock logs will.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9y4owXVY7fL6eAFb9J9Igw.png" /></figure><h3>Final Folder Structure</h3><pre>aws-bedrock-example/<br>├── .gitignore<br>├── .terraformignore<br>├── build.sh<br>├── lambda/<br>│   ├── app.py<br>│   └── requirements.txt<br>├── lambda.zip<br>└── terraform/<br>    ├── backends.tf<br>    ├── bedrock.tf<br>    ├── main.tf<br>    ├── outputs.tf<br>    ├── providers.tf<br>    └── variables.tf</pre><h3>🧹 Cleanup AWS Resources</h3><p>Now that our project is complete, it’s time to clean up. And because we used <strong>Terraform Cloud</strong>, deleting everything is just as easy as provisioning it.</p><p>No manual AWS cleanup. No guessing what resources you created. No surprise charges a month later. Just a few clicks.</p><p>To destroy all AWS resources via Terraform Cloud:</p><ul><li>Go to <a href="https://app.terraform.io/">Terraform Cloud</a></li><li>Open your <strong>organization</strong> and the <strong>workspace</strong> you used (e.g., aws-bedrock-example)</li><li>Click on — <strong>Workspace Settings &gt; Destruction and Deletion</strong></li><li>Click on — <strong>Queue destroy plan</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8BgSn6C_N7TE44YUC_cyKA.png" /></figure><ul><li>Wait for the plan to complete, then <strong>confirm and apply</strong> the destroy action</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iG_Cn7U9ZvTk8j-sH_pbyg.png" /></figure><p>Terraform Cloud will now safely tear down every AWS resource it created — Lambda function, S3 bucket, API Gateway, IAM roles — everything.</p><blockquote>⚠️ Important: You won’t be able to recover anything once it’s destroyed, so double-check before proceeding.</blockquote><h3>Source Code</h3><p>All the code is here: <a href="https://github.com/Zlash65/aws-bedrock-example">https://github.com/Zlash65/aws-bedrock-example</a></p><p>It’s working, simplified, and ready to be cloned.</p><p>Hopefully this helps you get started with Amazon Bedrock in a real-world project. If you hit any weird issues — start with the prompt. Always the prompt.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=927f6aba0781" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up Jitsi-Meet on your server]]></title>
            <link>https://medium.com/swlh/setting-up-jitsi-meet-on-your-server-b29ca29ef345?source=rss-7e5eab13c4b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/b29ca29ef345</guid>
            <category><![CDATA[remote-working]]></category>
            <category><![CDATA[jitsi-meet]]></category>
            <category><![CDATA[video-conferencing]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[jitsi]]></category>
            <dc:creator><![CDATA[Zarrar Shaikh]]></dc:creator>
            <pubDate>Sun, 07 Jun 2020 13:03:59 GMT</pubDate>
            <atom:updated>2025-07-01T05:22:30.175Z</atom:updated>
            <content:encoded><![CDATA[<p>What a year, isn’t it? It’s been more or less 3–4 months that we all have been away from our offices (<em>unless you work remotely</em>); work from home has become the new normal. And in these challenging times, we have all resorted to video-conferencing to handle office meetings more than ever.</p><p>You all must have used a couple of video conferencing services already. Still, if you are reading this, then you are one of those who has come to the realization that you want to have your own setup for video-conferencing and Jitsi has come to your rescue. You could be an individual setting it up for personal use, or an organization looking for an interoffice installation or probably a service provider who wants to grab the opportunity and provide a video conferencing medium to a user base.</p><p>Shout out to the creators, maintainers, and the community of Jitsi to keep an amazing open-source project up and running. If you are someone who has just accidentally stumbled upon here, you have to check out <a href="https://jitsi.org/">Jitsi</a> to know more about it, and if you feel like “Yes, this is it.”, then this blog is going to get your Jitsi server up and running in no time.</p><p>The following steps have been tested on AWS EC2 instance as well as on Azure VM, so it’s safe to say that it’ll work on others as well.</p><h3><strong>Prerequisites</strong></h3><ul><li>Clean ubuntu 18.04 installed server (haven’t tested it on other versions).</li><li>Root access to the server you want to set it up on.</li><li>Open UDP and TCP ports in your firewall settings to allow traffic to your jitsi-meet server.</li><li>Patience</li></ul><p>If you have an <strong>AWS EC2 </strong>instance, create a security group that looks like the image below and assign it to your instance before proceeding ahead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dGd36-VoELy_axMBFk7NWw.png" /></figure><p>If you are using a server from some other provider that provides a similar security group settings, make sure you match it with the above. In any case, you can also configure the ports to be open in your firewall using the below terminal commands.</p><pre>sudo ufw allow ssh</pre><pre>sudo ufw allow http</pre><pre>sudo ufw allow https</pre><pre>sudo ufw allow 10000/udp</pre><pre>sudo ufw enable</pre><h3>Step 1. Initial dependencies - Locales, Python and Nodejs</h3><p>Make sure your server is a fresh one else there are chances of something conflicting with the process. SSH into your server as a root user.</p><pre>ssh -i {path-to-your-ssh-key} user@server-ip</pre><pre>sudo su</pre><p>We will use /var/www/ as our working path.</p><pre>sudo mkdir /var/www &amp;&amp; cd /var/www</pre><pre>sudo apt-get update &amp;&amp; sudo apt-get upgrade</pre><p>Once that’s done, let’s set up some initial dependencies as Node and Python installed onto the server.</p><p><strong>Setting up locales</strong></p><pre>sudo apt-get -y install locales</pre><pre>sudo sed -i -e &#39;s/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/&#39; /etc/locale.gen &amp;&amp; locale-gen</pre><pre>sudo apt-get install -y language-pack-en-base</pre><pre>sudo dpkg-reconfigure locales</pre><pre>export LANG=”en_US.UTF-8&quot;</pre><pre>export LANGUAGE=”en_US:en”</pre><pre>export LC_ALL=”en_US.UTF-8&quot;</pre><p><strong>Setting up Python 3.7</strong></p><pre>sudo add-apt-repository ppa:deadsnakes/ppa</pre><pre>sudo apt-get update</pre><pre>sudo apt-get install -y python3.7</pre><pre>sudo apt-get install -y python3.7-dev</pre><pre>sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2</pre><pre>sudo apt-get install -y python3-pip</pre><p>Check if python3 has been successfully switched to v3.7 by typing python3 in a terminal; proceed further once you have validated it.</p><p><strong>Setting up Nodejs v10.x</strong></p><p>Why 10.x? Because I find it the least worrisome when setting up node packages. But you’re free to install a version of your choice, and it should most likely work out just fine. If it doesn’t, you can always fallback to 10.x.</p><pre>sudo apt-get remove -y python3-apt</pre><pre>sudo apt-get install -y python3-apt</pre><pre>curl -sL <a href="https://deb.nodesource.com/setup_10.x">https://deb.nodesource.com/setup_10.x</a> | sudo -E bash -</pre><pre>sudo apt-get install -y nodejs</pre><h3>Step 2. Jitsi dependencies - Lua, LuaRocks &amp; Prosody</h3><p>Now that you have completed the initial setup, we can move on to set up jitsi-meet based dependencies. You can skip this step and move on to the next, too, as mentioned in the official guide of Jitsi-Meet installation. Their quick setup is a one-liner that can set your server in no time.</p><p>However, you should follow the steps in this sequence only because soon you’d want to implement an authentication based flow in your setup; it could be jwt-token or secure-domain setup, and to set those up, you’ll need the following base configuration.</p><p><strong>Setting up Lua and LuaRocks</strong></p><pre>sudo apt-get install -y lua5.2</pre><pre>sudo apt-get install -y liblua5.2</pre><pre>sudo apt-get install -y liblua5.2-dev</pre><pre>sudo apt-get install -y luarocks</pre><pre>luarocks install basexx</pre><pre>sudo apt-get install -y libssl1.0-dev</pre><pre>luarocks install luacrypto</pre><p>Further, we also need to install some LuaRocks packages that require manual alteration, so hang in there and keep following the steps for a seamless functioning jitsi-meet server at the end.</p><pre>mkdir src</pre><pre>cd src</pre><pre>luarocks download lua-cjson</pre><pre>luarocks unpack lua-cjson-2.1.0.6-1.src.rock</pre><pre>cd lua-cjson-2.1.0.6-1/lua-cjson/</pre><p>Open lua_cjson.c file with vim or nano - vim lua_cjson.c</p><p>Edit line no. 743 and change it to read, len = lua_rawlen(l, -1);</p><p>Next, open Makefile with vim or nano - vim Makefile</p><p>Change to, LUA_INCLUDE_DIR = /usr/include/lua5.2 and save it.</p><p>Continuing the process,</p><pre>luarocks make</pre><pre>luarocks install luajwtjitsi</pre><pre>luarocks install inspect</pre><p><strong>Setting up Prosody</strong></p><pre>wget <a href="https://prosody.im/files/prosody-debian-packages.key">https://prosody.im/files/prosody-debian-packages.key</a> -O- | sudo apt-key add -</pre><pre>echo deb <a href="http://packages.prosody.im/debian">http://packages.prosody.im/debian</a> $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list</pre><pre>sudo apt-get update &amp;&amp; sudo apt-get upgrade</pre><pre>sudo apt-get install -y prosody</pre><p>Fixing permission on localhost key,</p><pre>chown root:prosody /etc/prosody/certs/localhost.key</pre><pre>chmod 644 /etc/prosody/certs/localhost.key</pre><pre>reboot</pre><p>Wait for the instance to reboot. Your ssh connection might get terminated at this point. Simply ssh back into the server in root mode and navigate to the working path that we decided at the beginning of the process.</p><h3>Step 3. Jitsi installation</h3><p>Now that all dependencies have been taken care of, we can finally get on with installing jitsi-meet on our server.</p><p><strong>Setting up the hostname for the server instance</strong></p><pre>sudo hostnamectl set-hostname {your domain name — “example.abc.xyz”}</pre><pre>sudo vim /etc/hosts</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T0H79ih59d31aSNKJP7R8A.png" /><figcaption>Add the domain name below the localhost line</figcaption></figure><p>If you already have SSL key and crt files for your domain, you can move those files to a predefined location on the server which can then be used during the installation of jitsi-meet . If you don’t have the certificates yet, no need to worry, as jitsi-meet installation allows you to create them on the go.</p><p>Follow the steps to move your SSL files from local machine to server.</p><pre>sudo mkdir /home/{your user}/ssl</pre><p>Open a new tab in the terminal to access your local machine.</p><pre>scp -i {path to your ssh key} {path to .key ssl file} user@server-ip:/home/{your user}/ssl/</pre><pre>scp -i {path to your ssh key} {path to .crt ssl file} user@server-ip:/home/{your user}/ssl/</pre><p><strong>Setting up jitsi-meet</strong></p><p>Switch back to the server tab at this point and carry on with the installation.</p><p>Follow the on-screen process. When asked for the <strong>domain name</strong>, provide the same name that you provided earlier. When asked for using existing or generating new SSL certificates, choose accordingly. If you’re using existing files that you moved onto the server, make sure you give the right file path when prompted for it.</p><pre>sh -c &quot;echo &#39;deb https://download.jitsi.org stable/&#39; &gt; /etc/apt/sources.list.d/jitsi-stable.list&quot;</pre><pre>wget -qO - https://download.jitsi.org/jitsi-key.gpg.key | sudo apt-key add -</pre><pre>sudo apt-get update &amp;&amp; sudo apt-get upgrade</pre><pre>sudo apt install jitsi-meet</pre><p>If you opted to generate SSL certificate for your setup, just run the following in the terminal and follow the on-screen prompts to complete the setup.</p><pre>/usr/share/jitsi-meet/scripts/install-letsencrypt-cert.sh</pre><h3>Bonus</h3><p>What if you have your fork of the jitsi-meet repository, and you are keen on using it? No worries, it’s just a few steps to get your fork up and running.</p><p>SSH into the server and navigate to the working directory where you can clone your fork and build it up.</p><pre>ssh -i {path to your ssh key} user@server-ip &amp;&amp; sudo su &amp;&amp; cd /var/www</pre><pre>git clone <a href="https://github.com/Zlash65/jitsi-meet.git">https://github.com/{your-github-username}/jitsi-meet.git</a></pre><pre>cd jitsi-meet &amp;&amp; git fetch origin</pre><pre>git checkout {your-branch-with-changed-code}</pre><pre>npm install</pre><pre>make</pre><p>That’s it, your version of code has been built. All you need now is to tell the server to look for the current jitsi-meet repo and the not the one that was installed by the package manager in /usr/share/jitsi-meet</p><pre>vim /etc/nginx/sites-available/{your domain name config file}</pre><pre>sudo systemctl restart nginx</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c5T1jA4diLuszWRnJ8nmgA.png" /><figcaption>Change <strong>/usr/share/jitsi-meet</strong> to <strong>/var/www/jitsi-meet</strong> throughout the file and save it.</figcaption></figure><p>That’s it, and you are done. I hope you have set your domain to point it to the server. Open your browser and browse to your domain to see if everything is working as intended.</p><h3>What my setup looks like,</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MQSO3OXv2jss_WQUPeT4AA.png" /><figcaption>Landing page customizations</figcaption></figure><ul><li>I have restricted room creation directly through my jitsi-meet domain.</li><li>Meetings can only be created from an in-app module. The restriction has been imposed by setting up jitsi-meet-tokens on our server that does a JWT validation and some source code customization to route room entry from internal system only.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M9GICtUlLK1l6O8c5p46sQ.png" /><figcaption>Incall customizations</figcaption></figure><ul><li>Meeting stats such as call start time, end time, total duration, no. of participants, etc. are all captured and sent to internal server to be recorded against the meeting id.</li><li>Enabled feedback popup to work without the existing dependency. Feedback score (mapped against meeting ID) is sent to the internal server along with the above stats.</li></ul><p>I hope you were able to follow the steps without any hassle and got your server ready. If you’re looking for setting up jitsi-meet-tokens for JWT authentication, stay tuned, as my next blog will be about setting that up.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b29ca29ef345" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/setting-up-jitsi-meet-on-your-server-b29ca29ef345">Setting up Jitsi-Meet on your server</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A year at Frappe]]></title>
            <link>https://medium.com/frapp%C3%A9-thoughts/a-year-at-frappe-ad065d440124?source=rss-7e5eab13c4b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad065d440124</guid>
            <category><![CDATA[frappe]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[workplace]]></category>
            <category><![CDATA[full-stack-development]]></category>
            <category><![CDATA[erpnext]]></category>
            <dc:creator><![CDATA[Zarrar Shaikh]]></dc:creator>
            <pubDate>Tue, 03 Jul 2018 06:53:01 GMT</pubDate>
            <atom:updated>2018-07-09T04:51:52.220Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UrK2LSLhMv_UodQ3LMUjlw.png" /></figure><p>It’s been a year since I started working at Frappe and its about time for some introspection. This isn’t going to be a tech blog or so, but instead would portray what it’s like to work at Frappe. What is it like working at Frappe — interesting, surprising, fun, inspiring, etc are just the beginning of it.</p><p>So the first thing to strike off the list would be to tell you what Frappe is. In laymen terms, Frappe is that magical framework whose existence if you’d have had known earlier then nailing college projects would have been as easy as snapping fingers. Its a Full Stack Web Framework, much like Django or Flask but unlike them at so many levels. The difference lies in the fact that Frappe provides a ton load of features out of the box — more connectors, integrations, lot of libraries, multi-tenant setup, REST api, etc. So if you want to build an application packed with lot of features, Frappe can get you started much quicker than the other frameworks.</p><p>I didn’t have any experience to work at a company probably because I wasn’t keen on working as an intern during college time or the fact that I wasn’t planning to start working right after the college at all. Got to know about the company from a friend, saw their website that stated ‘hiring now’ and I couldn’t stop myself from applying. One thing led to another and two weeks later I was there, beginning a new journey of my life. I went to work there with my own expectations on what it’d be like and what’d I end up doing.</p><p>Before I get any further I want to mention that I work here as a Software developer. The best part about working here is that there’s no hierarchy of roles. Everyone shares the same title, a developer. The kind of it may be different but the work is same — enhance, improve, improvise and fix.</p><p><strong>#5. The Once a month get together</strong></p><p>Better known as Open Day where each of us get to present what we’ve worked on in the last month. The presentation is followed by lunch - we either go out for it or we have it delivered at office. A lot of conversation takes place over the lunch. This is usually followed by another round of discussion about the roadmap and how to move forward as a Company as well as an Individual. A lot of ground breaking decisions have taken place during this time.</p><p><strong>#4. The Open Source nature</strong></p><p>Frappe has its own ecosystem — that’s right! There’s a whole community around Frappe and its flagship product ERPNext — open source ERP. The community gets to involve in the decision that are taken and the roadmap of how to move ahead. The community can also contribute in many ways that benefits them and the company at the same time. “You want a feature ? — develop it or get it developed, send a pr on Github, have it reviewed and make it available for everyone”. ERPNext also drives a foundation which is a collective convergence of different community members. I mention this because I am one of the developers that was hired through it — so kudos to the brilliant idea.</p><p><strong>#3. Its a happening place</strong></p><p>There are lot of group activities that we venture upon. Be it going for lunch or movie or maker’s fest or so much more. There’s Xbox that was played for a long time. Currently, its the Bombsquad era — played mostly on Friday every week. There was also that one successful Goa trip — and it’s worth remembering because we were there, by the beach side with our laptops answering to support queries whose count went berserk.</p><p>There’s energy and positive vibes in everyone. There are code sprints taking place in office to collectively tackle something. There are meet-ups where people whose life is touched by Frappe come along to see what’s happening and what they’d be seeing in the upcoming versions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wiFY4h5srx9bDanSsJlp6g.jpeg" /><figcaption>Mumbai Hackathon</figcaption></figure><p>Then there’s Hackathon every year organised by Frappe to challenge young budding tech-enthusiastic students to come up with their team and develop something in a limited span of time. The winner obviously takes a huge sum of money but what they all take in common is an experience — experience to work in a team, to work towards a goal, to create an impact.</p><p>There’s also a great initiative taken this year - “ESOC” (ERPNext Summer of Code), a direct spinoff of GSOC (Google Summer of Code). Engineering students are working as interns in this 3 months program to help us develop some new and exciting stuff and at the same time gain experience and knowledge for their own-self. It’s really amazing because each of these individuals brings a different set of ideas on the table and working as a team, they get to evolve and enhance their own skills.</p><p>Lastly, there’s also a conference held every year to bring together the community members, build up networking and discuss the happenings of the last one year and what should be done in the coming year.</p><p><strong>#2. The scale of your impact</strong></p><p>This is perhaps one of the best things. I remember reading somewhere - “You’re no good of a developer or coder, if what you invent is not going to be helpful to others”. Frappe might not be as big of a company (yet) but it still has a huge user base and anything you work on will probably touch hundreds of people or maybe multiple times that.</p><p>Its such a great thrill to see your work go live and in the hands of so many people. Something that was maybe just in your head or was requested upon by someone, is now a reality and in use by hundreds. There’s also that gratification when you get to learn that someone is using that feature of yours and in your head you’re like (that’s mine! that’s mine!). There’s also the thrill when you realise that something that you created takes out a tiny portion of stress, out from a user’s life, makes data a tiny bit easier to understand, makes a difference in a user’s experience.</p><p>Hence, the scale at which you can touch people and make a tiny bit of difference for someone is huge at Frappe. And because of the open source nature, you can correct something in the product and have it quickly reviewed and reflected in the product in no time.</p><p><strong>#1. Freedom of work</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fNT4o6fYZib7WxGvKha6Bw.png" /><figcaption>The one when we were working with a beach view.</figcaption></figure><p>That’s right! There’s complete freedom of work at Frappe. Freedom in the sense that you get to decide what you want to work on. Also freedom from where you want to work — there’s no one forcing you to come down to office everyday or anyone keeping an eye on you or your attendance (biometric or manual). You can come to office anytime you want or work from home. Great ideas can come to you at anytime and mostly when you’re at peace in your comfort zone which can be your home or a cafe or any place for that matter. Not having to worry about being in office at 10 or so, is a relief.</p><p>Although a great initiative, its something that you shouldn’t take advantage of. Because no one might look over you to see what you’re working on every time but at the end of the month, you’ve to present yourselves and you have to make sure that what you’ve done is substantial and has really made an impact. It’s you who should look out to your ownself and thrive to be better than what you were last month.</p><p><strong>A parting thought…</strong></p><p>Frappe is somewhat 10 years old and it has only just begun to mark its impact out there in the world. At any given point in those years, it was run by max-to-max 20 employees. It’s really astounding what the people and the company has accomplished so far. It faces many challenges and its rapidly evolving on the go and only time will tell the greatness the company will unlock.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad065d440124" width="1" height="1" alt=""><hr><p><a href="https://medium.com/frapp%C3%A9-thoughts/a-year-at-frappe-ad065d440124">A year at Frappe</a> was originally published in <a href="https://medium.com/frapp%C3%A9-thoughts">Frappe Thoughts</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>