Building a Minimalist URL Shortener with Next.js, Tailwind, and MongoDB

## ? Why I Built Link-Trim.in
A few months ago, I needed a no-nonsense URL shortener for personal projects—something ad-free, lightweight, and easy to deploy. Existing tools felt bloated, so I built Link-Trim.in. Here’s how I went from a domain name to a live app, with some hard-earned lesson...

? https://www.roastdev.com/post/....building-a-minimalis

#news #tech #development

Favicon 
www.roastdev.com

Building a Minimalist URL Shortener with Next.js, Tailwind, and MongoDB

## ? Why I Built Link-Trim.in
A few months ago, I needed a no-nonsense URL shortener for personal projects—something ad-free, lightweight, and easy to deploy. Existing tools felt bloated, so I built Link-Trim.in. Here’s how I went from a domain name to a live app, with some hard-earned lessons along the way.


Step 1: Choosing Binding the Domain

Goal: A short, memorable name.
Went with Link-Trim.in (cheap TLD + clear purpose).
Registrar: Namecheap (for simplicity).
Challenge: DNS propagation delays (tip: test with dig + patience).



Step 2: The Stack

Frontend: Next.js (App Router) + TailwindCSS
Database: MongoDB (free tier)
Hosting: Vercel (with domain binding)
Docs: Single README.md to rule them all
No auth, no SSR, no unnecessary abstractions—just a fast, functional URL shortener.



Step 3: Domain Binding on Vercel

Bought link-trim.in (Namecheap).
Changed nameservers to Vercel’s (or added A/CNAME records).
SSL certs auto-provisioned (love this about Vercel).



Step 4: Try It Out
Link-Trim.in is live—use it, fork it, or roast it!

Similar Posts

Similar

? JavaScript Arrays Explained with Practical Code Examples

If you're learning JavaScript, understanding arrays is non-negotiable. They’re everywhere — storing data, managing lists, or manipulating collections. In this guide, we're going full code-mode ? to explore how arrays work.No fluff, just code. Let’s go ?


? Creating Arrays
⛶co...

? https://www.roastdev.com/post/....javascript-arrays-ex

#news #tech #development

Favicon 
www.roastdev.com

? JavaScript Arrays Explained with Practical Code Examples

If you're learning JavaScript, understanding arrays is non-negotiable. They’re everywhere — storing data, managing lists, or manipulating collections. In this guide, we're going full code-mode ? to explore how arrays work.No fluff, just code. Let’s go ?


? Creating Arrays
⛶const fruits = ["apple", "banana", "mango"];
const numbers = [1, 2, 3, 4];
const colors = new Array("red", "green", "blue");
Arrays can hold any data type — strings, numbers, even objects or other arrays.? Accessing Elements
⛶console.log(fruits[0]); // "apple"
console.log(fruits[2]); // "mango"Arrays use zero-based indexing, meaning the first element is at index 0.
⛶fruits[1] = "orange";
console.log(fruits); // ["apple", "orange", "mango"]⚙️ Array Methods in Action
⛶fruits.push("grape"); // Add to end
fruits.pop(); // Remove from end
fruits.shift(); // Remove from start
fruits.unshift("kiwi"); // Add to start
fruits.splice(1, 0, "pineapple"); // Insert at index 1These methods help you add/remove elements from different positions in the array.? Looping Through Arrays
⛶for (let i = 0; i fruits.length; i++) {
console.log(fruits[i]);
}

fruits.forEach(fruit = {
console.log(fruit);
});Looping helps you perform actions on each element. forEach is cleaner and more modern.? Destructuring Arrays
⛶const [first, second] = fruits;
console.log(first); // "apple"
console.log(second); // "orange"Destructuring lets you pull out values easily without accessing them one-by-one.✅ Wrap Up
Arrays are powerful and versatile. Mastering just these few concepts can take you a long way. Practice these snippets, build your own mini-projects, and you’ll see arrays in a whole new light! ?Got a favorite array method or a cool trick? Share it in the comments!
Similar

val ou var, eis a questão

Em Kotlin, uma das primeiras decisões que você toma ao declarar uma variável é:
ela pode mudar ou deve permanecer imutável?A resposta está em duas palavrinhas simples — val e var.


? Qual a diferença entre val e var?



? val (value) → Imutável
Uma vez atribuída, não...

? https://www.roastdev.com/post/....val-ou-var-eis-a-que

#news #tech #development

Favicon 
www.roastdev.com

val ou var, eis a questão

Em Kotlin, uma das primeiras decisões que você toma ao declarar uma variável é:
ela pode mudar ou deve permanecer imutável?A resposta está em duas palavrinhas simples — val e var.


? Qual a diferença entre val e var?



? val (value) → Imutável
Uma vez atribuída, não pode ser alterada.
⛶val nome = "João"
// nome = "Maria" // Erro: Val cannot be reassignedUse val quando o valor não deve mudar. Isso torna seu código mais previsível e seguro.


? var (variable) → Mutável
Permite ser reatribuída.
⛶var idade = 30
idade = 31 // Tudo certo!Use var quando o valor precisar mudar ao longo do tempo.? Por que preferir val?
Imutabilidade é uma boa prática de programação funcional e ela:
Evita efeitos colaterais inesperados.
Facilita o teste e a depuração.
Ajuda a escrever código mais seguro e confiável.

⛶fun calcularDesconto(preco: Double): Double {
val desconto = 0.1
return preco - (preco * desconto)
}Mesmo dentro da função, usamos val porque o valor não muda.? Dica de ouro
Use val como padrão.
Só use var quando a lógica realmente exigir mudanças no valor.
Essa abordagem te ajuda a escrever código mais limpo, seguro e idiomático em Kotlin.
✅ Conclusão
A distinção entre val e var é simples, mas poderosa.
Ao optar por imutabilidade, você reduz bugs, melhora a legibilidade e adota um estilo de programação mais funcional.No próximo artigo, vamos explorar funções de extensão, um dos recursos mais elegantes do Kotlin.???
Similar

Building a Robust Data Hub: Understanding the Data Types That Power It




Building a Robust Data Hub: Understanding the Data Types That Power It
When discussing a robust data hub, we're talking about a central platform designed to manage and integrate diverse data from a variety of sources. This hub is the backbone of modern data architectures, providing the foun...

? https://www.roastdev.com/post/....building-a-robust-da

#news #tech #development

Favicon 
www.roastdev.com

Building a Robust Data Hub: Understanding the Data Types That Power It

Building a Robust Data Hub: Understanding the Data Types That Power It
When discussing a robust data hub, we're talking about a central platform designed to manage and integrate diverse data from a variety of sources. This hub is the backbone of modern data architectures, providing the foundation for analytics, machine learning, and real-time decision-making. However, the power of a data hub isn't just in its centralized structure — it’s also in how it handles the variety of data it stores.A robust data hub needs to accommodate different formats, from clean, structured records to loosely organized, unstructured content. It must be capable of taking in various data types and transforming them into usable, linked data. These transformations ensure that the raw data becomes actionable and valuable for downstream processes.In this context, we need to understand the types of data that a robust data hub handles. Each data format comes with its unique characteristics and challenges. Let’s dive into the primary data types commonly encountered in a data hub environment and explore how they are processed.


The Core Data Types in a Robust Data Hub
A robust data hub must support and integrate a wide array of data formats. Let’s take a closer look at the main types of data, along with examples of how they are used and what makes them unique.


Structured Data: CSV, SQL, and Relational Databases
Structured data is typically organized in a fixed schema, making it easy to process and analyze. It’s the most straightforward type of data and is usually stored in tables or spreadsheets. Common examples include:CSV (Comma-Separated Values): Often used for simple datasets that need to be stored or transferred in tabular form. CSV is easy to process but lacks built-in relationships between data elements.
⛶Order Number,Customer Name,Product ID,Purchase Date
1001,John Doe,ABC123,2025-05-01
1002,Jane Smith,XYZ456,2025-05-02
1003,James Brown,DEF789,2025-05-03
1004,Emily White,LMN012,2025-05-04
1005,Michael Black,PQR345,2025-05-05Example: A list of customer orders, with columns for order number, customer name, product ID, and purchase date. Each row represents a different order, making it easy to analyze order history or trends.CSV is inherently a tabular, flat structure, whereas RDF is a graph-based model. A CSV row represents a single record with columns that map to a predefined schema. When converting this to RDF triples, the goal is to transform the tabular rows into triples while preserving the data’s meaning.
You need to create triples that establish relationships between entities (such as orders, customers, products, and dates). Here’s how the RDF representation might look:Subject: Order 1001, Predicate: hasCustomer, Object: John Doe

Subject: Order 1001, Predicate: hasProduct, Object: ABC123

Subject: Order 1001, Predicate: hasPurchaseDate, Object: 2025-05-01

Even though RDF data is represented using triples, you can still reconstruct the original structure of a row (or a record) from the RDF graph using queries. This is possible due to the inherent flexibility of the RDF model, which is designed to represent relationships between entities in a graph, and the power of SPARQL (the query language for RDF).SQL Databases: Structured data is frequently stored in relational databases, which organize information into tables with rows and columns. These databases also define relationships between tables, making them ideal for complex data models.Example: A relational database for an HR system, where the tables include employees, departments, and roles, with relationships that link employees to departments and roles.


Semi-Structured Data: JSON and XML
Semi-structured data has a more flexible format than structured data but still contains tags or markers that make it easier to interpret. This type of data is often used in web applications or APIs. Examples include:JSON (JavaScript Object Notation): A lightweight format that uses key-value pairs to represent data, JSON is commonly used for APIs and web services due to its readability and flexibility.
⛶PREFIX ex:
PREFIX ord:
PREFIX cust:
PREFIX prod:

SELECT ?order ?customerName ?productID ?purchaseDate
WHERE {
?order ex:hasCustomer ?customer .
?order ex:hasProduct ?product .
?order ex:hasPurchaseDate ?date .
?customer ex:hasName ?customerName .
?product ex:hasID ?productID .
FILTER (?order = ord:1001)
}Example: A customer order stored as a JSON object, where the customer’s name, items ordered, and shipping address are all nested in an organized structure. JSON allows for adding new fields without disrupting the overall data model.While JSON represents data in a nested key-value pair structure, RDF represents data as triples (subject, predicate, object). JSON is hierarchical and supports arrays, while RDF is flat and connected in a graph-like model.When converting JSON data to RDF triples, the goal is to break down the hierarchical structure of JSON into simpler triples that capture relationships between entities (such as orders, customers, and products). This allows the data to be represented in a semantic way that can be linked and queried across different systems.Even though JSON data is flattened into RDF triples, we can still reconstruct the original record from the RDF graph using SPARQL queries. SPARQL (SPARQL Protocol and RDF Query Language) is designed to query RDF datasets and retrieve the required relationships between entities.By querying the RDF triples, we can easily reassemble the original hierarchical structure, just like we would join related tables in a relational database.XML (eXtensible Markup Language): While XML is more verbose than JSON, it is still widely used for representing data in a structured but flexible format. XML is often used in document management systems and web services.Example: An inventory management system where each product is represented in XML with elements for product name, category, and stock quantity. The XML format can easily support nested information, such as product attributes or pricing history.


3. Unstructured Data: Emails, Logs, Documents
Unstructured data is the most challenging to manage because it lacks a predefined format. Despite being the most difficult to process, unstructured data contains valuable insights and is growing at an exponential rate. Examples include:Emails: Emails often contain unstructured text, but they can also be rich with metadata such as timestamps, sender/receiver details, and subjects. Extracting meaningful insights requires parsing both the content and metadata.
⛶From: john.doe@example.com
To: jane.smith@example.com
Subject: Order Confirmation for Order #1001
Date: 2025-05-01 10:30:00

Dear Jane,

Thank you for your recent purchase. We are happy to confirm your order #1001 for the following product:

Product: ABC123
Price: $19.99
Quantity: 1
Total: $19.99

Your order will be shipped to the following address:
123 Main Street, Springfield, IL 62701

If you have any questions or need further assistance, please do not hesitate to reach out.

Best regards,
John Doe
Customer Support
company@example.comExample: A customer service email exchange where the customer requests a refund and provides an order number. The text may require parsing to identify key entities like the order number and refund request.Logs: Log files are generated by systems and applications and often contain a mix of unstructured and semi-structured data. Logs provide valuable information on system performance, errors, and user activity.
⛶2025-05-01 10:00:00 [INFO] Server started successfully on port 8080.
2025-05-01 10:05:32 [ERROR] Failed to load configuration file. File not found: /etc/app/config.json.
2025-05-01 10:06:15 [INFO] Attempting to reconnect to database.
2025-05-01 10:07:01 [INFO] Database connection established successfully.
2025-05-01 10:10:25 [WARN] High memory usage detected: 85% of available memory in use.
2025-05-01 10:12:00 [INFO] User 'admin' logged in successfully from IP: 192.168.1.5.
2025-05-01 10:15:45 [INFO] Scheduled backup started.
2025-05-01 10:16:00 [ERROR] Backup failed due to insufficient disk space.
2025-05-01 10:20:11 [INFO] Server shutting down gracefully.Example: A server log that tracks incoming user requests, errors, and server performance metrics. These logs can be parsed to identify patterns or issues, such as high traffic periods or recurring errors. **another day we will talk about KQLDocuments: Documents, such as PDFs, Word files, and text documents, often contain freeform text, making it difficult to extract structured data. However, advanced techniques like natural language processing (NLP) can help extract valuable information from these documents.
⛶Title: Project Update

Date: 2025-05-01

Attendees:
- John Doe
- Jane Smith

Notes:
- John provided updates on the project timeline.
- Jane confirmed the completion of the initial design.

Next Steps:
- John to finalize the project plan by May 3.
- Jane to start the development phase by May 5.Example: An HR document containing employee performance reviews in text format. The document may need to be processed to extract key information like ratings or feedback.Supporting a wide variety of data types is essential for building a robust data hub because it allows organizations to integrate and process information from multiple sources, thereby enhancing their ability to derive valuable insights. In today’s data-driven world, businesses need to work with not only structured data like databases and spreadsheets but also semi-structured and unstructured data such as emails, logs, and social media feeds.Each data type presents its own challenges. Structured data is usually well-organized and easy to process, but it may lack the flexibility needed to capture more complex relationships or nuanced information. Semi-structured data, such as JSON or XML, provides more flexibility and can be more easily adapted to new needs, but its irregularity may create difficulties when trying to query or link it to other sources. Unstructured data, such as emails, logs, and images, often requires advanced techniques like natural language processing (NLP) or machine learning (ML) to extract meaningful information.By supporting these diverse data types, a robust data hub can overcome these challenges and unify the data, enabling businesses to connect disparate systems and gain a more complete view of their operations. When structured, semi-structured, and unstructured data are integrated, it allows organizations to connect previously siloed information, revealing hidden insights that might otherwise have remained out of reach.This capability is critical for modern analytics and decision-making. For instance, businesses can combine transactional data (e.g., from CSV files or relational databases) with customer feedback data (e.g., from emails or social media), allowing for a more holistic view of customer behavior and preferences. This integrated approach enhances the accuracy of predictions, improves decision-making processes, and ultimately drives innovation.Furthermore, a data hub that can support multiple data types can better adapt to the rapidly evolving landscape of modern business. As new data sources emerge, such as IoT devices, mobile apps, and online interactions, organizations need a flexible system that can scale and accommodate these new inputs without disrupting existing operations.In conclusion, supporting diverse data types is not just about managing different formats; it’s about ensuring that a data hub is adaptable, capable of handling the complexity of real-world data, and positioned to deliver the deep insights that organizations need to stay competitive and agile in the marketplace. When managed properly, these varied data sources combine to provide the rich, comprehensive datasets that modern analytics and decision-making rely on.