AlexJSully-Portfolio

Configs Module Documentation

This document describes configuration files and environment setup in AlexJSully’s Portfolio project, their roles, technical details, and how to update or extend them.

Purpose

Configs manage environment variables, service integrations, and global settings for the app. They enable features like Firebase, Sentry error tracking, and custom runtime options.

Structure

Usage Examples

Firebase configuration and usage

The runtime src/configs/firebase.ts exposes two named functions you should use from the app:

import { init, logAnalyticsEvent } from '@configs/firebase';

// Initialize Firebase (call once on app start)
init();

// Log analytics events anywhere in the app
logAnalyticsEvent('my_event', { foo: 'bar' });

There is no default export in the implementation — use the named exports above.

Using Environment Variables

const apiKey = process.env.NEXT_PUBLIC_API_KEY;

Sentry Configuration

Sentry is configured via the repository’s sentry.*.config.ts files. Use Sentry’s Next.js SDK initialization patterns in those files; the app uses the standard @sentry/nextjs entrypoints. Example usage in application code:

import * as Sentry from '@sentry/nextjs';

Sentry.init({ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN });

Next.js Config Example

// next.config.js
module.exports = {
	reactStrictMode: true,
	env: {
		NEXT_PUBLIC_API_KEY: process.env.NEXT_PUBLIC_API_KEY,
	},
};

Integration & Relationships

Extending Configs