dataDesk BLOG

Welcome to the blog of Mr.G

Nature
Posts: 3

Blog 1: User_Authentication_Flow.md | (Open) | (Share)

▲ Previous | Next ▼

/Projects/dataDesk/Docs

(Last modified: June 06 2025 23:21:24)

User Authentication Flow

User Authentication Flow

🔐 User Authentication Flow

1. Entry Point: index.php

When the user navigates to the sign-in page, the app is accessed via:

index.php/?page=signin

Route Handling:

switch ($route) {
    case 'signin':
        $force = $_GET['force_select'] ?? null;

        if (isset($_SESSION['user_id']) && !$force) {
            // User already signed in and not switching accounts
            header("Location: ./");
            exit;
        }

        require __DIR__ . '/app/auth/signin.html';
        break;
}
  • If the user is already signed in and not explicitly forcing account switch, they are redirected to the homepage.
  • Otherwise, the signin.html page is loaded.

2. Sign-In Form Submission: /app/auth/signin.html

JavaScript sends the form data via fetch:

fetch('./user.php?action=signin', {
    method: 'POST',
    body: formData
})
.then(response => response.json())
.then(data => {
    if (data.status === "success") {
        window.location.href = data.redirect;
    }
});
  • Sends a POST request to user.php?action=signin
  • If login is successful, the user is redirected to the given URL.

3. Login Handler: user.php

require 'config.php';
require 'includes/AuthManager.php';

$auth = new AuthManager($pdo);
$action = $_GET['action'] ?? '';

header('Content-Type: application/json');

try {
    switch ($action) {
        case 'signin':
            $email = $_POST['email'] ?? '';
            $password = $_POST['password'] ?? '';
            $remember = isset($_POST['remember_me']);
            echo json_encode($auth->login($email, $password, $remember));
            break;
    }
} catch (Exception $e) {
    echo json_encode([
        "status" => "error",
        "message" => $e->getMessage()
    ]);
}
  • Loads dependencies and initializes AuthManager
  • Handles signin action by calling login() with form data
  • Returns a JSON response indicating success or error

4. Authentication Logic: AuthManager.php

public function login($email, $password, $remember_me = false)
{
    // Validate user and authenticate (code omitted)
    $_SESSION['user_id'] = $user['id'];

    if ($remember_me) {
        setcookie("remember_token", $remember_token, [...]);
        setcookie("remember_selector", $remember_selector, [...]);
    }

    return [
        "status" => "success",
        "message" => "Welcome, you are now signed in!",
        "redirect" => $redirectUrl
    ];
}
  • Authenticates the user and stores their ID in $_SESSION
  • If "Remember Me" is checked, persistent cookies are set
  • Returns a JSON response with status and redirect URL

https://mermaid.live/


sequenceDiagram
    participant U as User
    participant B as Browser (index.php)
    participant F as signin.html
    participant S as user.php
    participant A as AuthManager

    U->>B: Request /?page=signin
    B->>F: Load signin.html
    F->>S: POST user.php?action=signin
    S->>A: login(email, password, remember)
    A-->>S: JSON (status, redirect)
    S-->>F: JSON response
    F->>U: Redirect to success page

alt text



Blog 2: John_Rush_s_Top_46_AI_Coding_Agents_IDEs.md | (Open) | (Share)

▲ Previous | Next ▼

/AI

Last modified: May 30 2025 21:55:49

🧠 John Rush’s Top 46 AI Coding Agents & IDEs

1. Factory AI

  • Generates complex apps and documents.
  • Integrates with web search and can run code locally.
  • Best suited for coders handling large projects.

2. Heyboss AI

  • Creative tool for building production-grade apps with backend and database.
  • User-friendly for non-coders.

3. Emergent Labs

  • Agentic tool handling full-stack applications.
  • Features multi-agent support (coding, testing agents).

4. Wrapifai

  • Ideal for form-based apps like calculators and AI generators.
  • 100% no-code and easy to use.

5. Create.xyz

  • Clones products by inputting a link.
  • Connects to APIs like The Movie DB and HackerNews.

6. A0.dev

  • Mobile-first platform for generating React Native apps.
  • Utilizes Claude 3.7 Sonnet.

7. Cursor

  • Assists with code autocompletion, refactoring, and building entire modules.
  • Best for experienced coders.

8. Bolt

  • Supports coders, non-coders, and marketers.
  • Integrates with Supabase for data and authentication.

9. Lovable

  • Fast-growing EU-based startup.
  • Converts screenshots into full web apps.

10. Windsurf

  • Agentic tool with web search capabilities and memory.
  • Suitable for advanced applications.

11. Stitch (Google)

  • Optimized for rapid prototyping.
  • Accessible to founders, designers, and non-coders.

12. Grok Studio (xAI)

  • Interactive platform for learning and experimenting with code.

13. Canva Code

  • Designed for creating lead magnets.
  • User-friendly for founders and marketers.

14. Augment Code

  • Works within VS Code and JetBrains IDEs.
  • Executes code, runs terminals, and analyzes code for performance optimization.

15. Build with Mocha

  • Builds full-stack applications from prompts.
  • Complete with authentication, database, hosting, and emails.

16. Rork

  • Text-to-app AI agent for building mobile apps.
  • Supports direct publishing to TestFlight.

17. Clark

  • AI agent for building internal enterprise apps from Jira tickets.
  • Combines prompting, Figma-like editing, and coding.

18. GitHub Copilot

  • Generates code, handles large codebases, merges PRs, fixes bugs, and searches code.
  • Supports agent mode and is open-sourced.

19. Replit AI

  • Advanced AI agent with Agent and Assistant modes.
  • Generates full-stack apps with its own server, database, and hosting.

20. v0 by Vercel

  • Specializes in creating well-designed web pages and UIs.
  • Integrates with Figma; not ideal for full-stack apps.

21. MarsX

  • Combines AI, NoCode, and High Code for building SaaS applications.
  • Used to build projects like SEO Bot AI and Listing Bott.

22. Devin

  • Acts as a junior developer in a team.
  • Sends pull requests and works alongside your team.

23. Webdraw

  • Transforms sketches into web apps.
  • Ideal for users with zero coding experience.

24. Tempo Labs

  • Generates full-stack apps using text or image prompts.
  • Begins with architecture and diagrams; offers excellent UX.

25. Trae

  • Free tool from ByteDance for building full-stack web apps via prompting.
  • Designed for coders.

26. Cline

  • VS Code plugin supporting large codebases and any LLM.
  • Offers runtime awareness.

27. Databutton



Blog 3: vi_vim_nvim_commands.md | (Open) | (Share)

▲ Previous

/Dev/Linux

Last modified: May 19 2025 02:22:20

vi vim nvim commands

compact cheat sheet of the most commonly used Vim (or Neovim) commands — perfect for everyday editing.


✅ Modes

Key Mode Description
i Insert Insert before cursor
a Insert Insert after cursor
I Insert Insert at start of line (first text)
A Insert Append at end of line
Esc Normal Exit insert/visual mode
v Visual Start visual selection
V Visual Line Select entire lines
Ctrl+v Visual Block Select block of text (column mode)
: Command Enter command-line mode

🧭 Movement (Normal Mode)

Key Action
h, l Left, right
j, k Down, up
w, W Forward by word (W ignores punctuation)
b, B Backward by word
e, E End of word
0 Beginning of line
^ First non-whitespace char
$ End of line
gg Top of file
G Bottom of file
:n Go to line n
% Jump to matching bracket/brace/paren

✏️ Editing

Key Action
x Delete character under cursor
X Delete character before cursor
dd Delete current line
dw Delete word
d$ Delete to end of line
yy Yank (copy) line
yw Yank word
p Paste after cursor
P Paste before cursor
u Undo
Ctrl+r Redo
r<char> Replace single character
c Change (works like delete + insert)
cc Change whole line
cw Change word

🔎 Search

Key Action
/pattern Search forward
?pattern Search backward
n Next search match
N Previous search match
* Search word under cursor forward
# Search word under cursor backward

⚙️ Command Mode (use :)

Command Description
:w Save
:q Quit
:wq or ZZ Save and quit
:q! Force quit
:e filename Open a file
:vsp filename Vertical split and open file
:split file Horizontal split and open file
:set number Show line numbers
:noh Clear search highlighting

🧩 Visual Mode Tips


Who I am

"Just me, myself, and I, exploring the universe of unknownment, embracing the mystery of what lies beyond, one star at a time."

Share this page on Facebook | X.com | Reddit

Page Content

  • Image User Authentication Flow
    Published: 2025-06-07
    Read
  • Image John Rush s Top 46 AI Coding Agents IDEs
    Published: 2025-06-03
    Read
  • Image vi vim nvim commands
    Published: 2025-06-01
    Read

Tags

WebDev New York London AI NORWAY DIY Ideas Life Family News Clothing Invest Sports Health