This project is a feature-rich Next.js application that serves as my personal blog and portfolio with advanced functionality including content management, search capabilities, and analytics integration.
The application is built using Next.js 14 and leverages a variety of modern web technologies to create a fast, responsive, and user-friendly experience. It includes features such as a blog with MDX support, a projects showcase, a professional timeline, and integration with various third-party services.
.
├── app/ # Next.js 13+ app directory
├── components/ # React components
├── config/ # Configuration files
├── contentlayer.config.ts # Contentlayer configuration
├── data/ # Static data files
├── hooks/ # Custom React hooks
├── lib/ # Utility functions and libraries
├── pages/ # Next.js pages (API routes)
├── public/ # Static assets
├── styles/ # Global styles
└── types/ # TypeScript type definitions
Key Files:
app/layout.tsx
: Main layout componentapp/page.tsx
: Home page componentcomponents/coding-timeline.tsx
: Professional experience timelinecontentlayer.config.ts
: Content management configurationnext.config.js
: Next.js configurationpackage.json
: Project dependencies and scriptstailwind.config.js
: Tailwind CSS configuration
Prerequisites:
- Node.js 18.x or later
- npm 9.x or later
Steps:
- Clone the repository
- Run
npm install
to install dependencies
- Start the development server:
npm run dev
- Open
http://localhost:3000
in your browser
- Site metadata: Edit
config/site-metadata.ts
- Navigation links: Modify
config/nav-links.ts
- Content: Add or edit MDX files in the
data/
directory
-
Adding a new blog post:
- Create a new MDX file in
data/blog/
- Use the front matter to add metadata
- Create a new MDX file in
-
Updating the projects showcase:
- Edit
data/projectsData.ts
- Edit
-
Modifying the professional timeline:
- Update
components/coding-timeline.tsx
- Update
Run linting:
npm run lint
Run Prettier:
npm run prettier:check
npm run prettier:fix
Common issues:
-
Content not updating:
- Ensure Contentlayer is properly configured in
contentlayer.config.ts
- Restart the development server
- Ensure Contentlayer is properly configured in
-
Styling issues:
- Check Tailwind CSS classes in components
- Verify
tailwind.config.js
settings
-
Build errors:
- Review console output for specific error messages
- Ensure all dependencies are installed and up-to-date
For debugging:
- Enable verbose logging in Next.js by setting the
DEBUG
environment variable:DEBUG=* npm run dev
- Check the browser console for client-side errors
- Review server logs in the terminal running the Next.js server
The application's data flow centers around content management and rendering:
- Content Creation: MDX files in the
data/
directory contain blog posts and author information. - Content Processing: Contentlayer processes MDX files during build time, generating TypeScript types and JSON data.
- Page Generation: Next.js pages in the
app/
directory fetch processed content using Contentlayer's generated APIs. - Rendering: React components in the
components/
directory receive content data as props and render it. - User Interaction: Components like search and comments handle user input and update the UI accordingly.
[MDX Files] -> [Contentlayer] -> [Next.js Pages] -> [React Components] -> [User Interface]
^ ^ |
| | |
+--------------------------------+---------------------+
(User Interaction)
Prerequisites:
- Vercel account (recommended) or another Next.js-compatible hosting platform
Steps:
- Connect your GitHub repository to Vercel
- Configure environment variables if necessary
- Deploy the application
Vercel will automatically detect the Next.js project and apply the appropriate build settings.
The project primarily relies on Vercel's infrastructure for deployment and hosting. Key configuration files include:
-
next.config.js
: Configures Next.js build and runtime behavior- Enables Contentlayer integration
- Sets up bundle analysis
- Configures Content Security Policy
- Defines custom security headers
- Configures webpack for SVG handling
-
renovate.json
: Manages dependency updates- Extends recommended Renovate configuration
- Customizes commit message prefixes for different update types
- Configures automerge settings for non-major updates
These configurations ensure secure, optimized, and up-to-date deployments on the Vercel platform.