- β¨ Scaffolding Instructions
- π Description
- π§ Installation
- π Usage
- π§ͺ Testing
- π Features
- π§° Additional Resources
- π€ Contributing
- π License
- π¬ Contact
- ποΈ Project Structure
- π Deployment
- π§© Integrations
- π‘οΈ Security
- π¦ Packaging
- π§Ή Maintenance
- π References
- π¨βπ» Maintainer
Welcome to the deveric-nextjs-15-scafold-app! This project was automatically generated using our custom scaffolding script, designed to streamline the setup process for a robust Next.js application integrated with modern technologies. Below are the detailed steps and capabilities of the script:
Before running the scaffolding script, ensure you have the following installed on your system:
- Node.js (v18.x or later)
- Yarn (v1.22.22) or npm (v7.x or later) or pnpm (v6.x or later)
- Git
- jq (for JSON processing)
-
Make the Script Executable:
If the script isn't already executable, grant execute permissions:
chmod +x next-app.sh
-
Run the Setup Script:
./next-app.sh
What the Script Does:
- Scaffolds a Next.js 15 Application: Initializes a Next.js project with the App Router using a specific version of `create-next-app` to ensure compatibility.
- Configures React 19: Implicitly installs React and React-DOM at version 19 to maintain consistency and avoid multiple React instances using the npx create-next-app command.
- Installs Major Dependencies: Adds essential packages such as tRPC, React Query, Prisma, Material UI (with dark mode), NextAuth, and more, ensuring they are compatible with React 19.
- Sets Up Development Tools: Installs development dependencies including TypeScript, ESLint, Prettier, Tailwind CSS, and others for a seamless development experience.
- Enforces Single React Version: Utilizes package manager-specific configurations (`resolutions` for Yarn, `overrides` for pnpm/npm) to ensure only one instance of React is used across all dependencies.
- Deduplicates Dependencies: Runs deduplication processes to eliminate redundant packages, preventing potential conflicts.
- Creates Project Structure: Sets up necessary folders, hooks, providers, and configuration files.
- Generates a Comprehensive README: Automatically creates a detailed `README.md` capturing all aspects of the project setup.
- Creates CONTRIBUTING.md & CODE_OF_CONDUCT.md: Automatically creates detailed `CONTRIBUTING.md` & `CODE_OF_CONDUCT.md` files.
- Creates .gitignore: Automatically creates a detailed `.gitignore` file.
- Creates LICENSE: Automatically creates a detailed `LICENSE` file.
- Creates tsconfig.json: Automatically creates a detailed `tsconfig.json` file.
- Creates next-seo.config.ts: Automatically creates a detailed `next-seo.config.ts` file with aliases configured.
- Creates jest.config.js: Automatically creates a detailed `jest.config.js` file.
- Creates jest.setup.js: Automatically creates a detailed `jest.setup.js` file.
- Creates mocha.config.js: Automatically creates a detailed `mocha.config.js` file.
- Creates mocha.opts: Automatically creates a detailed `mocha.opts` file.
- Creates cypress/e2e/example.cy.ts: Automatically creates a detailed `cypress/e2e/example.cy.ts` file.
- Creates tests/unit/example.test.ts: Automatically creates a detailed `tests/unit/example.test.ts` file.
- Creates tests/integration/example.test.ts: Automatically creates a detailed `tests/integration/example.test.ts` file.
- Creates pages.tsx and layout.tsx: Automatically creates detailed `pages.tsx` & `layout.tsx` files with the relevant providers session, auth, trpc, theme, etc.
- Creates globals.css: Automatically creates a detailed `globals.css` file.
- Creates prisma/schema.prisma: Automatically creates a detailed `prisma/schema.prisma` file.
- Creates public/og-image.png: Automatically creates a detailed `public/og-image.png` file.
- Creates scripts/setup.sh: Automatically creates a detailed `scripts/setup.sh` file.
- Creates package.json: Automatically creates a detailed `package.json` file.
- Creates README.md: Automatically creates a detailed `README.md` file.
- Creates components, context, hooks, providers, utils, etc: Automatically creates detailed `components, context, hooks, providers, utils, etc.` files with some pre-configured examples.
The scaffolding script is designed to be flexible. You can adjust variables such as:
PROJECT_NAME: Change the default project name.PKG_MGR: Switch between `yarn`, `npm`, or `pnpm` based on your preference.AUTHOR_NAME,AUTHOR_EMAIL,AUTHOR_URL: Update contact information in the README.
Feel free to modify the script (`setup.sh`) to suit your project's specific needs.
A Next.js 15 (App Router) project with TypeScript, dark-mode Material UI, tRPC, NextAuth, and Prisma. This application is designed to provide a scalable and maintainable foundation for modern web development, leveraging powerful tools and best practices.
Clone the repository and install the dependencies using your preferred package manager (if you wish to modify the generated app directly, it's recommended you use the script to set your preferences).
git clone https://github.com/EricGitangu/deveric-nextjs-15-scafold-app.git
cd deveric-nextjs-15-scafold-app
yarn installNote: Replace `yarn install` with `npm install` or `pnpm install` if you're using a different package manager.
Start the development server and navigate to http://localhost:3000 to view the application.
yarn devNote: Replace `yarn dev` with `npm run dev` or `pnpm dev` based on your package manager.
This project includes a comprehensive testing setup covering unit, integration, and end-to-end tests. Assuming yarn as our package manager but pnpm & npm support available).
Run unit tests to ensure individual components and functions work as expected.
yarn testExecute integration tests to validate the interactions between different parts of the application.
yarn test:integrationLaunch Cypress to perform end-to-end testing, simulating real user interactions.
yarn cypress:openNote: Ensure the development server is running before executing end-to-end tests.
- Next.js 15 (App Router): Leverage the latest features of Next.js for building scalable applications.
- TypeScript: Enjoy type safety and enhanced developer experience with TypeScript integration.
- Material UI with Dark Mode: Implement sleek and responsive UI components with built-in dark mode support.
- tRPC: Build end-to-end type-safe APIs effortlessly.
- NextAuth: Secure and flexible authentication solutions.
- Prisma: Robust database ORM for seamless data management.
- Tailwind CSS: Utility-first CSS framework for rapid UI development.
- ESLint & Prettier: Maintain code quality and consistency with automated linting and formatting.
- Turbopack: Utilize the high-performance bundler for optimized builds.
- Comprehensive Testing: Ensure application reliability with Jest, Mocha, and Cypress integrations.
- Next.js Documentation
- Material UI Documentation
- tRPC Documentation
- Prisma Documentation
- NextAuth.js Documentation
- Tailwind CSS Documentation
- Jest Documentation
- Mocha Documentation
- Cypress Documentation
- Turbopack Documentation
- Yarn Resolutions
- pnpm Overrides
- npm Overrides
Contributions are welcome! Please read CONTRIBUTING.md for guidelines on how to contribute to this project.
This project is licensed under the MIT License.
Author: Eric Gitangu
Email: developer@ericgitangu.com
Website: https://https://developer.ericgitangu.com
GitHub: EricGitangu
Ensure all tests pass to maintain code integrity and reliability.
yarn testyarn test:unityarn test:integrationyarn cypress:opendeveric-nextjs-15-scafold-app/
βββ app/
β βββ components/
β β βββ SEO.tsx
β βββ hooks/
β β βββ useTRPC.ts
β β βββ useTheme.ts
β βββ providers/
β β βββ TrpcProvider.tsx
β βββ layout.tsx
β βββ page.tsx
β βββ globals.css
βββ prisma/
β βββ schema.prisma
βββ public/
β βββ og-image.png
βββ scripts/
β βββ setup.sh
βββ .eslintrc.js
βββ .prettierrc
βββ next.config.js
βββ tailwind.config.js
βββ tsconfig.json
βββ package.json
βββ README.md
βββ LICENSE
Note: This structure may vary based on your project's specific needs.
-
Push to GitHub:
Note: This script does the initial commit. Create your repo first, e.g, github.com/{AUTHOR_NAME}/{PROJECT_NAME}. Ensure SSH key is added to GitHub and locally ~/.ssh/id_rsa.pub for pull/push access.
git remote add origin https://github.com/Eric Gitangu/deveric-nextjs-15-scafold-app.git git branch -M main git push -u origin main
-
Connect to Vercel:
- Visit Vercel and sign in.
- Import your GitHub repository.
- Follow the prompts to deploy.
Tip: Ensure environment variables and secrets are correctly configured in your deployment platform for OAuth and next-auth.
- tRPC: For building type-safe APIs without the need for a schema or code generation.
- Prisma: Simplifies database management with an intuitive ORM.
- NextAuth: Provides authentication solutions with support for multiple providers.
- Material UI: Offers a comprehensive suite of UI components with theming capabilities.
- Tailwind CSS: Enables rapid UI development with utility-first CSS.
- ESLint & Prettier: Ensures code quality and consistency across the codebase.
- Turbopack: Enhances build performance with an advanced bundler.
- Dependencies: Regularly update dependencies to patch known vulnerabilities.
- Environment Variables: Securely manage sensitive information using environment variables.
- Authentication: Utilize robust authentication mechanisms provided by NextAuth.
- Dependabot: Consider using Dependabot to automatically monitor your dependencies.
- GitHub Actions: Consider using GitHub Actions for CI/CD and security monitoring.
- Build Scripts: Customize build processes in
package.jsonas needed. - Optimizations: Leverage Next.js and Turbopack optimizations for production-ready builds.
- Regular Updates: Keep dependencies and tools up-to-date.
- Code Reviews: Implement a code review process to maintain code quality.
- Documentation: Continuously update documentation to reflect changes.
Note: Tested with React 19, React-DOM 19 & Next.js 15.
- Next.js 15 Documentation
- React 19 Documentation
- React-DOM 19 Documentation
- Material UI Documentation
- tRPC Documentation
- Prisma Documentation
- NextAuth.js Documentation
- π€ Name: Eric Gitangu
- π§ Email: developer@ericgitangu.com
- π Website: https://developer.ericgitangu.com
- π GitHub: EricGitangu
- πΌ LinkedIn: linkedin.com/in/ericgitangu