Modern UI for Enterprise-Grade Feature Management
Features β’ Quick Start β’ Architecture β’ Components β’ Contributing
Togl is a feature management system. Built with Next.js and React, it provides a sleek, responsive, and user-friendly dashboard for managing feature flags, user roles, and organizational settings.
π¨ Modern Design
- Responsive layout using Tailwind CSS
- Dark mode support
- Customizable themes
π Performance Optimized
- Server-side rendering with Next.js
- Optimized asset loading and code splitting
- Efficient state management with React Query
π Secure Authentication
- Integration with Togl backend OAuth
- Protected routes and role-based access control
- Secure token management
π Advanced Dashboards
- Real-time feature flag status
- Analytics and usage statistics
- User and organization management interfaces
π Seamless Integration
- WebSocket support for live updates
- RESTful API consumption
- Webhook configuration UI
- Node.js >= 18
- npm or yarn
# Clone the repository
git clone https://github.com/yourusername/togl-ui.git
# Install dependencies
cd togl-ui
npm install
# Configure environment variables
cp .env.example .env.local
# Start the development server
npm run dev
βββ pages/ # Next.js pages
βββ components/ # React components
β βββ common/ # Reusable UI components
β βββ layout/ # Layout components
β βββ features/ # Feature-specific components
βββ styles/ # Global styles and Tailwind config
βββ lib/ # Utility functions and helpers
βββ hooks/ # Custom React hooks
βββ context/ # React context providers
βββ public/ # Static assets
βββ tests/ # Test suites
import { useEffect, useState } from 'react'
function MyFeature() {
const [isEnabled, setIsEnabled] = useState(false)
useEffect(() => {
const checkFeatureFlag = async () => {
const response = await fetch('https://togl.sutharjay3635.workers.dev/api/token/<TOKEN_ID>', {
headers: {
'Authorization': 'Bearer <API_KEY>',
}
})
const data = await response.json()
setIsEnabled(data.enabled)
}
checkFeatureFlag()
}, [])
return isEnabled ? <NewFeature /> : <OldFeature />
}
The API returns the following structure:
{
"name": string,
"isEnabled": boolean,
"rules": json
}
NEXT_PUBLIC_API_URL=http://localhost:3000/api
NEXT_PUBLIC_WS_URL=ws://localhost:3000
NEXT_PUBLIC_GOOGLE_CLIENT_ID=your-google-client-id
# Run tests
npm test
# Run linter
npm run lint
# Build for production
npm run build
The easiest way to deploy your Next.js app is to use the Vercel Platform.
Check out the Next.js deployment documentation for more details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- π Documentation
- π¬ Discord Community
- π Issue Tracker
- π§ Email Support
- Next.js - The React Framework for Production
- Tailwind CSS - A utility-first CSS framework
- React Query - Hooks for fetching, caching and updating asynchronous data in React
This README provides a comprehensive overview of your Togl UI project, including its features, setup instructions, architecture, and key components. It maintains a similar structure to your backend README, ensuring consistency across your project documentation. The README also includes sections on deployment, contributing guidelines, and support channels, making it a valuable resource for developers working on or integrating with your Togl UI.