A production-ready Next.js starter template with enterprise-grade tooling and configurations. Built with modern development practices in mind, this template provides a robust foundation for scaling web applications.
- 🏗️ Next.js 15 with App Router and React Server Components
- 🎨 TailwindCSS for styling with custom theming
- 🧰 ShadCN for beautiful, accessible UI components
- 📝 BiomeJS for lightning-fast linting and formatting
- 🌐 i18next for internationalization
- 🔐 AppWrite for authentication and backend services
- 📦 PNPM for efficient package management
- 🚀 Vercel deployment optimized
- 📊 Analytics integration with Vercel Insights
- 🧪 Testing setup with Jest
- 🔄 CI/CD with GitHub Actions
- 📈 SonarQube integration for code quality analysis
- Node.js 18.x or later
- PNPM 8.x or later
- Git
- Clone the repository:
git clone https://github.com/besmillahibrahimi/nextjs-appwrite.git your-project
cd your-project- Install dependencies:
pnpm install- Copy the example environment file:
cp .env.example .env.local- Update the environment variables in
.env.localwith your credentials:
NEXT_PUBLIC_APPWRITE_ENDPOINT=your_appwrite_endpoint
NEXT_PUBLIC_APPWRITE_PROJECT_ID=your_project_id
NEXT_PUBLIC_APPWRITE_DATABASE_ID=your_database_id
NEXT_PUBLIC_GA_MEASUREMENT_ID=your_ga_id- Start the development server:
pnpm dev- Open http://localhost:3000 in your browser.
public/
└── locales/ # TypeScript types
src/
├── app/ # Next.js app directory
├── components/ # Reusable UI components
├── features/ # Feature-based modules
├── lib/ # Utility functions
├── configs/ # config files like appwrite, env, i18n
├── styles/ # Global styles
├── tests/ # Test files
└── types/ # TypeScript types
pnpm dev # Start development server
pnpm build # Build for production
pnpm start # Start production server
pnpm lint # Run BiomeJS linting
pnpm format # Format code with BiomeJS
pnpm test # Run tests- Linting: BiomeJS is configured for both linting and formatting
- Type Checking: Strict TypeScript configuration
- Testing: Jest setup for unit and integration tests
- Git Hooks: Husky configured for pre-commit checks
Add new languages by:
- Create a new locale file in
src/locales/ - Add the locale to
next-i18next.config.js - Use translations in your components:
import { useTranslation } from 'next-i18next';
export function MyComponent() {
const { t } = useTranslation('common');
return <h1>{t('hello')}</h1>;
}AppWrite authentication is pre-configured. To use:
- Set up your AppWrite project
- Update environment variables
- Use the pre-built authentication hooks:
import { useAuth } from '@/features/auth/hooks';
export function ProtectedComponent() {
const { user, signIn, signOut } = useAuth();
// Your component logic
}- Connect your GitHub repository to Vercel
- Configure environment variables in Vercel dashboard
- Deploy with
git pushto main branch
- Build the application:
pnpm build- Start the production server:
pnpm startGitHub Actions workflow is configured to run on pull requests:
- Linting and formatting checks
- Type checking
- Unit tests
- SonarQube analysis
Set up SonarQube:
- Configure SonarQube server
- Add SONAR_TOKEN and SONAR_HOST_URL to GitHub secrets
- View analysis results in SonarQube dashboard
- 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
- Follow the provided PR template
- Ensure all checks pass
- Include tests for new features
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: [Link to your documentation]
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Next.js team for the amazing framework
- Vercel for the deployment platform
- AppWrite for backend services
- All other open-source contributors
Created with ❤️ by Besmillah Ibrahimi