A modern Next.js frontend application for Mongzen, designed to work with a Strapi backend API.
- 🚀 Next.js 15 with App Router
- 🎨 Tailwind CSS for styling
- 📱 Responsive Design that works on all devices
- 🔌 Strapi Integration for content management
- 🎯 TypeScript for type safety
- 📋 ESLint & Prettier for code quality
- 🚀 CI/CD with GitHub Actions
- ⚡ Performance Optimized with modern best practices
- Framework: Next.js 15
- Language: TypeScript
- Styling: Tailwind CSS
- HTTP Client: Axios
- Linting: ESLint
- Formatting: Prettier
- Deployment: Vercel
- CI/CD: GitHub Actions
src/
├── app/ # Next.js App Router pages
│ ├── about/ # About page
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout
│ └── page.tsx # Home page
├── components/ # Reusable UI components
│ ├── layout/ # Layout components (Header, Footer)
│ └── ui/ # UI components (Button, Card, etc.)
├── hooks/ # Custom React hooks
│ └── useApi.ts # API hooks
├── lib/ # Utility libraries
├── services/ # API services
│ └── api.ts # Strapi API service
├── types/ # TypeScript type definitions
│ ├── api.ts # API response types
│ ├── common.ts # Common types
│ └── index.ts # Type exports
└── utils/ # Utility functions
└── index.ts # Helper functions
- Node.js 18+
- npm or yarn
- Strapi backend running on
http://localhost:1337(optional - fallback data provided)
-
Clone the repository
git clone <repository-url> cd digital-agency/frontend
-
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env.local
Edit
.env.localwith your configuration:NEXT_PUBLIC_API_URL=http://localhost:1337 NODE_ENV=development
-
Run the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run lint:fix- Fix ESLint errorsnpm run format- Format code with Prettiernpm run format:check- Check code formatting
The application integrates with a Strapi backend API. The main API endpoints used are:
GET /api/home?populate=*- Homepage contentGET /api/about?populate=*- About page contentGET /api/projects?populate=*- Projects listingGET /api/services?populate=*- Services listingPOST /api/contact-forms- Contact form submission
The application includes fallback content that displays when the Strapi backend is not available, ensuring the site remains functional during development or if the API is down.
- Button - Customizable button with variants
- Card - Content container with header, content, and footer
- LoadingSpinner - Loading indicators
- Header - Navigation header with mobile menu
- Footer - Site footer with links and social media
- useApi - Custom hooks for API calls (useHomePage, useAboutPage, etc.)
- Connect your repository to Vercel
- Set environment variables in Vercel dashboard
- Deploy automatically on push to main branch
npm run build
npm run startThe project includes GitHub Actions workflows for:
- Code Quality: ESLint and Prettier checks
- Build Testing: Ensures the application builds successfully
- Deployment: Automatic deployment to Vercel
- Strapi Deployment: Deployment configuration for Heroku/DigitalOcean
For the CI/CD pipeline to work, add these secrets to your GitHub repository:
VERCEL_TOKEN=your_vercel_token
VERCEL_ORG_ID=your_vercel_org_id
VERCEL_PROJECT_ID=your_vercel_project_id
NEXT_PUBLIC_API_URL=your_strapi_api_url
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project uses:
- ESLint for code linting
- Prettier for code formatting
- TypeScript for type checking
Run npm run lint:fix and npm run format before committing.
This project is licensed under the MIT License.
For support, please open an issue on GitHub or contact our team.
Happy coding! 🚀