A modern and efficient platform for small business owners to manage their appointments and services, built with the latest web technologies.
Live Demo: https://smepro-lime.vercel.app/
This project is built with the following technologies:
- Next.js 14 with App Router
- React 19
- TypeScript
- Prisma ORM with PostgreSQL
- NextAuth.js for authentication (including Google OAuth)
- TailwindCSS and Shadcn UI
- Zod for data validation
- Framer Motion for smooth animations
- Real-time appointment scheduling system
- User authentication with Google
- Service and schedule management
- Responsive design
- Secure validations with Zod
- Node.js 18+ installed
- PostgreSQL installed and running
- Google Account (for OAuth setup)
- Stripe CLI
- Clone the repository:
git clone https://github.com/ivanfslDEV/smepro.git
cd smepro- Install dependencies:
npm install- Set up environment variables:
cp .env.example .env- Set up your database:
npx prisma migrate dev- Start the development server:
npm run dev- Start the Stripe CLI:
npm run stripe:listenVisit http://localhost:3000 to see the result.
The project follows a clean and modular architecture, with clear separation of concerns:
src/
app/ # Next.js App Router
(panel)/ # Protected Routes (Auth Required)
dashboard/ # Business Dashboard
_actions/ # Server Actions
_components/ # Route-specific Components
_data-access/ # Data Fetching Logic
page.tsx # Dashboard View
plans/ # Subscription Plans
profile/ # User Profile Management
services/ # Service Management
(public)/ # Public Routes
_components/ # Public Components
business/ # Business Public Profile
page.tsx # Landing Page
not-found.tsx # Custom 404 Not Found Page
api/ # API Routes
auth/ # Authentication Endpoints
business/ # Business Management
schedule/ # Scheduling Endpoints
components/ # Shared Components
ui/ # UI Components (shadcn/ui)
session-auth.tsx # Authentication Component
lib/ # Core Configurations
auth.ts # NextAuth Configuration
prisma.ts # Prisma Client Instance
utils.ts # Utility Functions
providers/ # React Context Providers
queryClient.tsx # React Query Provider
types/ # TypeScript Definitions
next-auth.d.ts # Auth Type Extensions
utils/ # Utility Functions
permissions/ # Permission Checks
plans/ # Subscription Logic
stripe/ # Payment Integration
- Uses NextAuth.js for secure authentication
- Google OAuth integration for easy sign-in
- Session-based authentication with JWT tokens
- Role-based access control for different user types
-
Client Layer
- React components in
app/andcomponents/ - React Query for client-state management
- Server Components for initial data loading
- React components in
-
API Layer
- Route Handlers in
api/ - Server Actions in
_actions/for form submissions - Data validation using Zod schemas
- Route Handlers in
-
Service Layer
- Business logic in
utils/andlib/ - Permission checks and subscription management
- Integration with external services (Stripe)
- Business logic in
-
Data Layer
- Prisma ORM for database operations
- PostgreSQL database
- Type-safe database queries
- Feature-first folder organization
- Colocation of related code
- Separation of UI and business logic
- Server-side rendering for better SEO
- Middleware for auth protection
- Modular component architecture
This project includes end-to-end tests using Cypress.
- Interactive Mode (Cypress Test Runner):
npx cypress openThis opens the Cypress GUI where you can select and run tests interactively.
- Headless Mode (CI/CD):
npm run cypress:runRuns all tests in headless mode, suitable for automated pipelines.
Tests are located in the cypress/ directory:
cypress/
e2e/ # End-to-End Tests
appointment.cy.ts # Appointment Management Tests
dashboard.cy.ts # Dashboard Functionality Tests
service.cy.ts # Service Management Tests
spec.cy.ts # General Specification Tests
fixtures/ # Test Data
example.json
support/ # Cypress Configuration and Commands
commands.ts # Custom Cypress Commands
e2e.ts # E2E Configuration
index.d.ts # Type Definitions
- Appointment Tests: Scheduling, modification, and cancellation flows
- Dashboard Tests: User interface and functionality verification
- Service Tests: Service creation and management operations
- General Tests: Overall application behavior and workflows
- Tests are written in TypeScript for type safety
- Use data fixtures for consistent test data
- Custom commands in
support/commands.tsfor reusable test utilities - Tests run against a live development server
DATABASE_URL="postgresql://..."
NEXTAUTH_SECRET="..."
GOOGLE_CLIENT_ID="..."
GOOGLE_CLIENT_SECRET="..."Contributions are always welcome. Please read the contribution guide first.
This project is licensed under the MIT License. See the LICENSE file for details.