mp# Pitch Lab
A modern multi-tenant slider assessment application built with Next.js 14 and Sanity CMS. Users can create slider-based assessments with custom criteria and preferences.
- π― Multi-Tenant Assessments: Create multiple slider-based assessments
- π Slider Preferences: Drag sliders to indicate preferences between two options
- π± Responsive Design: Works seamlessly on desktop and mobile devices
- π¨ Modern UI: Built with Tailwind CSS and Radix UI components
- π Reset Functionality: Reset all sliders to neutral position
- π Data Collection: Track user preferences and responses
- π URL Sharing: Each assessment has a unique shareable URL
- π Optional Feedback: Users can provide their name with submissions
- Frontend: Next.js 14 with App Router
- Styling: Tailwind CSS
- UI Components: Radix UI + shadcn/ui
- CMS: Sanity Studio
- Language: TypeScript
- Icons: Lucide React
- Node.js 18+
- npm or yarn
- Sanity account
git clone <your-repo-url>
cd pitch-lab
npm install-
Create a Sanity account
-
Create a new project
-
The schema is configured in
sanity/schemaTypes/sliderInstance.tswith:title(string, required) - Assessment nameslug(string, required) - URL identifierdescription(text, optional) - Assessment descriptionsliderPairs(array) - Slider criteria with:title(string, required) - Criteria nameleftSide(string, required) - Left option labelrightSide(string, required) - Right option label
isActive(boolean) - Assessment availabilitycreatedBy(string) - CMS user who created the assessment
-
Add slider pairs to your Sanity project
Create a .env.local file in the root directory:
# Sanity Configuration
NEXT_PUBLIC_SANITY_PROJECT_ID=your_project_id_here
NEXT_PUBLIC_SANITY_DATASET=production
# Next.js Configuration
NEXT_PUBLIC_APP_URL=http://localhost:3000npm run devOpen http://localhost:3000 to view the app.
βββ app/ # Next.js App Router
β βββ admin/ # Admin pages for assessment management
β βββ sliders/ # Slider assessment pages
β βββ studio/ # Sanity Studio interface
β βββ api/ # API routes
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
β βββ page.tsx # Home page with assessment gallery
βββ components/ # React components
β βββ ui/ # shadcn/ui components
β βββ SliderAssessment.tsx # Main assessment component
β βββ SliderCard.tsx # Individual slider component
β βββ SubmissionForm.tsx # Form submission component
β βββ Navigation.tsx # Navigation component
βββ lib/ # Utility functions
β βββ sanity.ts # CMS integration
βββ sanity/ # Sanity configuration
β βββ schemaTypes/ # Content schemas
β βββ studio/ # Sanity Studio setup
βββ public/ # Static assets
- Navigate to
/adminto manage assessments - Click "Sanity Studio" to create new assessments
- Add slider pairs with left and right options
- Set assessment title and description
- Publish the assessment
- Browse assessments on the home page
- Click "Start Sliding" on any assessment
- View slider criteria with left and right options
- Drag sliders to indicate preferences
- Use reset controls as needed
- Submit assessment when complete
- Navigate to
/adminto view all assessments - See assessment details: title, description, pair count, status
- Access Sanity Studio for content management
- View and edit assessment configurations
- Each assessment is independent
- Unique URLs:
/sliders/{slug} - Separate slider criteria and preferences per assessment
- Draggable sliders for preference indication
- Smooth animations and visual feedback
- Real-time value updates
- Neutral position (50%) as default
- Track user preferences and responses
- Optional name collection
- Session data stored in Sanity CMS
- Analytics and reporting capabilities
- Clean, modern interface
- Responsive design for all devices
- Smooth animations and transitions
- Accessible form controls
- Create slider pairs in Sanity Studio
- Set left and right option labels
- Configure assessment title and description
- Set display order for proper sequencing
The app uses Tailwind CSS with a custom design system. Modify app/globals.css to change colors and styling.
- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy
The app can be deployed to any platform that supports Next.js:
- Netlify
- Railway
- DigitalOcean App Platform
- AWS Amplify
| Variable | Description | Required |
|---|---|---|
NEXT_PUBLIC_SANITY_PROJECT_ID |
Your Sanity project ID | Yes |
NEXT_PUBLIC_SANITY_DATASET |
Your Sanity dataset (default: production) | No |
NEXT_PUBLIC_APP_URL |
Your app's URL | No |
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
For support, please open an issue in the GitHub repository or contact the development team.