<?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 Rvermaphe on Medium]]></title>
        <description><![CDATA[Stories by Rvermaphe on Medium]]></description>
        <link>https://medium.com/@rvermaphe?source=rss-1c2eb5cd9747------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*dz9q0i_YBoNR9KpC</url>
            <title>Stories by Rvermaphe on Medium</title>
            <link>https://medium.com/@rvermaphe?source=rss-1c2eb5cd9747------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 13:07:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rvermaphe/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[Migrating from Swagger 2.0 (Springfox) to Springdoc OpenAPI in Spring Boot]]></title>
            <link>https://medium.com/@rvermaphe/migrating-from-swagger-2-0-springfox-to-springdoc-openapi-in-spring-boot-e57df768e0ea?source=rss-1c2eb5cd9747------2</link>
            <guid isPermaLink="false">https://medium.com/p/e57df768e0ea</guid>
            <category><![CDATA[springdoc]]></category>
            <category><![CDATA[openapi-specification]]></category>
            <category><![CDATA[springfox]]></category>
            <category><![CDATA[swagger2]]></category>
            <category><![CDATA[open-api]]></category>
            <dc:creator><![CDATA[Rvermaphe]]></dc:creator>
            <pubDate>Mon, 13 Oct 2025 17:33:59 GMT</pubDate>
            <atom:updated>2025-10-13T17:33:59.926Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>API documentation is crucial for modern backend applications. It enables developers and testers to explore endpoints, understand request/response structures, and integrate services seamlessly. For years, Springfox Swagger 2.0 has been the standard choice for generating API documentation in Spring Boot projects.</p><p>However, the landscape has changed. With the release of Spring Boot 3.x and the migration to Jakarta namespaces, Springfox is no longer actively maintained and faces compatibility issues. It’s time to embrace the future with <strong>Springdoc OpenAPI</strong> — a modern, actively maintained library that provides robust OpenAPI 3 support out of the box.</p><p>This comprehensive guide will walk you through the migration process step by step, ensuring a smooth transition with minimal disruption to your development workflow.</p><h3>Why Migrate to Springdoc OpenAPI?</h3><p>Before diving into the migration steps, let’s understand why this move is essential:</p><p>✅ <strong>Spring Boot 3.x Compatibility</strong> — Full support for Jakarta packages and modern Spring Boot versions</p><p>🚀 <strong>OpenAPI 3 Specification</strong> — Adopts the latest API documentation standard</p><p>⚙️ <strong>Simplified Configuration</strong> — No manual Docket configuration needed; convention over configuration</p><p>🧩 <strong>Comprehensive Integration</strong> — Built-in support for Spring Web, WebFlux, Spring Security, and Actuator</p><p>🧾 <strong>Modern UI</strong> — Enhanced Swagger UI 5+ with better user experience</p><p>📦 <strong>Active Maintenance</strong> — Regular updates and community support</p><h3>Migration Guide</h3><h4>Step 1: Remove Old Swagger Dependencies</h4><p>First, locate and remove the Springfox dependencies from your pom.xml:</p><pre>&lt;!-- Remove these dependencies --&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;io.springfox&lt;/groupId&gt;<br>    &lt;artifactId&gt;springfox-swagger2&lt;/artifactId&gt;<br>    &lt;version&gt;2.7.0&lt;/version&gt;<br>&lt;/dependency&gt;<br><br>&lt;dependency&gt;<br>    &lt;groupId&gt;io.springfox&lt;/groupId&gt;<br>    &lt;artifactId&gt;springfox-swagger-ui&lt;/artifactId&gt;<br>    &lt;version&gt;2.7.0&lt;/version&gt;<br>&lt;/dependency&gt;</pre><p>Delete both dependencies completely from your project.</p><h4>Step 2: Add Springdoc OpenAPI Dependency</h4><p>Replace the removed dependencies with Springdoc OpenAPI:</p><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;org.springdoc&lt;/groupId&gt;<br>    &lt;artifactId&gt;springdoc-openapi-starter-webmvc-ui&lt;/artifactId&gt;<br>    &lt;version&gt;2.6.0&lt;/version&gt;<br>&lt;/dependency&gt;</pre><blockquote>💡 <strong>Pro Tip:</strong> Always check the <a href="https://github.com/springdoc/springdoc-openapi/releases">Springdoc releases page</a> for the latest stable version.</blockquote><h4>Step 3: Remove Docket Bean Configuration</h4><p>In Swagger 2.0, you likely had a configuration class similar to this:</p><pre>@Configuration<br>@EnableSwagger2<br>public class SwaggerConfig {<br>    <br>    @Bean<br>    public Docket api() {<br>        return new Docket(DocumentationType.SWAGGER_2)<br>                .select()<br>                .apis(RequestHandlerSelectors.basePackage(&quot;com.example&quot;))<br>                .paths(PathSelectors.any())<br>                .build()<br>                .apiInfo(apiInfo());<br>    }<br><br>    private ApiInfo apiInfo() {<br>        return new ApiInfo(<br>                &quot;User Service API&quot;,<br>                &quot;API documentation for User Service&quot;,<br>                &quot;1.0&quot;,<br>                &quot;Terms of service&quot;,<br>                new Contact(&quot;Shubham&quot;, &quot;www.example.com&quot;, &quot;shubham@example.com&quot;),<br>                &quot;License of API&quot;,<br>                &quot;API license URL&quot;,<br>                Collections.emptyList());<br>    }<br>}</pre><p><strong>Good news!</strong> You can delete this entire configuration class. Springdoc handles API documentation automatically through classpath scanning and Spring’s component detection.</p><h4>Step 4: Add OpenAPI Configuration (Optional)</h4><p>While Springdoc works out of the box, you may want to customize your API metadata. Here’s how to create an optional OpenAPI configuration:</p><pre>@Configuration<br>public class OpenApiConfig {<br><br>    @Bean<br>    public OpenAPI customOpenAPI() {<br>        return new OpenAPI()<br>                .info(new Info()<br>                        .title(&quot;User Service API&quot;)<br>                        .version(&quot;1.0&quot;)<br>                        .description(&quot;API documentation for User Service&quot;)<br>                        .contact(new Contact()<br>                                .name(&quot;Shubham&quot;)<br>                                .email(&quot;shubham@example.com&quot;)<br>                                .url(https://medium.com/&quot;www.example.com&quot;)));<br>    }<br>}</pre><p>This configuration gives you full control over your API documentation metadata while keeping things clean and straightforward.</p><h4>Step 5: Access Swagger UI</h4><p>After restarting your application, the Swagger UI is available at:</p><pre>http://localhost:8080/swagger-ui/index.html</pre><p>The OpenAPI specification (in JSON format) is accessible at:</p><pre>http://localhost:8080/v3/api-docs</pre><p>For YAML format, use:</p><pre>http://localhost:8080/v3/api-docs.yaml</pre><h4>Step 6: Exposing Actuator Endpoints in Swagger (Optional)</h4><p>If you want to include Spring Boot Actuator endpoints in your Swagger UI, add the following configuration to your application.yml:</p><pre>springdoc:<br>  show-actuator: true<br>  paths-to-match: /api/**, /actuator/**</pre><p>This configuration ensures both your custom API endpoints and health/metrics endpoints are visible and testable through Swagger UI.</p><h4>Step 7: Adding Security Configuration (Optional)</h4><p>If your API requires authentication headers (like x-auth-token), you can configure them in Swagger UI:</p><pre>@Bean<br>public OpenAPI customOpenAPI() {<br>    return new OpenAPI()<br>            .addSecurityItem(new SecurityRequirement().addList(&quot;x-auth-token&quot;))<br>            .components(new Components()<br>                    .addSecuritySchemes(&quot;x-auth-token&quot;,<br>                            new SecurityScheme()<br>                                    .type(SecurityScheme.Type.APIKEY)<br>                                    .in(SecurityScheme.In.HEADER)<br>                                    .name(&quot;x-auth-token&quot;)))<br>            .info(new Info()<br>                    .title(&quot;User Service API&quot;)<br>                    .version(&quot;1.0&quot;)<br>                    .description(&quot;API documentation for User Service&quot;));<br>}</pre><p>This allows users to enter their authentication token directly in the Swagger UI “Authorize” dialog, making API testing much more convenient.</p><h3>Common Annotation Changes</h3><p>Here’s a quick reference for annotation changes you might need to make:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bFwNtomWwpeOIlvW9rtDFw.png" /></figure><h3>Additional Configuration Options</h3><p>Springdoc offers many configuration properties. Here are some useful ones for application.yml:</p><pre>springdoc:<br>  api-docs:<br>    path: /api-docs<br>  swagger-ui:<br>    path: /swagger-ui.html<br>    operationsSorter: method<br>    tagsSorter: alpha<br>  packages-to-scan: com.example.controller<br>  paths-to-match: /api/**</pre><h3>Testing Your Migration</h3><p>After migration, verify that:</p><ol><li>✅ Swagger UI loads successfully at the new URL</li><li>✅ All endpoints are visible and correctly documented</li><li>✅ Request/response models are properly displayed</li><li>✅ Authentication mechanisms work as expected</li><li>✅ Custom configurations are applied correctly</li></ol><h3>Conclusion</h3><p>Migrating from Swagger 2.0 (Springfox) to Springdoc OpenAPI is straightforward and brings significant benefits. With better Spring Boot 3.x compatibility, OpenAPI 3 support, and a more streamlined configuration approach, Springdoc is the clear choice for modern Spring Boot applications.</p><p>The migration typically takes less than an hour for most projects, and the improved developer experience makes it well worth the effort. Your API documentation will be more maintainable, better supported, and ready for the future of Spring Boot development.</p><p><strong>Resources:</strong></p><ul><li><a href="https://springdoc.org/">Springdoc OpenAPI Documentation</a></li><li><a href="https://swagger.io/specification/">OpenAPI 3 Specification</a></li><li><a href="https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide">Spring Boot 3 Migration Guide</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e57df768e0ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Managing State in Angular with NgRx: A Hands-On Guide]]></title>
            <link>https://medium.com/@rvermaphe/managing-state-in-angular-with-ngrx-a-hands-on-guide-59259e739ae2?source=rss-1c2eb5cd9747------2</link>
            <guid isPermaLink="false">https://medium.com/p/59259e739ae2</guid>
            <category><![CDATA[ngrx-store]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[state-management]]></category>
            <category><![CDATA[ngrx]]></category>
            <category><![CDATA[redux]]></category>
            <dc:creator><![CDATA[Rvermaphe]]></dc:creator>
            <pubDate>Mon, 13 Oct 2025 17:01:57 GMT</pubDate>
            <atom:updated>2025-10-13T17:01:57.835Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Introduction</strong></h3><p>State management is a key component in building scalable applications. Angular provides multiple ways to manage state, each with its pros and cons. In this blog, we focus on <strong>NgRx</strong> as a state management solution. We’ll explore how to manage state in an Angular application using a <strong>Recipe Admin Dashboard</strong> example.</p><h3>What is NgRx?</h3><p>NgRx is a framework for building reactive applications in Angular, inspired by the Redux pattern. It unifies events in your application and derives state using <strong>RxJS</strong>.</p><p>At a high level:</p><ul><li><em>NgRx maintains a </em><strong><em>single state</em></strong><em> for the application.</em></li><li><strong><em>Actions</em></strong><em> express changes to this state.</em></li><li><em>Ideal for applications with complex states, multiple data sources, and frequent user interactions.</em></li></ul><h3>How Does NgRx Work?</h3><p>NgRx is composed of <strong>five main components</strong>: <strong>Store, Actions, Reducers, Selectors, and Effects</strong>.</p><p>NgRx follows a <strong>unidirectional data flow</strong>, making application state predictable and easier to debug. Note that this flow applies only to the state management layer, not the presentation layer.</p><h3>NgRx State Management Lifecycle</h3><figure><img alt="NgRx State Management LifeCycle diagram" src="https://cdn-images-1.medium.com/max/1024/1*LmOkWDDQy19QATh6Nro_Fw.png" /></figure><h3>NgRx Components and Examples</h3><ol><li><strong>Store</strong></li></ol><p><em>Acts as the application’s single source of truth, similar to a client-side database. It reflects the current state of the app at any given time.</em></p><pre>// app.state.ts<br>export interface AppState {<br>  counter: number;<br>}<br><br>// app.module.ts<br>import { StoreModule } from &#39;@ngrx/store&#39;;<br>import { counterReducer } from &#39;./counter.reducer&#39;;<br><br>@NgModule({<br>  imports: [<br>    StoreModule.forRoot({ counter: counterReducer })<br>  ]<br>})<br>export class AppModule {}</pre><p><strong>2. Actions</strong></p><p><em>Actions are unique events in your application — ranging from user interactions to network requests — that communicate what should change in the state.</em></p><pre>// counter.actions.ts<br>import { createAction } from &#39;@ngrx/store&#39;;<br><br>export const increment = createAction(&#39;[Counter] Increment&#39;);<br>export const decrement = createAction(&#39;[Counter] Decrement&#39;);<br>export const reset = createAction(&#39;[Counter] Reset&#39;);</pre><p><strong>3. Reducers</strong></p><p><em>Reducers handle </em><strong><em>state transitions</em></strong><em>. They are </em><strong><em>pure functions</em></strong><em> that take the current state and an action, then return a new state without side effects.</em></p><pre>// counter.reducer.ts<br>import { createReducer, on } from &#39;@ngrx/store&#39;;<br>import { increment, decrement, reset } from &#39;./counter.actions&#39;;<br><br>export const initialState = 0;<br><br>export const counterReducer = createReducer(<br>  initialState,<br>  on(increment, (state) =&gt; state + 1),<br>  on(decrement, (state) =&gt; state - 1),<br>  on(reset, () =&gt; 0)<br>);</pre><p><strong>4. Selectors</strong></p><p><em>Selectors are </em><strong><em>pure functions</em></strong><em> that retrieve slices of the state from the Store. They allow components to listen to state changes efficiently.</em></p><pre>// counter.selectors.ts<br>import { AppState } from &#39;./app.state&#39;;<br><br>export const selectCounter = (state: AppState) =&gt; state.counter;</pre><p>Usage in a component:</p><pre>counter$ = this.store.select(selectCounter);</pre><p><strong>5. Effects</strong></p><p><em>Effects handle </em><strong><em>side effects</em></strong><em> triggered by Actions, such as calling external APIs or dispatching other actions to update different parts of the state.</em></p><pre>// counter.effects.ts<br>import { Injectable } from &#39;@angular/core&#39;;<br>import { Actions, createEffect, ofType } from &#39;@ngrx/effects&#39;;<br>import { increment } from &#39;./counter.actions&#39;;<br>import { tap } from &#39;rxjs/operators&#39;;<br><br>@Injectable()<br>export class CounterEffects {<br>  logIncrement$ = createEffect(() =&gt;<br>    this.actions$.pipe(<br>      ofType(increment),<br>      tap(() =&gt; console.log(&#39;Increment action dispatched!&#39;))<br>    ),<br>    { dispatch: false }<br>  );<br><br>  constructor(private actions$: Actions) {}<br>}</pre><h3>Summary</h3><p>NgRx provides a structured approach to state management in Angular applications. By using <strong>Store, Actions, Reducers, Selectors, and Effects</strong>, you can:</p><ul><li><em>Keep your application state </em><strong><em>predictable and centralized</em></strong></li><li><em>Handle </em><strong><em>complex state interactions</em></strong><em> efficiently</em></li><li><em>Maintain </em><strong><em>scalable and maintainable code</em></strong></li></ul><p>Using this pattern, even large applications like a Recipe Admin Dashboard can manage state cleanly and reactively.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59259e739ae2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GPTs vs Assistants API: Exploring the Differences and Use Cases]]></title>
            <link>https://medium.com/@rvermaphe/gpts-vs-assistants-api-exploring-the-differences-and-use-cases-b2aba9fb357b?source=rss-1c2eb5cd9747------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2aba9fb357b</guid>
            <category><![CDATA[custom-gpt-models]]></category>
            <category><![CDATA[assistant-api]]></category>
            <category><![CDATA[open-ai-api]]></category>
            <category><![CDATA[openai-assistant-api]]></category>
            <dc:creator><![CDATA[Rvermaphe]]></dc:creator>
            <pubDate>Mon, 30 Sep 2024 15:13:47 GMT</pubDate>
            <atom:updated>2024-09-30T15:13:47.701Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aGDqVbtQ4F94eJOvafpU0g.png" /></figure><p>In the rapidly evolving landscape of artificial intelligence (AI), two prominent tools are revolutionizing how we interact with AI: <strong>Custom GPTs</strong> and <strong>Assistant APIs</strong>. Both offer unique capabilities for building AI-driven solutions, but they differ significantly in how they’re designed, their use cases, and how developers or non-developers can interact with them.</p><p>Let’s dive into a detailed comparison of GPTs vs. Assistant APIs, to understand which tool is the right fit for your needs.</p><h3>What Are GPTs?</h3><p>GPTs (Generative Pre-trained Transformers) are powerful language models that can generate human-like text. With OpenAI’s <strong>Custom GPTs</strong>, users can create personalized versions of ChatGPT to perform specific tasks or answer queries based on provided instructions and data. The main appeal of GPTs is that they can be <strong>built without technical knowledge or coding</strong>.</p><p>Some key features of GPTs:</p><ul><li><strong>No coding required</strong>: Users can create GPTs without programming.</li><li><strong>Easy setup</strong>: By providing instructions and uploading custom knowledge (e.g., PDFs, documents), GPTs can be trained quickly.</li><li><strong>Custom behavior</strong>: Users can modify how GPTs respond to different scenarios or commands.</li><li><strong>Shareable</strong>: You can make your GPT public or keep it private for internal use.</li></ul><h3>What Are Assistant APIs?</h3><p><strong>Assistant APIs</strong>, on the other hand, are more developer-focused tools that allow you to integrate sophisticated conversational AI into your applications, products, or services. Unlike GPTs, <strong>Assistant APIs require technical expertise</strong>, making them a better fit for developers looking to implement AI-driven features within apps or websites.</p><p>Some key features of Assistant APIs:</p><ul><li><strong>Developer-centric</strong>: Requires coding knowledge and API integration.</li><li><strong>Flexible integration</strong>: Designed to fit into custom applications, websites, and services.</li><li><strong>Control over context</strong>: Developers have full control over how the assistant interacts, responds, and accesses data.</li><li><strong>Scalable</strong>: Ideal for businesses looking to integrate AI at a large scale within their products or platforms.</li></ul><h3>Key Differences: GPTs vs Assistant APIs</h3><p><strong>1. Technical Expertise</strong></p><ul><li><strong>GPTs</strong>: Anyone with basic knowledge of AI or ChatGPT can create a custom GPT. No coding or deep technical knowledge is needed. The process is guided through an easy-to-use interface.</li><li><strong>Assistant APIs</strong>: These require a background in development, API integration, and backend systems to implement. Assistant APIs are intended for developers building custom AI solutions into applications.</li></ul><p><strong>2. Customization Level</strong></p><ul><li><strong>GPTs</strong>: Custom GPTs allow users to train the model by uploading knowledge and providing specific instructions, but the customization is limited to what the platform supports.</li><li><strong>Assistant APIs</strong>: With APIs, developers have complete control over customization — allowing them to design an assistant from scratch, defining everything from the user flow to external integrations.</li></ul><p><strong>3. Ease of Use</strong></p><ul><li><strong>GPTs</strong>: With GPTs, the process is streamlined, and even non-developers can use a point-and-click interface to create their own models.</li><li><strong>Assistant APIs</strong>: Working with APIs requires writing code, setting up environments, and managing more complex workflows.</li></ul><p><strong>4. Data Integration</strong></p><ul><li><strong>GPTs</strong>: You can upload documents, PDFs, and other data to train your GPT and keep it up-to-date beyond the model’s pre-trained data.</li><li><strong>Assistant APIs</strong>: APIs allow you to pull data from any source, making them more versatile in terms of real-time data handling, database connections, and external APIs.</li></ul><p><strong>5. Use Cases</strong></p><ul><li><strong>GPTs</strong>: Best suited for creating specialized conversational agents that can handle particular tasks (e.g., customer support, content generation) with minimal setup. Perfect for small businesses, educators, or individuals.</li><li><strong>Assistant APIs</strong>: Ideal for enterprise-level applications, e-commerce platforms, and highly customized AI assistants that require real-time data, external integrations, or deep customization.</li></ul><h3>When to Choose GPTs</h3><ul><li><strong>No technical background</strong>: If you’re a non-developer or want a quick solution without diving into code, GPTs are perfect.</li><li><strong>Specialized knowledge tasks</strong>: For tasks like answering FAQs, providing customer support, or handling repetitive queries, custom GPTs work efficiently.</li><li><strong>Rapid prototyping</strong>: GPTs can be created and deployed quickly for immediate use.</li></ul><h3>When to Choose Assistant APIs</h3><ul><li><strong>You need deep customization</strong>: For businesses or developers looking for full control over how the assistant behaves, integrates with services, and interacts with users, APIs are the way to go.</li><li><strong>Complex environments</strong>: If you’re building AI into applications with multiple data sources, dynamic content, or advanced functionality (e.g., booking systems, e-commerce support), APIs provide the flexibility needed.</li><li><strong>Large-scale deployment</strong>: If your goal is to integrate AI into a large enterprise system, the scalability and adaptability of Assistant APIs make them the right choice.</li></ul><h3>Conclusion: GPTs or Assistant APIs?</h3><p>The choice between GPTs and Assistant APIs ultimately depends on your goals and technical expertise:</p><ul><li>If you’re looking for a <strong>low-code, easy-to-use AI assistant</strong>, GPTs provide a fast and flexible solution.</li><li>If you’re a <strong>developer</strong> or business with <strong>advanced AI needs</strong>, the customization and power of Assistant APIs offer far more control over your assistant’s capabilities.</li></ul><p>Both tools are revolutionary in their own right, giving users the power to leverage AI in more creative and impactful ways. Whether you’re building a personal chatbot or integrating an AI assistant into your business operations, you now have the tools to do it, tailored to your specific needs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2aba9fb357b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating Custom GPTs: Building AI for Specific Tasks Without Coding]]></title>
            <link>https://medium.com/@rvermaphe/creating-custom-gpts-building-ai-for-specific-tasks-without-coding-106d8194a123?source=rss-1c2eb5cd9747------2</link>
            <guid isPermaLink="false">https://medium.com/p/106d8194a123</guid>
            <category><![CDATA[customgpt]]></category>
            <category><![CDATA[building-custom-gpts]]></category>
            <category><![CDATA[building-your-custom-gpt]]></category>
            <category><![CDATA[gpt]]></category>
            <dc:creator><![CDATA[Rvermaphe]]></dc:creator>
            <pubDate>Mon, 30 Sep 2024 14:46:31 GMT</pubDate>
            <atom:updated>2024-09-30T14:47:40.889Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/970/0*m3xRr5vrdssPW2zK" /></figure><p>The advancements in AI have unlocked incredible opportunities for users to build their own custom GPTs (Generative Pre-trained Transformers). OpenAI now allows users to create customized versions of ChatGPT without the need for any technical or coding knowledge. Whether you’re looking to automate a task, provide specialized knowledge, or enhance an interaction, you can craft a GPT tailored to your specific needs by simply guiding it with instructions and additional data. Here’s a step-by-step breakdown of how you can create your custom GPT and start using it effectively.</p><h4>What Are Custom GPTs?</h4><p><strong>GPTs </strong>are the custom version of ChatGPT that users can build without any technical knowledge, or any coding and we can train them to perform specific task by providing set of instructions and Knowledge (our own set of data).</p><p>With custom GPTs, you can:</p><ul><li>Train the model to handle specific tasks.</li><li>Provide a unique set of instructions or knowledge.</li><li>Utilize your own data (e.g., PDFs, documents) to ensure the GPT can answer or process queries based on up-to-date or specialized information.</li></ul><p>You can choose to make your custom GPT public or private depending on your usage preferences, and it’s a great way to leverage the power of AI for personal, business, or organizational purposes.</p><h4>Why Create Custom GPTs?</h4><p>Benefits of Custom GPTs:</p><ul><li><strong>Tailored Solutions:</strong> You can build a GPT that perfectly fits your needs, whether it’s for customer support, data analysis, or any other task.</li><li><strong>No Coding Required:</strong> Anyone can create a GPT by simply following the steps — no technical knowledge or programming skills are necessary.</li><li><strong>Enhanced Performance:</strong> By uploading relevant and up-to-date information, you ensure that your GPT performs effectively even in niche areas.</li><li><strong>Private or Public Use:</strong> You control whether your GPT is accessible to everyone or kept for private, internal use.</li></ul><p><strong>Some of the GPT’s made by Open Ai</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KAzUZKRJKuLPMEVpgtnr9g.png" /></figure><h4>Who Can Create Custom GPTs?</h4><p>Custom GPTs are accessible to <strong>ChatGPT Plus</strong> or <strong>Enterprise</strong> users. You can begin creating your own GPTs at <a href="http://chat.openai.com/gpts/editor">chat.openai.com/create</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pHAZnTyZLkqe7KT7QXMK4Q.png" /></figure><h3>Steps to Create Your Custom GPT</h3><h4><strong>1. Sign in to ChatGPT Plus or Enterprise Subscription</strong></h4><ul><li>Once you’re signed in, navigate to GPT Editor <a href="http://chat.openai.com/gpts/editor"><em>http://chat.openai.com/gpts/editor</em></a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6EzwcCNQGvDa7OpkQfc5pg.png" /></figure><h4><strong>2. Select “Create a GPT”</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7FbKxJkkeK2piBYhZ23dyw.png" /></figure><ul><li>In the “Create” tab, you’ll be guided by a GPT Builder that simplifies the creation process. <br>For example, you can prompt it to create a GPT that helps new Youtubers grop thier new Youtube Channel</li></ul><h4><strong>3. Name and Profile Picture</strong></h4><ul><li>After specifying your task, the builder will suggest a name for the GPT, though you can provide your own. You will also be prompted to generate a profile picture using DALL-E, OpenAI’s image generation tool.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i4xtwfnhDi426Kp_GDsVhA.png" /></figure><h4><strong>4. Fine-Tune with Questions</strong></h4><ul><li>The builder will ask questions to refine your GPT. These questions help customize the behavior and scope of the GPT based on your needs.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*Rlm22hBuMB-f5G0q9bytHA.png" /></figure><h4><strong>5. Configure Advanced Settings</strong></h4><p>Once your GPT is shaped, head over to the <strong>Configure</strong> tab for more customization options.</p><ul><li><strong>Instructions:</strong> Add or update specific instructions on how your GPT should behave, react, or process information.</li><li><strong>Conversation Starters:</strong> Customize pre-set prompts that help users interact with the GPT.</li><li><strong>Knowledge Update:</strong> This feature allows you to upload additional files or data (such as PDFs or Word documents) to update the GPT’s knowledge. This is crucial if your GPT needs to provide real-time or industry-specific information that is beyond the scope of GPT-4’s original dataset.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*OZXOmzoVfOSuYXgzEn85mg.png" /></figure><h4><strong>6. Final Steps: Save and Share Your GPT</strong></h4><p>Once you’ve fine-tuned the GPT, you can:</p><ul><li><strong>Save</strong> it and choose to share it with a select group of people, or publish it publicly for broader use.</li><li>After confirming, the GPT will appear in your left sidebar, where you can access and edit it as needed. This feature provides flexibility to tweak the GPT as your requirements evolve.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/179/1*zggrFizDY71Bw1S3o9Wz5A.png" /></figure><p>After confirmation it will be available on left side bar from where we can edit if needed.</p><h3>Customizing the Builder Profile</h3><p>You can also personalize the builder profile to provide information about the organization or entity behind the GPT. In the profile section, you can add:</p><ul><li>The name of the organization.</li><li>A website or link for users to learn more about your GPT.</li></ul><p>This helps in creating transparency and providing credibility, especially for business-oriented GPTs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T9BjVuEdAJEZ0GDfaLUXrw.png" /></figure><h3>Final Thoughts</h3><p>The ability to create custom GPTs empowers users to automate tasks, generate insights, and provide specialized services without needing deep technical expertise. Whether for personal use, business, or organizational needs, custom GPTs are revolutionizing how we interact with AI. With the flexibility to customize knowledge and instructions, you can ensure that your GPT evolves alongside your growing needs.</p><p>By embracing custom GPTs, you not only enhance productivity but also make AI work for your unique challenges.</p><p>So, dive in and start building your own GPT at <a href="http://chat.openai.com/gpts/editor">chat.openai.com/gpts/editor</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=106d8194a123" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Database Migration in Java Jersey Application with Flyway]]></title>
            <link>https://medium.com/@rvermaphe/database-migration-in-java-jersey-application-with-flyway-3265abc7ca85?source=rss-1c2eb5cd9747------2</link>
            <guid isPermaLink="false">https://medium.com/p/3265abc7ca85</guid>
            <category><![CDATA[flywaydb]]></category>
            <category><![CDATA[flyway]]></category>
            <category><![CDATA[db-migration]]></category>
            <category><![CDATA[enterprise-application]]></category>
            <category><![CDATA[flyway-integration]]></category>
            <dc:creator><![CDATA[Rvermaphe]]></dc:creator>
            <pubDate>Fri, 20 Sep 2024 12:17:23 GMT</pubDate>
            <atom:updated>2024-09-20T12:17:23.899Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/307/0*Za3ZcnaQYliZHHKP" /></figure><p><strong>Flyway</strong> is a database migration tool that helps you manage and apply database changes in a consistent and reliable way. It is designed to be easy to use and integrate with your existing tools and frameworks, and it works with a wide range of databases.</p><h3>Why Flyway with Jersey?</h3><p>Flyway is a robust and easy-to-use database migration tool. When using <strong>Spring Boot</strong>, it provides a highly declarative way to manage database changes with minimal setup. Jersey, however, lacks built-in lifecycle management and dependency integration like Spring, so we need to explicitly handle Flyway migrations at the application’s startup before serving any requests.</p><p>The programmatic approach is perfect for scenarios where we need more control, especially in complex systems like microservices where timing and dependency on the database state are critical.</p><h3>Steps to Integrate Flyway with a Java Jersey Application:</h3><h4>1. Add Flyway Dependency</h4><p>The first step to integrating Flyway into a Jersey application is adding the Flyway library to your project. For Maven users, this is as simple as adding the following to your pom.xml:</p><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;org.flywaydb&lt;/groupId&gt;<br>    &lt;artifactId&gt;flyway-core&lt;/artifactId&gt;<br>    &lt;version&gt;10.18.0&lt;/version&gt; &lt;!-- Replace with the latest stable version --&gt;<br>&lt;/dependency&gt;</pre><p>For Gradle users, add the following to your build.gradle:</p><pre>implementation &#39;org.flywaydb:flyway-core:10.18.0&#39;</pre><p>This dependency allows you to use Flyway’s API to manage database migrations.</p><h4>2. Create a FlywayListener Class</h4><p>Since Jersey lacks the built-in migration handling provided by Spring Boot, you’ll need to manage Flyway’s execution through a ServletContextListener. This listener will be invoked when the application starts and will run the Flyway migrations before the Jersey application begins serving requests and clean up resources during shutdown.</p><p>Here’s how you can create the FlywayListener class with proper cleanup logic:</p><pre>import org.flywaydb.core.Flyway;<br>import javax.servlet.ServletContextEvent;<br>import javax.servlet.ServletContextListener;<br>import javax.servlet.annotation.WebListener;<br>import java.sql.Driver;<br>import java.sql.DriverManager;<br>import java.sql.SQLException;<br>import java.util.Enumeration;<br><br>@WebListener<br>public class FlywayListener implements ServletContextListener {<br><br>    @Override<br>    public void contextInitialized(ServletContextEvent sce) {<br>        // Configure Flyway programmatically<br>        Flyway flyway = Flyway.configure()<br>            .dataSource(&quot;jdbc:mysql://localhost:4001/your_db&quot;, &quot;username&quot;, &quot;password&quot;)  // Provide your DB details<br>            .locations(&quot;classpath:db/migration&quot;)  // Specify the location of migration scripts<br>            .load();<br>        // Run Flyway migration<br>        try {<br>            flyway.migrate();<br>            System.out.println(&quot;Flyway migration completed successfully.&quot;);<br>        } catch (Exception e) {<br>            // Handle migration failure<br>            System.err.println(&quot;Flyway migration failed: &quot; + e.getMessage());<br>            throw new RuntimeException(e);<br>        }<br>    }<br><br>    @Override<br>    public void contextDestroyed(ServletContextEvent sce) {<br>        // Cleanup JDBC drivers to prevent memory leaks<br>        Enumeration&lt;Driver&gt; drivers = DriverManager.getDrivers();<br>        while (drivers.hasMoreElements()) {<br>            Driver driver = drivers.nextElement();<br>            try {<br>                DriverManager.deregisterDriver(driver);<br>            } catch (SQLException e) {<br>                e.printStackTrace();<br>            }<br>        }<br>        System.out.println(&quot;ServletContext destroyed, JDBC drivers unregistered.&quot;);<br>    }<br>}</pre><h4>3. Organize your Migration SQL Files</h4><p>Flyway detects and applies database migrations from a set location, which in this case is specified as classpath:db/migration. To match this setup, you’ll need to create your migration scripts and store them in this directory within your project.</p><p>For example, if you want to initialize a users table, you would create a migration file called V1.0__create_users_table.sql in src/main/resources/db/migration:</p><pre>-- V1__init.sql<br>CREATE TABLE users (<br>    id BIGINT PRIMARY KEY,<br>    username VARCHAR(50) NOT NULL,<br>    password VARCHAR(100) NOT NULL<br>);</pre><p>Flyway will automatically detect this file and run it during application startup, ensuring that the schema is up-to-date before any HTTP requests are handled.</p><h4>Flyway migration filename pattern:</h4><p>There is already a folder created where to put the migration file; it is located at resources/db/migration. However, the name of the file must follow a specific pattern:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/0*J0X-MWb_5JpVrTer.png" /><figcaption>Flyway migration filename pattern</figcaption></figure><p>Flyway migration file pattern</p><ul><li><strong>Part 1:</strong> It is the letter “v” in uppercase. The name always starts with this letter.</li><li><strong>Part 2:</strong> It is the migration version; it can be 1, 001, 1.2.3, 2021.09.24.12.55.32, … you got it.</li><li><strong>Part 3:</strong> It is the two underscores (_)</li><li><strong>Part 4:</strong> The description of the migration; you can separate words with an underscore or a space.</li><li><strong>Part 5:</strong> It is the extension of the file .sql</li></ul><h4>4. Register FlywayListener</h4><p>Jersey applications can automatically pick up ServletContextListener classes annotated with @WebListener. This means that by simply annotating our FlywayListener class with @WebListener, we’ve registered it to be executed during the application’s lifecycle.</p><p>However, if you’re using a web.xml file for configuration, you can register the listener manually as follows:</p><pre>&lt;listener&gt;<br>    &lt;listener-class&gt;com.example.FlywayListener&lt;/listener-class&gt;<br>&lt;/listener&gt;</pre><h4>5. Handling Errors</h4><p>One key consideration in complex applications is how to handle migration failures. If Flyway encounters an issue while applying a migration, it will throw an exception. In our case, we decided to log the error and halt the application startup if a migration fails:</p><pre>try {<br>    flyway.migrate();<br>} catch (Exception e) {<br>    // Log error and possibly halt application<br>    System.err.println(&quot;Flyway migration failed: &quot; + e.getMessage());<br>    throw new RuntimeException(e);<br>}</pre><p>This ensures that the application doesn’t proceed if the database is not in the expected state.</p><h4>Benefits of the programatic approach:</h4><p>Using a programmatic approach with Flyway in Jersey gives more <strong>control</strong> over:</p><ul><li><strong>Migration Timing</strong>: Ensures migrations complete before handling requests.</li><li><strong>Environment Flexibility</strong>: Easily customize migration strategies for different environments (e.g., development vs. production).</li><li><strong>Error Handling</strong>: Handle migration errors manually for better control in critical applications.</li></ul><h4>Conclusion</h4><p>While integrating Flyway with Jersey requires more setup than Spring Boot, it offers flexibility and control, ensuring the database is always up-to-date before the application starts. This approach is ideal for complex applications or microservices that rely on consistent database states for smooth operation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3265abc7ca85" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>