<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: propaganisa115</title>
    <description>The latest articles on Forem by propaganisa115 (@propaganisa115).</description>
    <link>https://forem.com/propaganisa115</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F661700%2F341a6c0a-51c9-4af4-bea1-a30c0934cb9e.png</url>
      <title>Forem: propaganisa115</title>
      <link>https://forem.com/propaganisa115</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/propaganisa115"/>
    <language>en</language>
    <item>
      <title>Unlocking Lambda's Full Potential: How to Resolve Layer Size Limits and Optimize Your Serverless Experience!</title>
      <dc:creator>propaganisa115</dc:creator>
      <pubDate>Thu, 12 Oct 2023 01:57:21 +0000</pubDate>
      <link>https://forem.com/propaganisa115/unlocking-lambdas-full-potential-how-to-resolve-layer-size-limits-and-optimize-your-serverless-experience-23ep</link>
      <guid>https://forem.com/propaganisa115/unlocking-lambdas-full-potential-how-to-resolve-layer-size-limits-and-optimize-your-serverless-experience-23ep</guid>
      <description>&lt;p&gt;A while ago me and my team were facing some issues regarding the limit size of the layer in our lambda apps, it was because the library that we used are to big for layer to handle. As you can see in bellow image the size that you can uploaded is only 262 MB.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FOXl8Cdw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s4q2oa67kjk170xh0crk.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FOXl8Cdw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s4q2oa67kjk170xh0crk.jpg" alt="layer size" width="800" height="653"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At that time we were using tensor library and its related library to be used in our project because we were aiming to build an artificial intelegence apps using that lib. For your information before you go dive into this article you should know that not all project are applicable using lambda, for alternative you can use ECS or some kind of docker, but for our project we want to make pricing as efficient as possible, because when you use a service such as ECS you will be billed monthly, it was so much different than lambda which was billed for every access that was hit by apps by user.&lt;/p&gt;

&lt;p&gt;Here i will list and explain what did we do in order to fix that issue.&lt;/p&gt;

&lt;h2&gt;
  
  
  we choose which library that we need and eliminate the rest
&lt;/h2&gt;

&lt;p&gt;We are successfully optimized it and shrink it size by a half, but we still haven't succeed, so we go to the next step. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hUFOrSnn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mtvw1ty93bad4fd2jzss.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hUFOrSnn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mtvw1ty93bad4fd2jzss.png" alt="List of lib" width="800" height="575"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  We uploaded the whole project into AWS S3
&lt;/h2&gt;

&lt;p&gt;And dont forget to reshape your project to be applicable in the lambda, make its format into lambda style, dont make it as python project only *example, for example you change its main function name into &lt;/p&gt;

&lt;p&gt;&lt;code&gt;def lambda_handler(event, context):&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;when we used this method we can exceed its size into almost 400 MB for the whole project and the limit of that zip file should not exceed more than 170 MB for its final size after you zipped it. But unfortunately our project are much bigger than that.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gjzFRUek--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2oke5duf01ppemib5uzr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gjzFRUek--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2oke5duf01ppemib5uzr.png" alt="S3" width="800" height="343"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But after we try above method, finally we were decide to move the code into our separate server because the size of project are so big that lambda cannot handle, i think in that case we could learn that lambda are only suitable for small project that doesn't need big size library, but you can still tried above method if your project aren't as big as ours. But if your project is using tensor i fully recommended that you use service like ECS, docker, and etc.&lt;/p&gt;

</description>
      <category>lambda</category>
      <category>aws</category>
      <category>tensorflow</category>
      <category>s3</category>
    </item>
    <item>
      <title>Laravel 8 REST API With Sanctum Authentication</title>
      <dc:creator>propaganisa115</dc:creator>
      <pubDate>Sun, 14 Nov 2021 16:47:36 +0000</pubDate>
      <link>https://forem.com/propaganisa115/tutorial-laravel-api-4p1p</link>
      <guid>https://forem.com/propaganisa115/tutorial-laravel-api-4p1p</guid>
      <description>&lt;p&gt;The first thing you need to do when you are gonna make an Laravel API, is to install composer, you can get composer &lt;a href="https://getcomposer.org/download/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;after you finish install composer, now you can create a new laravel project, by typing bellow code in command prompt.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer create-project laravel/laravel laravel_api_1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;description:&lt;/p&gt;

&lt;p&gt;laravel_api_1 is the project name, so you can change it to your desire.&lt;/p&gt;

&lt;p&gt;and then you can go to the directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd laravel_api_1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you can try to run the project, to test wether laravel are successfully installed or not, by typing this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;so if you go to browser now, and type &lt;a href="http://localhost:8000"&gt;http://localhost:8000&lt;/a&gt;, you will see the homepage of your freshly installed project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uXvGo9g4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1tjyrazhuy65a4ik79qi.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uXvGo9g4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1tjyrazhuy65a4ik79qi.PNG" alt="Homepage" width="880" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next thing you need to do, is to settings the database in your env file, for this tutorial im gonna use sqlite database. you can find .env file in your root project directory, Change it to&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DB_CONNECTION=sqlite
DB_HOST=127.0.0.1
DB_PORT=3306
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and then you go to database directory, and create database.sqlite.&lt;/p&gt;

&lt;p&gt;if you want to use another database, such as mysql, sqlserver, that is fine you can change it as you wish.&lt;/p&gt;

&lt;p&gt;after you set your database, now we need to make a new table. type this in your comman prompt.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan make:model Product --migration
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;so you can see in the app/models there is a product.php file, and you can also find the migration file inside database/migration folder that has the name create product table.&lt;/p&gt;

&lt;p&gt;inside the migration file that been generated , you can see that there is two function, it is up and down, up is for code that we are gonna run, and down is the code that will be run when we did a rollback migration. change the schema in the up function like bellow code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Schema::create('products', function (Blueprint $table) {
            $table-&amp;gt;id();
            $table-&amp;gt;string('name');
            $table-&amp;gt;string('slug');
            $table-&amp;gt;string('description')-&amp;gt;nullable();
            $table-&amp;gt;decimal('price',5,2);
            $table-&amp;gt;timestamps();
        });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;description:&lt;/p&gt;

&lt;p&gt;nullable() : to make the field optional, and can be null or empty when you added a new data.&lt;/p&gt;

&lt;p&gt;and then run bellow code in the command prompt, to apply the migration that we have created.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan migrate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you can use db browser for sqlite, to browse the database that we have been created. you can download it in &lt;a href="https://sqlitebrowser.org/dl/"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;as you can see bellow, i can see the table have been created successfully.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ypxv1uu0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bcjr4mh71tpyb5dy9p5y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ypxv1uu0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bcjr4mh71tpyb5dy9p5y.png" alt="table products" width="880" height="712"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;the other bunch of table that you see in the database, are built in or default table by laravel.&lt;/p&gt;

&lt;p&gt;ok now lets make some route, go open file api.php inside routes table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::get('/products', function(){
    return Product::all();
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;save that, and you can test the route using postman.&lt;/p&gt;

&lt;p&gt;to download postman you can visit &lt;a href="https://www.postman.com/downloads/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;inside a postman app, enter the request url.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://localhost:8000/api/products
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and its gonna be return an empty data because we obviously didnt have any data yet. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PUSxqTxV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5sjm0ces3viz30wbshim.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PUSxqTxV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5sjm0ces3viz30wbshim.PNG" alt="response" width="880" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;as you can see in the above picture, the square bracket are representation of empty data, and the "200 ok", means that the route is worked, and you successfully access it.&lt;/p&gt;

&lt;p&gt;now lets make a post route. Before we make it,we should add a fillabel property inside Product model. Open the Product.php inside app/models. and add the following code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Product extends Model
{
    use HasFactory;
    protected $fillable = [
        'name',
        'slug',
        'description',
        'price'
    ];
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ok now we can create our post route inside routes/api.php&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::post('/products', function(){
    return Product::create([
        'name'=&amp;gt; 'Product One',
        'slug'=&amp;gt; 'product-one',
        'description'=&amp;gt; 'This is product',
        'price' =&amp;gt; '99.99'
    ]);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;lets test it in postman, choose the method post, with the same url.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mQMBY3yZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t7oroaej6w36po52ov1m.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mQMBY3yZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t7oroaej6w36po52ov1m.PNG" alt="post data" width="880" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;as you can see in the above image, it is state that 201 created, so it means the data has been created successfully, and you can see the return data that been saved in the bellow section.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>api</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>Cara membuat project baru react native menggunakan Expo</title>
      <dc:creator>propaganisa115</dc:creator>
      <pubDate>Thu, 26 Aug 2021 18:56:28 +0000</pubDate>
      <link>https://forem.com/propaganisa115/cara-membuat-project-baru-react-native-menggunakan-expo-3a3p</link>
      <guid>https://forem.com/propaganisa115/cara-membuat-project-baru-react-native-menggunakan-expo-3a3p</guid>
      <description>&lt;p&gt;Untuk memulai membuat project baru react native caranya mudah sekali,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;install npm&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;install yarn&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;install expo&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;setelah 3 tahap instalasi dilakukan, buka command prompt&lt;/p&gt;

&lt;p&gt;ketikan syntak dibawah ini&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; expo init namaprojectbebas  

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;note: nama project bebas ya, bisa diganti sesuai dengan yang kita inginkan&lt;/p&gt;

&lt;p&gt;setelah itu akan muncul opsi seperti dibawah, untuk mulai codingan awal saya biasanya memilih blank, setelah memilih blank maka proses instalasi dimulai&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ibb.co/FxBY5Rr"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uhOoNo2V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.ibb.co/7YGpnsf/Screenshot-2.png" alt="Screenshot-2"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;tunggu proses instalasi project baru selesai&lt;/p&gt;

&lt;p&gt;setelah selesai maka akan terbentuk sebuah folder baru yang berisi aplikasi react native yang baru saja kita buat, untuk masuk ke direktori tersebut, pada command prompt ketikan&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;expo init namaprojectbebas  

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;kemudian ketikan perintah dibawah, untuk menjalankan apps tersebut&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; yarn start

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;setelah itu akan muncul pop up browser, pada menu sidebar pilih open project in web browser, selesai&lt;/p&gt;

&lt;p&gt;untuk editing kode bisa menggunakan atom, dengan open folder project yang baru saja kita buat. Ketika ada perubahan dan di save , otomatis tampilan di browser akan berubah.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
