Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ FINNHUB_API_KEY=
FINNHUB_BASE_URL=
NEXT_PUBLIC_APPWRITE_ENDPOINT=
NEXT_PUBLIC_APPWRITE_PROJECT_ID=
NEXT_PUBLIC_GTM_ID=
OLLAMA_MODEL=
VERCEL_ORG_ID=
VERCEL_PROJECT_ID=
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Most stock market tools are either expensive, cluttered with ads, or locked behi
- Dark mode support
- Mobile-friendly responsive design

No paywall for core features. No tracking. Just a clean stock analysis tool you can run yourself.
No paywall for core features. No forced tracking. Just a clean stock analysis tool you can run yourself.

## Screenshots

Expand Down Expand Up @@ -92,6 +92,7 @@ Also required for trial features: `APPWRITE_COLLECTION_ID_TRIAL_SESSIONS`.
| `RATE_LIMIT_MAX_REQUESTS` | Max API requests per window | `100` |
| `RATE_LIMIT_WINDOW_SECONDS` | Rate limit window in seconds | `60` |
| `LOG_LEVEL` | Logging level | `info` |
| `NEXT_PUBLIC_GTM_ID` | Google Tag Manager container ID (enables GTM when set, e.g. `GTM-XXXXXXX`) | unset |
| `DEV_OVERRIDE_PRICING_TIER` | Temporary non-prod tier override (`FREE`,`ADS_FREE`,`LOCAL`,`BYOK`,`HOSTED_AI`) | unset |
| `DEV_OVERRIDE_PRICING_TIER_USER_IDS` | Optional comma-separated user IDs for scoped override | unset |

Expand Down
23 changes: 23 additions & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Metadata } from "next";
import { Ibarra_Real_Nova, Merriweather } from "next/font/google";
import Script from "next/script";
import "./globals.css";
import { Providers } from "./providers";

Expand Down Expand Up @@ -30,9 +31,20 @@ export default function RootLayout({
}: Readonly<{
children: React.ReactNode;
}>) {
const gtmId = process.env.NEXT_PUBLIC_GTM_ID?.trim();

return (
<html lang="en">
<head>
{gtmId ? (
<Script id="gtm-script" strategy="afterInteractive">
{`(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','${gtmId}');`}
</Script>
) : null}
<meta
name="viewport"
content="width=device-width, initial-scale=1, viewport-fit=cover"
Expand All @@ -46,6 +58,17 @@ export default function RootLayout({
<body
className={`${headingFont.variable} ${bodyFont.variable} antialiased`}
>
{gtmId ? (
<noscript>
<iframe
title="gtm"
src={`https://www.googletagmanager.com/ns.html?id=${gtmId}`}
height="0"
width="0"
style={{ display: "none", visibility: "hidden" }}
/>
</noscript>
) : null}
<Providers>{children}</Providers>
</body>
</html>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stock-exchange-app",
"version": "0.54.0",
"version": "0.55.0",
"private": true,
"scripts": {
"dev": "bun --bun next dev",
Expand Down
Loading