Skip to content

AojdevStudio/Dental-Case-Acceptance-Analytics

Repository files navigation

Dental Case Acceptance Analytics

A comprehensive analytics dashboard showing dental case acceptance rates, financial impact, and industry benchmarks.

πŸš€ Features

  • ⚑ 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

πŸ“‹ Prerequisites

  • Node.js 18.17.0 or later
  • npm or yarn package manager

πŸ—οΈ Getting Started

Note: This starter template uses @latest versions 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.

  1. Clone the repository:
git clone <your-repo-url>
cd dental-case-acceptance-analytics
  1. Install dependencies:
npm install
# or
yarn install
  1. Create a .env.local file in the root directory:
touch .env.local
  1. Start the development server:
npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

πŸ“ Project Structure

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

πŸ”§ Available Scripts

  • npm run dev - Run development server
  • npm run build - Build for production
  • npm start - Start production server
  • npm run lint - Lint code with ESLint
  • npm run test - Run tests with Jest
  • npm run test:watch - Run tests in watch mode

πŸ” Authentication

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.

πŸ“š Best Practices

This starter follows best practices for Next.js development:

Server Components

  • Use React Server Components where possible
  • Only add 'use client' directive when needed
  • Keep client components lean

Performance

  • Implement proper image optimization with next/image
  • Use dynamic imports for code splitting
  • Lazy load components when appropriate

Accessibility

  • Use semantic HTML elements
  • Include proper ARIA attributes
  • Ensure keyboard navigation works
  • Test with screen readers

State Management

  • Use local state for component-specific state
  • Use server actions for form submissions
  • Keep client-side state minimal

πŸ› οΈ Cursor Editor Integration

This starter includes special .cursor/rules for Cursor editor integration:

  • nextjs-best-practices.mdc - Next.js best practices and patterns
  • react-component-patterns.mdc - React component structure and patterns

These rules help maintain consistency and follow best practices in your codebase.

🧩 Custom Components

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

Dark mode is built-in and can be toggled using Tailwind CSS classes:

  • Add the dark class to the html tag to enable dark mode
  • Use dark: prefix for dark mode styles

πŸ”„ Continuous Integration

The starter includes a GitHub Actions workflow for CI/CD:

  • Run ESLint
  • Run tests
  • Build the application

πŸ“± Responsive Design

The starter uses a mobile-first approach with Tailwind CSS:

  • Responsive breakpoints: sm, md, lg, xl, 2xl
  • Consistent spacing and sizing

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Copyright (c) 2024 Next.js Starter Kit. All rights reserved.

πŸ™ Acknowledgments

🎯 Quick Start for Basic Webpage

If you want to use this starter kit for a simple webpage (without authentication and complex features), follow these steps:

  1. Clone this repository:
git clone https://github.com/AojdevStudio/nextjs-starter.git my-project
cd my-project
  1. Run the simplification script:
node scripts/simplify.js

This 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
  1. Start the development server:
npm run dev

Your 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

Customizing the Chart

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.

Running on Replit

  1. Create a new Repl and select "Import from GitHub"
  2. Paste your repository URL
  3. In the Replit shell, run:
npm install
npm run dev
  1. Important: Make sure to set the "Run" button command to:
npm run dev

Environment Variables

No environment variables are required for basic functionality.

Built With

Development

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm start - Start production server
  • npm run lint - Run ESLint

Troubleshooting

Common Issues

  1. Module not found errors

    • Run npm install again
    • Clear .next cache: rm -rf .next
    • Ensure Node.js version is 18.17.0 or later
  2. 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
  3. 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors