A comprehensive analytics dashboard showing dental case acceptance rates, financial impact, and industry benchmarks.
- β‘ Next.js - Latest Next.js with App Router
- βοΈ React - Latest React version with hooks and server components
- π TypeScript - Type safety and better developer experience
- π¨ Tailwind CSS - Utility-first CSS framework
- π Authentication - Ready-to-use auth with NextAuth.js
- π§© Component Library - Basic UI components to get started
- π ESLint & Prettier - Code quality and formatting
- π§ͺ Testing Setup - Jest configuration for testing
- π± Responsive Design - Mobile-first approach
- π Dark Mode - Built-in dark mode support
- π’ CI/CD - GitHub Actions workflow
- π¦ Directory Structure - Organized project structure
- π οΈ Cursor Editor Integration - Best practices and rules
- Node.js 18.17.0 or later
- npm or yarn package manager
Note: This starter template uses
@latestversions for all dependencies, ensuring you always get the most up-to-date packages when you create a new project. This design choice makes the template future-proof, but be aware that breaking changes in newer versions may require adjustments.
- Clone the repository:
git clone <your-repo-url>
cd dental-case-acceptance-analytics- Install dependencies:
npm install
# or
yarn install- Create a
.env.localfile in the root directory:
touch .env.local- Start the development server:
npm run dev
# or
yarn devOpen http://localhost:3000 with your browser to see the result.
nextjs-starter/
βββ .github/ # GitHub actions and configuration
βββ .vscode/ # VS Code settings
βββ .cursor/ # Cursor editor integration
βββ public/ # Static assets
βββ src/ # Source directory
β βββ app/ # App Router pages
β β βββ (auth)/ # Auth route group
β β β βββ login/ # Login page
β β β βββ register/ # Register page
β β βββ api/ # API routes
β β β βββ auth/ # Auth API routes
β β βββ dashboard/ # Dashboard page
β β βββ favicon.ico # Favicon
β β βββ globals.css # Global styles
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Home page
β βββ components/ # React components
β β βββ auth/ # Auth components
β β βββ common/ # Common components
β β βββ layout/ # Layout components
β β βββ ui/ # UI components
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utility libraries
β βββ types/ # TypeScript types
β βββ styles/ # Component styles
βββ .env.example # Example environment variables
βββ .eslintrc.json # ESLint configuration
βββ .gitignore # Git ignore file
βββ .prettierrc # Prettier configuration
βββ jest.config.js # Jest configuration
βββ next.config.js # Next.js configuration
βββ package.json # Package dependencies
βββ postcss.config.js # PostCSS configuration
βββ README.md # Project documentation
βββ tailwind.config.js # Tailwind configuration
βββ tsconfig.json # TypeScript configuration
npm run dev- Run development servernpm run build- Build for productionnpm start- Start production servernpm run lint- Lint code with ESLintnpm run test- Run tests with Jestnpm run test:watch- Run tests in watch mode
This starter comes with NextAuth.js pre-configured. By default, it includes:
- Credentials Provider (email/password)
- GitHub OAuth Provider
- Google OAuth Provider
To use social providers, you need to add your own API keys in the .env.local file.
This starter follows best practices for Next.js development:
- Use React Server Components where possible
- Only add 'use client' directive when needed
- Keep client components lean
- Implement proper image optimization with next/image
- Use dynamic imports for code splitting
- Lazy load components when appropriate
- Use semantic HTML elements
- Include proper ARIA attributes
- Ensure keyboard navigation works
- Test with screen readers
- Use local state for component-specific state
- Use server actions for form submissions
- Keep client-side state minimal
This starter includes special .cursor/rules for Cursor editor integration:
nextjs-best-practices.mdc- Next.js best practices and patternsreact-component-patterns.mdc- React component structure and patterns
These rules help maintain consistency and follow best practices in your codebase.
The starter includes several custom components to help you get started:
- Authentication components (Login, Register)
- Layout components (Header, Footer)
- UI components (Button, Card, etc.)
Dark mode is built-in and can be toggled using Tailwind CSS classes:
- Add the
darkclass to thehtmltag to enable dark mode - Use
dark:prefix for dark mode styles
The starter includes a GitHub Actions workflow for CI/CD:
- Run ESLint
- Run tests
- Build the application
The starter uses a mobile-first approach with Tailwind CSS:
- Responsive breakpoints: sm, md, lg, xl, 2xl
- Consistent spacing and sizing
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2024 Next.js Starter Kit. All rights reserved.
If you want to use this starter kit for a simple webpage (without authentication and complex features), follow these steps:
- Clone this repository:
git clone https://github.com/AojdevStudio/nextjs-starter.git my-project
cd my-project- Run the simplification script:
node scripts/simplify.jsThis script will:
- Remove unnecessary directories and files
- Remove unused dependencies
- Add Chart.js and React Chart.js 2
- Update the homepage with a sample chart
- Install the required dependencies
The simplified structure will be:
my-project/
βββ public/ # Static assets
βββ src/ # Source directory
β βββ app/ # App Router pages
β β βββ globals.css # Global styles
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Home page
β βββ components/ # React components
β β βββ common/ # Common components
β β βββ ui/ # UI components
β βββ lib/ # Utility libraries
βββ package.json # Package dependencies
βββ tailwind.config.js # Tailwind configuration
βββ tsconfig.json # TypeScript configuration
- Start the development server:
npm run devYour simplified Next.js application will be running at http://localhost:3000 with:
- β‘ Modern React and Next.js
- π¨ Tailwind CSS styling
- π Chart.js integration
- π± Responsive design
- π Dark mode support
The sample chart in src/app/page.tsx can be easily customized:
- Change the chart type (Line, Bar, Pie, etc.)
- Modify the data and labels
- Adjust the styling and options
- Add more charts to the dashboard
For more chart types and options, visit the React Chart.js 2 documentation.
- Create a new Repl and select "Import from GitHub"
- Paste your repository URL
- In the Replit shell, run:
npm install
npm run dev- Important: Make sure to set the "Run" button command to:
npm run devNo environment variables are required for basic functionality.
- Next.js - The React framework
- Tailwind CSS - CSS framework
- Recharts - Charting library
- shadcn/ui - UI components
npm run dev- Start development servernpm run build- Build for productionnpm start- Start production servernpm run lint- Run ESLint
-
Module not found errors
- Run
npm installagain - Clear
.nextcache:rm -rf .next - Ensure Node.js version is 18.17.0 or later
- Run
-
Build failures
- Ensure all dependencies are installed
- Clear npm cache:
npm cache clean --force - Delete node_modules and reinstall:
rm -rf node_modules && npm install
-
Replit-specific issues
- Use Node.js 18.x or later in Replit
- Set correct run command in Replit config
- Ensure all dependencies are properly installed