<?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 Samet Haymana on Medium]]></title>
        <description><![CDATA[Stories by Samet Haymana on Medium]]></description>
        <link>https://medium.com/@abdulsamethaymana?source=rss-e7ffb6dcdb7d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*c2jusZY2E91C3OBkuC4rxg.jpeg</url>
            <title>Stories by Samet Haymana on Medium</title>
            <link>https://medium.com/@abdulsamethaymana?source=rss-e7ffb6dcdb7d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 12:21:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abdulsamethaymana/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[I Tried Fine-Tuning Qwen with LoRA Using Unsloth — Here's What I Learned]]></title>
            <link>https://medium.com/@abdulsamethaymana/i-tried-fine-tuning-qwen-with-lora-using-unsloth-heres-what-i-learned-657ced97aca5?source=rss-e7ffb6dcdb7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/657ced97aca5</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Samet Haymana]]></dc:creator>
            <pubDate>Tue, 10 Jun 2025 19:38:55 GMT</pubDate>
            <atom:updated>2025-06-10T20:02:05.678Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vVZnM8l2bB0yRdV0" /><figcaption>Photo by <a href="https://unsplash.com/@ninjason?utm_source=medium&amp;utm_medium=referral">Jason Leung</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>So I’ve been playing around with open-source language models lately — mostly just curiosity, but also to understand how this stuff actually works under the hood.</p><p>This week, I tried something I hadn’t done before:<br>Training a Qwen model using LoRA and the Unsloth library.</p><p>If those words sound unfamiliar, don’t worry — they were kinda fuzzy for me too at first. But once I got into it, I found it surprisingly doable (with a few bumps, of course).</p><p>Here’s how it went — and what I wish I knew before I started.</p><h3>🧠 Why Qwen + LoRA + Unsloth?</h3><p>Quick version:</p><p>Qwen is a solid open-source LLM from Alibaba. Clean architecture, strong performance, and less hype than Llama or Mistral.</p><p>LoRA (Low-Rank Adaptation) lets you fine-tune big models without needing crazy GPUs or cloud bills. It only trains a few parts of the model.</p><p>Unsloth is a new library that makes this whole process faster and more memory efficient — especially if you’re using Colab or consumer GPUs.</p><p>Basically: I wanted to fine-tune a smart, open model… on my own hardware… without needing a PhD in tensor algebra.</p><h3>⚙️ Getting Set Up</h3><p>Unsloth made the setup surprisingly smooth.</p><pre>pip install unsloth</pre><p>Then I loaded the Qwen model like this:</p><pre>from unsloth import FastLanguageModelmodel</pre><pre>model, tokenizer = FastLanguageModel.from_pretrained(<br>    model_name = &quot;Qwen/Qwen1_5-0.5B&quot;,<br>    max_seq_length = 2048,<br>    dtype = &quot;auto&quot;,<br>    load_in_4bit = True,<br>) </pre><p>I ran it on a local machine with a single 24GB GPU, and it actually fit. LoRA makes that possible.</p><h3>🧪 The Training: What I Tried</h3><p>I fine-tuned it on a small dataset — basically a JSON of chat-style instructions. A few hundred examples to start. Nothing huge, just enough to test:</p><p>Does it actually learn my style?</p><p>Does it overfit?</p><p>How long does it take?</p><p>Turns out: with LoRA, training took under an hour. And the model responses did change — more concise, more aligned with my prompt style.</p><p>I used Unsloth’s built-in trainer with a few tweaks:</p><pre>FastLanguageModel.prepare_for_training(model, use_gradient_checkpointing=True)</pre><pre>trainer = SFTTrainer(<br>    model=model,<br>    tokenizer=tokenizer,<br>    train_dataset=train_dataset,<br>    dataset_text_field=&quot;text&quot;,<br>    max_seq_length=2048,<br>    args=TrainingArguments(<br>        per_device_train_batch_size=2,<br>        gradient_accumulation_steps=4,<br>        num_train_epochs=3,<br>        logging_steps=10,<br>        output_dir=&quot;./qwen-lora&quot;,<br>        save_strategy=&quot;epoch&quot;,<br>    ),<br>)</pre><blockquote>Key tip: Use gradient_checkpointing=True if your GPU is tight on memory. It slows things down a bit but lets you train larger sequences.</blockquote><h3>💡 What Worked (and What Didn’t)</h3><p>✅ What worked:</p><p>Unsloth is fast. It’s noticeably quicker than plain HuggingFace trainer.</p><p>Qwen is easy to fine-tune and seems more flexible than I expected.</p><p>LoRA made the training super efficient — no overheating, no weird memory crashes.</p><h3>❌ What didn’t work:</h3><p>Some answers were repetitive at first — I fixed this by cleaning the training data more carefully.</p><p>Tokenizer mismatches caused a few headaches. Make sure you always load the Qwen tokenizer that matches your model.</p><h3>🧠 Is It Worth Doing?</h3><p>Honestly? Yeah. Especially if you:</p><p>Want a local/custom chatbot for specific tasks</p><p>Don’t want to rely on OpenAI or expensive APIs</p><p>Are curious about how training actually works under the hood</p><p>I wouldn’t call it “easy,” but it’s way more doable now than even six months ago.</p><h3>🚀 What’s Next?</h3><p>Next, I want to try:</p><p>Training with larger Qwen models (maybe 1.8B)</p><p>Multi-turn conversations and more natural dialogue</p><p>Comparing Unsloth + Qwen to Mistral or TinyLlama</p><p>If you’re thinking of trying it — do it. Don’t wait for perfect data or a huge GPU. Just start small. You’ll learn way more by doing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=657ced97aca5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Let AI Help Me Build a Rust Project for a Week — Here's What Actually Happened]]></title>
            <link>https://medium.com/@abdulsamethaymana/i-let-ai-help-me-build-a-rust-project-for-a-week-heres-what-actually-happened-ae3d691991fe?source=rss-e7ffb6dcdb7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae3d691991fe</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[llm-applications]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Samet Haymana]]></dc:creator>
            <pubDate>Mon, 09 Jun 2025 16:41:49 GMT</pubDate>
            <atom:updated>2025-06-09T16:41:49.377Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mumBNXWd4KRR552_" /><figcaption>Photo by <a href="https://unsplash.com/@mrsunburnt?utm_source=medium&amp;utm_medium=referral">Xu Haiwei</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>So I’ve been curious for a while about all the hype around AI coding tools. ChatGPT, GitHub Copilot, Cursor IDE — people keep saying these tools will “change how we write code.”</p><p>I wanted to see for myself.</p><p>So I gave myself a challenge:<br>Let AI help me build something real for one week — not just small scripts or tutorials, but an actual project. I picked Rust (because I like pain, apparently) and started working on a small framework for building AI agents — like little async modules that can pass messages and act independently.</p><p>Oh, and I did the whole thing inside Cursor, the AI-powered IDE that comes with ChatGPT built right in.</p><p>Here’s how it went.</p><h3>🧪 Day 1: Letting AI Take the Wheel</h3><p>I started by sketching out what I wanted: something like an agent system with a runner, message bus, async execution, and so on.</p><p>I wrote a few comments and started typing, and to be honest, Copilot was pretty solid. It filled in a lot of the boilerplate without me asking. Cursor’s inline AI chat was also nice — I could highlight code and say things like:</p><blockquote>&gt; “Can you turn this into a trait with async functions?”</blockquote><p>It actually worked most of the time.</p><p>It wasn’t perfect, but for setting up basic files, adding crates, and dealing with Rust’s ultra-picky compiler, it felt like having a helpful junior dev sitting next to me. One who doesn’t sleep.</p><h3>😵 Day 3: The Limits Are Real</h3><p>Here’s where things got frustrating.</p><p>I was working on agent communication — basically, sending messages between async tasks. I asked AI to help me build a message queue. It gave me a clean-looking solution.</p><p>But it was wrong.</p><p>Not totally wrong — just missing the details that matter in Rust, like thread safety and ownership. It was using shared state, but without proper locking or Send + Sync traits. If I had copied that code blindly, it would’ve caused all kinds of runtime issues.</p><p>I tried explaining the problem to the AI. It kind of understood, but still made mistakes. At this point, I realized: AI can write code, but it doesn’t really “get” Rust. At least not like a human who’s wrestled with the borrow checker for weeks does.</p><h3>🔧 Day 5: Working with It, Not Against It</h3><p>I changed how I used the tools.</p><p>Instead of asking AI to build things from scratch, I started using it for:</p><p>Boilerplate (error types, config parsing, etc.)</p><p>Generating unit tests</p><p>Refactoring</p><p>Explaining error messages (Cursor’s “Explain” button is 🔥 for this)</p><p>Basically, I stopped treating it like a senior engineer and more like a coding assistant. When I did that, things got a lot smoother.</p><p>Also, it made me realize how much mental space I waste on stuff that doesn’t matter. AI helped me skip past that and get back to the fun parts — thinking about design, logic, architecture.</p><h3>🤔 So… Did It Help?</h3><p>Yeah. Definitely.</p><p>It didn’t do the work for me. But it made the work lighter. I spent less time googling syntax and more time thinking about how agents should interact, how to keep things async-safe, and how to build a framework that someone else might actually want to use.</p><p>It’s not magic, and it’s not replacing developers anytime soon. But honestly? I’ll keep using this setup.</p><p>Cursor + Rust + AI isn’t perfect — but it’s a pretty damn good combo if you know how to guide it.</p><p>If you&#39;re working with Rust and haven’t tried AI tools yet, give it a shot. Just don’t trust them blindly. You still need to know what you’re doing — but with the right setup, AI makes coding feel a bit more fun again.</p><p>Let me know if you want to see more of the framework I’m building — happy to share what I learned from the design side too.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae3d691991fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Will AI Take Our Jobs as Software Engineers?]]></title>
            <link>https://medium.com/@abdulsamethaymana/will-ai-take-our-jobs-as-software-engineers-aacccdfb88db?source=rss-e7ffb6dcdb7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/aacccdfb88db</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Samet Haymana]]></dc:creator>
            <pubDate>Sun, 08 Jun 2025 19:13:50 GMT</pubDate>
            <atom:updated>2025-06-08T19:13:50.858Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FNIVu2u1j8pdoLV0" /><figcaption>Photo by <a href="https://unsplash.com/@saradasish?utm_source=medium&amp;utm_medium=referral">Saradasish Pradhan</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This is the big question, right?<br>AI tools like ChatGPT and GitHub Copilot are getting smarter. Some people are worried — “Will AI replace me?” Others say, “Nah, it’ll just change how we work.”</p><blockquote>So... should we be worried?</blockquote><p>Honestly, maybe a little.<br>Some companies might lay off devs if AI helps do basic tasks faster. Especially junior-level stuff. We’ve already seen some of that.</p><p>But here’s the other side: AI isn’t magic. It still needs humans to guide it, build on top of it, test it, fix bugs, and make smart decisions.</p><p>AI will kill some jobs, but also create new ones</p><p>Just like the internet or mobile apps did.<br>More AI means more tools, platforms, products — and that means more engineering work, not less.</p><blockquote>What should we do?</blockquote><p>Learn how to use AI tools (make them work for you)</p><p>Focus on creative problem-solving, not just writing code</p><p>Stay curious — new industries are growing fast with AI</p><h3>Final thought</h3><p>AI might change the job, but it won’t kill it. Software engineers just need to evolve a bit. We’ve done it before — and we’ll do it again.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aacccdfb88db" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simple Key-Value Database]]></title>
            <link>https://medium.com/@abdulsamethaymana/simple-key-value-database-4a99c6dca307?source=rss-e7ffb6dcdb7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a99c6dca307</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[key-value-database]]></category>
            <dc:creator><![CDATA[Samet Haymana]]></dc:creator>
            <pubDate>Wed, 13 Mar 2024 21:31:17 GMT</pubDate>
            <atom:updated>2024-03-13T21:34:16.220Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a first challenger series article. In this article we are trying to build very basic key value database. The concept is basic benchmark we will not cover concurrency, security, thread safety like concept that wen expecting a database structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*We_7ir61ne3NUCoxYuqxNQ.png" /></figure><p>In meanwhile you already design application in your mind :)</p><pre>struct DB {<br>    storage: PathBuf,<br>}<br><br>trait Storage {<br>    async fn store(&amp;self, key: &amp;String, val: &amp;String);<br>    async fn retrive(&amp;self, key: &amp;String) -&gt; Option&lt;String&gt;;<br>}<br><br>fn calculate_hash&lt;T: Hash + ?Sized&gt;(t: &amp;T) -&gt; u64 {<br>    let mut s = DefaultHasher::new();<br>    t.hash(&amp;mut s);<br>    s.finish()<br>}</pre><p>We will be storing value in file where name is hash of key with using default hash function of rust optimized for collisions.</p><p>Implementing Storage trait for Db struct like</p><pre>impl Storage for DB {<br>    async fn store(&amp;self, key: &amp;String, val: &amp;String) {<br>        let file_name = format!(<br>            &quot;{}/{}&quot;,<br>            &amp;self.storage.to_str().unwrap(),<br>            &amp;calculate_hash(&amp;key).to_string()<br>        );<br><br>        let path = Path::new(&amp;file_name);<br><br>        // Check if the file exists<br>        let file_exists = tokio::fs::metadata(path).await.is_ok();<br><br>        let file_result = if file_exists {<br>            OpenOptions::new()<br>                .write(true)<br>                .truncate(true)<br>                .open(path)<br>                .await<br>                .ok()<br>        } else {<br>            File::create(path).await.ok()<br>        };<br><br>        if let Some(mut file) = file_result {<br>            let _ = file.write_all(val.as_bytes()).await.ok();<br>        }<br>    }<br>    <br>    async fn retrive(&amp;self, key: &amp;String) -&gt; Option&lt;String&gt; {<br>        let file_name = format!(<br>            &quot;{}/{}&quot;,<br>            &amp;self.storage.to_str().unwrap(),<br>            &amp;calculate_hash(&amp;key).to_string()<br>        );<br><br>        let path = Path::new(&amp;file_name);<br><br>        let mut file = match File::open(path).await {<br>            Ok(file) =&gt; file,<br>            Err(_) =&gt; return None,<br>        };<br><br>        let mut content = String::new();<br><br>        match file.read_to_string(&amp;mut content).await {<br>            Ok(_) =&gt; Some(content),<br>            Err(_) =&gt; None,<br>        }<br>    }<br>}<br><br><br>impl DB {<br>    async fn new(path: String) -&gt; Self {<br>        let _path = PathBuf::from(&amp;path);<br><br>        if let Err(e) = fs::create_dir(&amp;path).await {<br>            if e.kind() != ErrorKind::AlreadyExists {<br>                panic!(&quot;{:?}&quot;, e)<br>            }<br>        }<br><br>        DB {<br>            storage: PathBuf::from(path),<br>        }<br>    }<br><br>    async fn set(&amp;self, key: &amp;String, val: &amp;String) {<br>        self.store(key, val).await<br>    }<br><br>    async fn get(&amp;self, key: &amp;String) -&gt; Option&lt;String&gt; {<br>        self.retrive(key).await<br>    }<br>}<br></pre><p>With above code implementation with store function storing values by hash of key like hash table and retrieving direct by key with hashing also simply error handling.</p><p>Now you have fully functional interesting database tats named “My Stupid Database”</p><p>Is this simple implementation fast?</p><p>Before dive into benchmarks lets test our db</p><pre>#[cfg(test)]<br>mod tests {<br>    use super::*;<br><br>    #[tokio::test]<br>    async fn test_set() {<br>        let db = DB::new(&quot;test&quot;.to_string()).await;<br>        db.set(&amp;&quot;Samet&quot;.to_string(), &amp;&quot;Samet&quot;.to_string()).await;<br>    }<br><br>    #[tokio::test]<br>    async fn test_get() {<br>        let db = DB::new(&quot;test&quot;.to_string()).await;<br>        db.set(&amp;&quot;Samet&quot;.to_string(), &amp;&quot;Samet&quot;.to_string()).await;<br>        let result = db.get(&amp;&quot;Samet&quot;.to_string()).await;<br>        assert_eq!(result, Some(&quot;Samet&quot;.to_string()));<br>    }<br>}</pre><p>Run test with cargo command</p><pre>cargo test</pre><h3>Benchmark</h3><p>This section we will test our Db features with high load, considering this is not thread safe in I/O operations over disk we did not do any limitation or locking, the data storing structure very bad for every key created new file and there is no zipping also we did not organize file structure for optimized read/write, So this implementation will showing us worst case.</p><p>First Step, writing 5M key for testing write capability.</p><pre>async fn write_keys_in_batches(db: Arc&lt;DB&gt;, batch_size: usize, concurrency_limit: usize) {<br>    let semaphore = Arc::new(Semaphore::new(concurrency_limit));<br>    let mut handles = Vec::new();<br><br>    let start = Instant::now();<br><br>    for i in 0..5_000_000 {<br>        let db = db.clone();<br>        let key = i.to_string();<br>        let val = i.to_string();<br>        let permit = semaphore.clone().acquire_owned().await.unwrap();<br><br>        let handle = tokio::task::spawn(async move {<br>            db.set(&amp;key, &amp;val).await;<br>            drop(permit);<br>        });<br><br>        handles.push(handle);<br><br>        if handles.len() &gt;= batch_size {<br>            for handle in handles.drain(..) {<br>                let _ = handle.await;<br>            }<br>        }<br>    }<br><br>    // Wait for any remaining tasks to complete<br>    for handle in handles {<br>        let _ = handle.await;<br>    }<br><br>    let duration = start.elapsed();<br><br>    println!(<br>        &quot;Writing time for 50_000_000 key, take {:?} microseconds&quot;,<br>        duration.as_millis()<br>    );<br>}</pre><p>Lets look at reading capability with calculating average latency, with retrieving running over 100k reading query</p><pre>async fn avarage_time_taken(db: Arc&lt;DB&gt;) {<br>    let mut total = 0;<br>    let mut count = 0;<br>    for _ in 1000..500_000 {<br>        let start = Instant::now();<br>        let _ = db.get(&amp;&quot;10000&quot;.to_string()).await;<br>        let duration = start.elapsed();<br><br>        count += 1;<br>        total += duration.as_micros();<br>    }<br><br>    if count &gt; 0 {<br>        let average = total / count;<br>        println!(&quot;Average reading time taken: {} microseconds&quot;, average);<br>    } else {<br>        println!(&quot;No operations were performed.&quot;);<br>    }<br>}</pre><h3>Execution and Result</h3><p>This tests made with Thinkpad AMD Ryzen 7 3700U processor 16 GB ram computer. Rust code build with release mode.</p><pre>cargo build --release</pre><p>Result</p><pre>Writing time for 50_000_000 key, take 141335 microseconds<br>Average reading time taken: 33 microseconds</pre><p>And the size of this dummy database is</p><pre>samet@samet:  du -sh test/<br>7,1G test/</pre><h3>Conclusion</h3><p>The result are incredible, writing 50M test key just take 0.14 sec and average retrieving time is about 40 microsecond but the size of these structure is 7 GB for 50M for values less then 8 bytes.</p><p>This experimental implementation show us with good design and good concurrency implementation we can achieve very good performance driven simple key-value database, further I will work on this.</p><p>Repo: <a href="https://github.com/SametHaymana/simple_key_value">https://github.com/SametHaymana/simple_key_value</a><br>Linkedin: <a href="https://www.linkedin.com/in/samet-haymana/">https://www.linkedin.com/in/samet-haymana/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a99c6dca307" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Local Development Environment With Docker & Docker-Compose]]></title>
            <link>https://medium.com/@abdulsamethaymana/local-development-environment-with-docker-docker-compose-46ef631bcfde?source=rss-e7ffb6dcdb7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/46ef631bcfde</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[docker-compose]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <dc:creator><![CDATA[Samet Haymana]]></dc:creator>
            <pubDate>Sun, 10 Mar 2024 13:21:18 GMT</pubDate>
            <atom:updated>2024-03-10T13:21:18.358Z</atom:updated>
            <content:encoded><![CDATA[<p>Make it easy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*rV7508sejt8MHxRBTvGJNg.png" /></figure><p>When you will develop a program working one people or a team not meter need a development environment in your local machine.</p><p>“It was working on localhost” :)</p><p>In time of continuous development we don’t want to unexpected wrong things to happen on your product that already in production and we also want to make easy everything to your teammate and devOps teams.</p><p>In this short blog we will cover how to create image your app with Dockerfile and how to write docker-compose file for easy start everything.</p><p>For this situation we assume that creating a typescript app. Lets firstly look at our example package.json file.</p><pre>{<br>  &quot;name&quot;: &quot;test App&quot;,<br>  &quot;main&quot;: &quot;index.js&quot;,<br>  &quot;scripts&quot;: {<br>    &quot;build&quot;: &quot;tsc&quot;,<br>    &quot;start&quot;: &quot;node lib/index.js&quot;,<br>    &quot;dev&quot;: &quot;nodemon --watch &#39;src/**/*.ts&#39; --exec &#39;ts-node&#39; src/index.ts&quot;,<br>    <br>  },<br>  &quot;author&quot;: &quot;Tomahawk&quot;,<br>}</pre><p>You can see we have building, starting and development scripts. When in development we just run dev script and nodemon directly detect any changes in source directory and run app again with changes. We will use this script to make developer life easy. I will not cover other script and also other files like “tsconfig.json”.</p><p>Now lets talk briefly what is Docker and what is Dockerfile. Docker is a platform that allows developer build, package and deploy application in a containerized format. With using docker easily create, deploy and manage our app in any Os or Cloud providers.</p><p>Lets create a Dockerfile for generate image of our app.</p><pre>FROM node:18-alpine<br>WORKDIR /app<br>COPY . .<br>RUN npm i<br>RUN npm run build<br>EXPOSE ${PORT}<br>CMD [ &quot;npm&quot;, &quot;start&quot;]</pre><p>Now time to create compose file</p><pre>version: &#39;3.8&#39;<br>services:<br>  app:<br>    build: .<br>    ports:<br>      - &quot;8000:80&quot;<br>    environment:<br>      POSTGRES_USER: user<br>      POSTGRES_PASSWORD: password<br>      POSTGRES_DB: mydatabase<br>      POSTGRES_HOST: db<br>      REDIS_URL: redis://redis:6379/0<br>    depends_on:<br>      - db<br>      - redis<br>  db:<br>    image: postgres:13<br>    environment:<br>      POSTGRES_USER: user<br>      POSTGRES_PASSWORD: password<br>      POSTGRES_DB: mydatabase<br>    volumes:<br>      - postgres_data:/var/lib/postgresql/data<br>  redis:<br>    image: redis:6<br>    volumes:<br>      - redis_data:/data<br><br>volumes:<br>  postgres_data:<br>  redis_data:</pre><p>When you start docker compose “docker-compose up -d” it will download PostgreSql, Redis and build our project with docker file described above, also supply connection detail from environments. ( always get credentials from environments never embed)</p><h3>Next Step</h3><p>We have development environment this project now easy to start working on it. Now start to build testing environment…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46ef631bcfde" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>