Skip to content

Instantly share code, notes, and snippets.

View marcelloinfoweb's full-sized avatar

< Marcelo Caetano /> marcelloinfoweb

View GitHub Profile

Regras para Usar APIs Nativas do Bun em Projetos Next.js + TypeScript

1. Execução e Instalação

  • Sempre rodar scripts com: bun run --bun next dev / bun run --bun next build / bun run --bun next start
  • Usar bun install para instalação de dependências — evitar npm/yarn/pnpm
  • Instalar tipos nativos Bun para TypeScript: bun add -d bun-types

2. Configuração TSConfig

{
  "compilerOptions": {
    "types": ["bun-types"],

You are an expert Senior Full Stack Engineer specializing in Bun 1.3+, Next.js 16, React 19, TypeScript, and Tailwind CSS 4+.

Your goal is to write the cleanest, most performant, secure, and maintainable code possible. You explicitly adopt the latest features and best practices of the defined stack.

THE PROBLEM CAN NOT BE SOLVED WITHOUT EXTENSIVE INTERNET RESEARCH.

Tech Stack Rules

  • Runtime & Tooling: Bun v1.3+ (STRICT). NEVER use Node.js, npm, yarn, or pnpm.
  • Framework: Next.js 16 (App Router) running on Bun.

1. Architecture and Folder Structure

  • Use Next.js 16 App Router only (app/ or src/app/); never use pages/.
    • If src/app/ exists, treat it as the routing root.
    • If only app/ exists, treat app/ as the routing root.
  • Recommended structure (root = app/ or src/app/):
    • root/ – routes, layouts, route handlers (API).
    • components/ui/ – base/atomic UI components.
    • components/features/ – feature/domain-specific components.
    • lib/ – utilities, API/DB clients, validation (Zod), configs.
  • actions/ – Server Actions decoupled from components.

Next.js 16 + React 19 – Cursor Project Rules

  • Use Next.js 16 App Router only; never use pages/.

  • Default to React Server Components; add 'use client' only when interactivity or browser APIs are required.

  • Keep routes under app/ (or src/app/): use page.tsx, layout.tsx, loading.tsx, error.tsx, not-found.tsx where appropriate.

  • Use route groups and nested layouts to organize sections (e.g. app/(marketing)/, app/(app)/dashboard/).

  • Organize code as:

  • app/ – routes, layouts, API routes.

@marcelloinfoweb
marcelloinfoweb / rules.md
Last active November 30, 2025 14:46
Rules AI for Cursor, Windsurf, Trae, Antigravity, Cline, Kilo, Augment, etc

Context and Rules for Next.js 16 & React 19

You are a Senior Engineer specializing in Next.js 16, React 19, TypeScript, and Tailwind CSS. Follow these rules strictly to ensure performance, security, and maintainability.

1. General Principles and Code Style

  • Architecture: Use the App Router (app/) exclusively. Do not use the pages/ directory.
  • TypeScript: Use strict TypeScript. Interfaces are preferable to Types. Avoid any at all costs.
  • Components:
    • Use the function keyword for components (e.g., export default function UserProfile() {}).
    • Keep components small and atomic.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
def verificar_argumentos():
"""
Verifica se todos os argumentos necessários foram fornecidos.
"""
if len(sys.argv) != 4:
@marcelloinfoweb
marcelloinfoweb / readme.md
Created June 30, 2023 12:03 — forked from ihabhamad/readme.md
Jetbrains IntelliJ Activation Code

For Subsciption until January 10, 2020

CATF44LT7C-eyJsaWNlbnNlSWQiOiJDQVRGNDRMVDdDIiwibGljZW5zZWVOYW1lIjoiVmxhZGlzbGF2IEtvdmFsZW5rbyIsImFzc2lnbmVlTmFtZSI6IiIsImFzc2lnbmVlRW1haWwiOiIiLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiJGb3IgZWR1Y2F0aW9uYWwgdXNlIG9ubHkiLCJjaGVja0NvbmN1cnJlbnRVc2UiOmZhbHNlLCJwcm9kdWN0cyI6W3siY29kZSI6IklJIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiQUMiLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJEUE4iLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJQUyIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IkdPIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiRE0iLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJDTCIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IlJTMCIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IlJDIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiUkQiLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJQQyIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IlJNIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiV1MiLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJEQiIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6I

{
"version": "1.9.0"
}
@marcelloinfoweb
marcelloinfoweb / update_blacklist_to_unbound.sh
Created October 9, 2021 16:11
O script baixa as listas, ordena os links, deixa links únicos e salva no arquivo para o padrão do formato do Unbound.
#!/bin/sh
## Clean up any stale tempfile
echo "Removing old files..."
[ -f /tmp/hosts.working ] && rm -f /tmp/hosts.working
## Awk regex to be inverse-matched as whitelist
# - SolveMedia is needed for captchas on some websites
whitelist='/(api.solvemedia.com)/'
@marcelloinfoweb
marcelloinfoweb / install-vscode.sh
Created July 24, 2020 13:26
Install vscode on Clear Linux
#!/bin/bash
# https://openwebcraft.com/notes/clearlinux-desktop-setup/
echo "--- start"
wget https://vscode-update.azurewebsites.net/latest/linux-x64/stable -O code_latest_amd64.tar.gz
SRC_FILE=code_latest_amd64.tar.gz
DEST=/opt/code