Overview
This guide covers setting up your development environment for Thalyson’s Portfolio, including Node.js requirements, environment variables, and development tools configuration.Prerequisites
Environment Variables
The application uses environment variables for configuration. Create a.env.local file in the root directory:
Environment Variable Reference
| Variable | Description | Required | Default |
|---|---|---|---|
NEXT_PUBLIC_URL | Base URL of your site | Yes | http://localhost:3000 |
NEXT_PUBLIC_GA_ID | Google Analytics Tracking ID | No | - |
ANALYZE | Enable bundle analyzer | No | false |
Environment variables prefixed with
NEXT_PUBLIC_ are exposed to the browser. Never store sensitive secrets with this prefix.Next.js Configuration
The project uses a custom Next.js configuration located innext.config.ts:
Key Configuration Features
- Bundle Analyzer: Enabled via
ANALYZE=trueenvironment variable - Image Optimization: Configured for Cloudinary remote images
- Turbopack: Development mode uses Turbopack for faster builds
TypeScript Configuration
The project uses TypeScript with strict mode enabled. Configuration intsconfig.json:
TypeScript Features
- Strict Mode: Enabled for better type safety
- Path Aliases: Use
@/to import from thesrcdirectory - Next.js Plugin: Provides type definitions for Next.js features
- JSX Support: Configured for React JSX transformation
ESLint Configuration
The project uses ESLint with Next.js recommended rules. Configuration ineslint.config.mjs:
Linting
Run ESLint to check for code quality issues:ESLint is integrated with Prettier for consistent code formatting. The configuration uses
eslint-config-prettier to prevent conflicts.Prettier Configuration
Code formatting is handled by Prettier. Configuration in.prettierrc:
Formatting
Format your code with Prettier:Development Workflow
Start Development Server
Run the development server with Turbopack:Your application will be available at
http://localhost:3000.Available Scripts
| Script | Description |
|---|---|
npm run dev | Start development server with Turbopack |
npm run build | Build for production |
npm run start | Start production server |
npm run lint | Run ESLint |
npm run format | Format code with Prettier |
Editor Setup
VS Code (Recommended)
Install these extensions for the best development experience:- ESLint: Integrates ESLint into VS Code
- Prettier: Code formatter
- Tailwind CSS IntelliSense: Autocomplete for Tailwind classes
- TypeScript and JavaScript Language Features: Built-in TypeScript support
Settings
Add to your.vscode/settings.json:
Troubleshooting
Port Already in Use
If port 3000 is already in use, specify a different port:Module Not Found
If you encounter module not found errors, try reinstalling dependencies:TypeScript Errors
Restart your TypeScript server in VS Code:- Press
Cmd+Shift+P(Mac) orCtrl+Shift+P(Windows/Linux) - Type “TypeScript: Restart TS Server”
- Press Enter