A complete, self-hosted Feature Toggle Management Platform. Manage feature flags, organizations, projects, and environments with a modern web interface and a powerful API.
🌐 Live Demo: togglely.de
📖 API Documentation: togglely.de/api/docs
💻 GitHub: github.com/nuvooo/togglely
-
🔐 User Authentication & Authorization
- JWT-based authentication
- Role-based access control (Owner, Admin, Member, Viewer)
- Organization-based multi-tenant architecture
-
🏢 Organizations & Projects
- Multiple organizations per user
- Projects within organizations
- Team management with invitations
-
🌍 Environments
- Development, Staging, Production
- Independent flag states per environment
-
🚦 Feature Toggles
- Multiple types: Boolean, String, Number, JSON
- Targeting rules with conditions
- Real-time updates
-
📊 Audit Logs
- Traceability of all changes
- Filtering by user, project, entity
-
🔑 API Keys
- Server, Client, and SDK Keys
- Expiration dates and revocation
-
🚀 SDKs for Various Languages
- Official JavaScript/TypeScript SDK
- Easy integration into applications
- Docker 20.10+
- Docker Compose 2.0+
- Clone the repository
git clone https://github.com/nuvooo/togglely.git
cd togglely- Start Docker Containers
docker-compose up -d- Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:4000
- API Health: http://localhost:4000/health
- Email:
demo@togglely.io - Password:
demo1234
togglely/
├── backend/ # Node.js/Express Backend API
│ ├── src/
│ │ ├── controllers/ # API Controllers
│ │ ├── middleware/ # Express Middleware
│ │ ├── routes/ # API Routes
│ │ ├── services/ # Business Logic
│ │ └── utils/ # Utilities
│ └── prisma/ # Database Schema
├── frontend/ # React/TypeScript Frontend
│ └── src/
│ ├── components/ # React Components
│ ├── pages/ # Page Components
│ └── store/ # Zustand Stores
├── sdk/ # Official SDKs
│ └── javascript/ # JS/TS SDK
└── docker-compose.yml # Docker Compose Configuration
cd backend
npm install
npm run devEnvironment variables:
DATABASE_URL- MongoDB connection URLREDIS_URL- Redis connection URLJWT_SECRET- Secret key for JWTPORT- API port (default: 4000)
cd frontend
npm install
npm run devcd backend
npx prisma migrate dev
npx prisma db seed| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register |
Register user |
| POST | /api/auth/login |
Login |
| GET | /api/auth/me |
Current user |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/organizations |
List organizations |
| POST | /api/organizations |
Create organization |
| GET | /api/organizations/:id |
Organization details |
| GET | /api/organizations/:id/members |
List members |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/projects/organization/:orgId |
List projects |
| POST | /api/projects/organization/:orgId |
Create project |
| GET | /api/projects/:id |
Project details |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/feature-flags/project/:projectId |
List flags |
| POST | /api/feature-flags/project/:projectId |
Create flag |
| POST | /api/feature-flags/:id/toggle |
Toggle flag |
| PATCH | /api/feature-flags/:id/value |
Change value |
| Method | Endpoint | Description |
|---|---|---|
| GET | /sdk/toggles/:environmentKey |
All toggles |
| GET | /sdk/toggles/:environmentKey/:toggleKey |
Single toggle |
| POST | /sdk/evaluate/:environmentKey/:toggleKey |
Evaluate with context |
npm install @togglely/sdkimport { TogglelyClient } from '@togglely/sdk';
const client = new TogglelyClient({
apiKey: 'your-api-key',
environment: 'production',
baseUrl: 'https://your-togglely-instance.com'
});
// Check boolean toggle
const isEnabled = await client.isEnabled('new-feature');
if (isEnabled) {
// Show new functionality
}
// Get string value
const message = await client.getString('welcome-message', 'Welcome!');
// Get number value
const limit = await client.getNumber('max-items', 10);
// Get JSON configuration
const config = await client.getJSON('app-config', {});
// With context (for targeting)
client.setContext({
userId: '123',
email: 'user@example.com',
country: 'DE'
});
const isEnabledForUser = await client.isEnabled('beta-feature');Togglely uses an organization-based multi-tenant architecture:
Users
└── Organizations (Owner, Admin, Member, Viewer)
└── Projects
└── Environments (Dev, Staging, Prod)
└── Feature Toggles
└── Targeting Rules
- MongoDB: Document-based database for all data
- Redis: Caching for SDK requests (30s TTL)
- Passwords hashed with bcrypt
- JWT for session management
- API Keys for SDK access
- Role-based access control
| Variable | Description | Default |
|---|---|---|
DATABASE_URL |
MongoDB URL | - |
REDIS_URL |
Redis URL | - |
JWT_SECRET |
JWT Secret | - |
PORT |
API Port | 4000 |
NODE_ENV |
Environment | development |
# Backend Tests
cd backend
npm test
# Frontend Tests
cd frontend
npm test# Build
docker-compose -f docker-compose.yml build
# Start
docker-compose -f docker-compose.yml up -d- Install MongoDB and Redis
- Install Node.js 20+
- Build and start backend
- Build and serve frontend
Contributions are welcome! Please follow these steps:
- Create a fork
- Feature Branch:
git checkout -b feature/AmazingFeature - Commit changes:
git commit -m 'Add some AmazingFeature' - Push branch:
git push origin feature/AmazingFeature - Create a Pull Request
MIT License - see LICENSE for details.
- Built with React, Node.js, MongoDB, Redis
- Icons by Heroicons
