This document describes configuration files and environment setup in AlexJSully’s Portfolio project, their roles, technical details, and how to update or extend them.
Configs manage environment variables, service integrations, and global settings for the app. They enable features like Firebase, Sentry error tracking, and custom runtime options.
src/configs/firebase.ts: Firebase configuration and initializationfirebase.test.ts: Test configuration for Firebase.env: Environment variables (API keys, secrets)next.config.js: Next.js build/runtime configsentry.client.config.ts, sentry.server.config.ts, sentry.edge.config.ts: Sentry error trackingThe 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.
const apiKey = process.env.NEXT_PUBLIC_API_KEY;
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.config.js
module.exports = {
reactStrictMode: true,
env: {
NEXT_PUBLIC_API_KEY: process.env.NEXT_PUBLIC_API_KEY,
},
};
.env and referenced in code using process.env.*.src/configs/ for new services..env for new environment variables.README.md and relevant docs.