Features Config
On/off switches for every optional module.
File: config/features.config.ts
Toggle features without touching code. When a flag is false:
- Related UI components hide themselves
- API routes return 404
- Cron jobs associated with the feature are skipped
The core platform (submissions, payments, auth, admin) is always active — you can't turn those off.

All flags
| Flag | Default | What it adds |
|---|---|---|
partners | true | Partner/sponsor slots in the sidebar (monthly subscriptions). |
badges | true | Embeddable "Featured on …" badges for winners. |
backlinks | true | Dofollow/nofollow toggle on outbound project links. |
socialProof | true | Live counters, "X people submitted today" widgets. |
newsletter | true | Email newsletter signup (uses Resend). |
blog | true | /blog section, SEObot integration for AI articles. |
webhooksExternal | true | Outbound webhooks (Discord/Slack) on events. |
adBanner | true | Top horizontal banner above the header. |
bookmarks | true | Logged-in users can save projects. |
ratings | true | 1–5 star ratings on project pages. |
comments | true | Comment threads on project pages. |
promotions | true | Paid ad placements (banner, catalog cards, detail cards). |
analytics | true | Enhanced tracking: device, browser, country, per-project events. |
ai | false | AI-powered description generation & category suggestions. |
i18n | false | Multi-language via next-intl. |
Where flags are checked
In API routes
import { featureGuard } from '@/lib/features';
export async function GET() {
const guard = featureGuard('partners');
if (guard) return guard; // 404 response if disabled
// ... normal logic
}In server components
import { isFeatureEnabled } from '@/lib/features';
if (isFeatureEnabled('comments')) {
// render comments
}In client components
import { useFeatures } from '@/hooks/use-features';
function ProjectPage() {
const { isEnabled } = useFeatures();
return (
<>
<ProjectInfo />
{isEnabled('ratings') && <StarRating />}
{isEnabled('comments') && <Comments />}
</>
);
}Common recipes
"Free-only" directory (no payments)
Don't disable promotions — disable payments at the provider level instead. In config/payments.config.ts:
export const paymentsConfig = {
provider: 'none', // disables all paid flows
testMode: false,
};Launch MVP with minimum features
Set everything except the essentials to false:
export const featuresConfig: FeaturesConfig = {
partners: false,
badges: false,
backlinks: true, // keep — nice for SEO
socialProof: false,
newsletter: true, // keep — grows your list
blog: false,
webhooksExternal: false,
adBanner: false,
bookmarks: false,
ratings: false,
comments: false,
promotions: false,
analytics: true, // keep — you need usage data
ai: false,
i18n: false,
};Ship, watch what users ask for, turn flags back on one at a time.
Turning on AI features
- Set
ai: truehere - Set
AI_PROVIDER,AI_MODEL,AI_API_KEYin.env.local - See AI Config for options
With AI
Edit config/features.config.ts for my directory about {your niche}. I'm launching an MVP — enable only the features that are critical for day one and disable the rest to keep the UI focused.
Must-have for me: {list what matters most — e.g. "submissions, pricing, analytics"}. Nice-to-have (disable for now): {list what to defer — e.g. "ratings, comments, promotions"}.
For each flag, briefly tell me why you enabled or disabled it. Preserve the FeaturesConfig type.