An open source, browser-based coding environment designed for education.
Trinket lets students and educators write and run code directly in the browser, supporting multiple programming languages including Python, HTML, Java, R, and more.
- Browser-based code editor - Write and run code without installing anything
- Multiple language support - Python, HTML/CSS/JS, Java, R, GlowScript, and more
- Embeddable trinkets - Embed interactive code examples in any webpage
- Course creation - Build interactive coding courses and tutorials
- Code sharing - Share and remix code with others
- Docker and Docker Compose
- Node.js 18+ (for local development without Docker)
- MongoDB 5.0+
- Redis (optional - falls back to in-memory)
-
Clone the repository:
git clone https://github.com/trinketapp/trinket-oss.git cd trinket-oss -
Copy the example config and add your settings:
cp config/local.example.yaml config/local.yaml
-
Start the services:
docker-compose up
-
Visit http://localhost:3000 in your browser.
Configuration is managed through YAML files in the config/ directory:
default.yaml- Base configuration (committed to repo)local.yaml- Local overrides and secrets (not committed)production.yaml- Production overrides (not committed)
Copy config/local.example.yaml to config/local.yaml and fill in the required values.
| Setting | Description |
|---|---|
app.plugins.session.cookieOptions.password |
Session cookie secret (min 32 chars) |
| Setting | Description |
|---|---|
app.mail.* |
SMTP settings for email (password reset, notifications) |
aws.* |
S3 storage for user-uploaded assets |
app.auth.google.* |
Google OAuth login |
app.recaptcha.* |
reCAPTCHA spam protection |
See GETTING_STARTED.md for detailed setup of optional features.
-
Install dependencies:
npm install
-
Start MongoDB locally (Redis is optional)
-
Run the application:
node app.js
npm test- Backend: Node.js with Hapi framework
- Database: MongoDB with Mongoose ODM
- Cache/Sessions: Redis (optional)
- Frontend: AngularJS 1.x
- Code Execution: Skulpt (Python in browser), server-side containers for other languages
Contributions are welcome! Please read our Contributing Guidelines before submitting a pull request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is released under CC0 1.0 Universal (Public Domain Dedication). See the LICENSE file for details.
Trinket was originally created by Elliott Hauser and Brian Marks to make coding education accessible to everyone. It is now open source and maintained by the community.