<?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>DEV Community: ringeringeraja</title>
    <description>The latest articles on DEV Community by ringeringeraja (@ringeringeraja).</description>
    <link>https://dev.to/ringeringeraja</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%2F1060456%2F8e481e02-3ab3-414c-bb2a-b1a76ef3cc5b.jpeg</url>
      <title>DEV Community: ringeringeraja</title>
      <link>https://dev.to/ringeringeraja</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ringeringeraja"/>
    <language>en</language>
    <item>
      <title>We finally have a fullstack framework for MongoDB</title>
      <dc:creator>ringeringeraja</dc:creator>
      <pubDate>Tue, 17 Sep 2024 07:43:47 +0000</pubDate>
      <link>https://dev.to/ringeringeraja/we-finally-have-a-fullstack-framework-for-mongodb-5ai4</link>
      <guid>https://dev.to/ringeringeraja/we-finally-have-a-fullstack-framework-for-mongodb-5ai4</guid>
      <description>&lt;p&gt;The two most popular alternatives for working with MongoDB in JavaScript (Prisma and Mongoose) are both flawed.&lt;/p&gt;

&lt;p&gt;Mongoose adds a lot of polyfills and hooks to the MongoDB driver, stealing all of MongoDB's intended simplicity, requires external plugins to autopopulate references and does it badly (using hooks and multiple transactions instead of doing it in a single transaction leveraging the Aggregation Framework). It also has limited TypeScript support.&lt;/p&gt;

&lt;p&gt;Prisma, on the other hand, emulates relational behavior when used with Mongo and misses denormalization, which is a very powerful feature intrinsic to Document-oriented databases.&lt;/p&gt;

&lt;p&gt;I thought the JavaScript community deserved better, so I put together some good people and started working on a web framework written on top of MongoDB.&lt;/p&gt;

&lt;p&gt;First, we have a compiler written in PureScript that parses &lt;code&gt;.aeria&lt;/code&gt; files and emits JavaScript and TypeScript code. &lt;br&gt;
The compiler runs in watch mode when the development server is active, so there's no need of running something like "aeria migrate" every time. Types are automatically updated on each compilation without need for IDE hacks also.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  Role-Based Access Control
&lt;/h2&gt;

&lt;p&gt;The framework let's you bring up RESTful endpoints automatically. Once exposed with the &lt;code&gt;@expose&lt;/code&gt; attribute alone, any authenticated user can reach the endpoint. To control which set of users can have access to a specific endpoint, we can extend the builtin &lt;code&gt;aeria.user&lt;/code&gt; collection with the &lt;code&gt;roles&lt;/code&gt; property and then pass the desired roles as parameter to the &lt;code&gt;@expose&lt;/code&gt; attribute.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Access Control remains strongely typed across the application. This could be used to be used to verify the access to critical functions in development/compile time.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  Error handling
&lt;/h2&gt;

&lt;p&gt;Since the begining, we know we didn't want try/catch error handling in our framework, so our first option was FP-style Eithers. That worked fine, but the user would have to adapt to idiomatic code like &lt;code&gt;isLeft()&lt;/code&gt; and &lt;code&gt;unwrapEither()&lt;/code&gt;, what didn't sound right. Later we finally came across our actual error handling approach, which is returning a &lt;code&gt;Result.Either&amp;lt;E, R&amp;gt;&lt;/code&gt; object that the user can destructure and narrow as needed.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  Extensible dashboard
&lt;/h2&gt;

&lt;p&gt;All the backend metadata (information about collections and routes) is made available in the runtime as parseable JSON-schemas, so making a adaptative dashboard for Aeria was just around the corner. Aeria UI is a frontend counterpart for Aeria that allows bringing a CRUD-based application up in minutes. It is currently extensible with Vue only, but we plan on making it available to other UI frameworks as well.&lt;/p&gt;




&lt;p&gt;That's it for now!&lt;br&gt;
Also I am an ESL person, so forgive me if the text was sloppy at times.&lt;/p&gt;

&lt;h2&gt;
  
  
  Star us on GitHub!
&lt;/h2&gt;

&lt;p&gt;We dream of getting traction someday and turning Aeria into a self-sustainable Open Source project.&lt;br&gt;
If you liked the project and want it to thrive, please consider starring us on GitHub:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Main project: &lt;a href="https://github.com/aeria-org/aeria" rel="noopener noreferrer"&gt;https://github.com/aeria-org/aeria&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Aeria Lang: &lt;a href="https://github.com/aeria-org/aeria-lang" rel="noopener noreferrer"&gt;https://github.com/aeria-org/aeria-lang&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Aeria UI: &lt;a href="https://github.com/aeria-org/aeria-ui" rel="noopener noreferrer"&gt;https://github.com/aeria-org/aeria-ui&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>typescript</category>
      <category>mongodb</category>
      <category>prisma</category>
      <category>mongoose</category>
    </item>
  </channel>
</rss>
