Anatomy

How Artchain is built

Artchain is a Next.js 14 App Router frontend. Every page sits inside one shell of providers, and anything that touches Solana goes out through that shell to the user's wallet and a devnet RPC node. The bench below is that shell as a machine: run your pointer along it, or focus it and use the arrow keys.

ARTCHAIN
The page your route rendersA provider from providers/ConnectionProvider's link to devnetEvery route in app/ is mounted inside the same four providers. The page asks the wallet to sign, the wallet signs inside the browser extension and hands back only the signature, and the ConnectionProvider's devnet endpoint carries the result out. Today the five launch forms stop at the form: none of them calls useWallet yet, so this is the path the shell offers them, not one they take.

Folder structure

app/layout.tsx
The root layout. Loads fonts and global CSS, then wraps every route in Provider, the Header, ScrollToTop, the Loader overlay and Vercel Analytics and Speed Insights.
app/<route>/page.tsx
One folder per page: the landing page (page.tsx), about, contact, and the five launch forms: token-creator, nft-creator, mint-NFT, presale-creator and presale-claim. All are client components.
app/globals.css
Theme tokens as CSS custom properties: :root for light, .dark for dark. Tailwind reads them as bg-background, text-primary and so on.
providers/
Provider.tsx (next-themes ThemeProvider plus the toast container) and ClientWalletProvider.tsx (the Solana connection, wallet and wallet modal providers).
components/
The landing page sections (Hero with its GSAP intro and three.js coin cluster, Partners, ToolBento, ForgeMarquee, LaunchStack, Features, FAQ, ForgeFinale, Footer; both 3D scenes come from ForgeScene), ScrollReveal for scroll-in reveals, the BrandMark logo, the Header with the wallet button and theme toggle, and the Loader.
components/ui/
shadcn primitives built on Radix: button, card, input, slider, switch, accordion, sheet, toast and the rest.
lib/ and hooks/
cn() for merging class names, next/dynamic wrappers that lazy-load the heavier landing sections, and the toast hook.
images/
Static images re-exported from one index so pages import them by name.

The shell every page sits in

app/layout.tsx renders Provider around everything, and Provider nests the rest. Read inside out, which is the order the bench draws them from left to right:

ThemeProvider                 providers/Provider.tsx
  ConnectionProvider          providers/ClientWalletProvider.tsx
    WalletProvider
      WalletModalProvider
        Header + page + ScrollToTop + Loader + Analytics

Because the shell lives in the layout, it mounts once. Moving from the token creator to the presale page swaps only the page; the wallet connection and the theme stay as they were.

The path of a transaction

  1. 01The route renders. Next.js matches the URL to a folder in app/ and renders its page.tsx inside app/layout.tsx. The layout never re-mounts between pages, so the providers and their state survive navigation.
  2. 02WalletModalProvider. The innermost shell. It owns the 'Select wallet' dialog that the Header's WalletMultiButton opens.
  3. 03WalletProvider. Holds the three adapters (Phantom, Solflare, Torus) and autoConnect, so a returning user's wallet reconnects on load. Any component can call useWallet() to get the public key, connect, or ask for a signature.
  4. 04ConnectionProvider. Builds one Connection to clusterApiUrl('devnet'). useConnection() hands it to any component that needs to read the chain or send a transaction.
  5. 05ThemeProvider. The outermost shell. next-themes puts a dark or light class on <html>, and every Tailwind color follows the CSS variables for that class.
  6. 06The wallet signs. Signing happens inside the browser extension. The app passes it an unsigned transaction and gets back a signature; the private key never enters the page.
  7. 07The RPC sends. The signed transaction goes to the devnet RPC endpoint through the shared Connection.

What is wired today

The wallet button in the Header is live: it opens the modal, connects through the chosen adapter and shows the address. The five launch forms are interface only. They keep their fields in React state and simulate a submit with a timer, and none of them calls useWallet or useConnection, so no transaction is built, signed or sent yet. Wiring one up means building the transaction in the page and calling sendTransaction from useWallet with the Connection from useConnection; the shell needs no changes.

Theming

Colors are CSS custom properties in app/globals.css, defined once for light under :root and once for dark under .dark. Tailwind maps them to classes such as bg-background and text-primary, and the shadcn components in components/ui use only those classes. The toggle in the Header calls next-themes, which flips the class on <html>; nothing re-renders to change color. The bench above reads the same class, which is why its switch moves when you change the theme.

Artchain