You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This document provides precise implementation instructions for creating embedded applications using the Bespoke generalized components. Follow these instructions exactly to ensure consistency across all applications.
3
+
This repository contains a template for building embedded applications using
4
+
the Bespoke Simulation framework. For complete template documentation, see
5
+
[BESPOKE-TEMPLATE.md](./BESPOKE-TEMPLATE.md).
4
6
5
-
## REQUIRED FILES STRUCTURE
7
+
## Overview
6
8
7
-
Every application MUST include these files in the following order:
9
+
This template provides:
10
+
- CodeSignal Design System integration
11
+
- Consistent layout components (header, sidebar, main content area)
12
+
- Help modal system
13
+
- Local development server with WebSocket support
14
+
- Standardized file structure and naming conventions
8
15
9
-
1. Design System CSS files (from design-system submodule)
10
-
2. help-modal.js (help system)
11
-
3. app.js (application logic)
12
-
4. server.js (server)
16
+
## Quick Start
13
17
14
-
## HTML TEMPLATE IMPLEMENTATION
18
+
1.**Customize the HTML template** (`client/index.html`):
19
+
- Replace `<!-- APP_TITLE -->` with your page title
20
+
- Replace `<!-- APP_NAME -->` with your app name
21
+
- Add your main content at `<!-- APP_SPECIFIC_MAIN_CONTENT -->`
22
+
- Add app-specific CSS links at `<!-- APP_SPECIFIC_CSS -->`
23
+
- Add app-specific JavaScript at `<!-- APP_SPECIFIC_SCRIPTS -->`
15
24
16
-
1. REPLACE the following placeholders in index.html EXACTLY as specified:
25
+
2.**Create your application files**:
26
+
- App-specific CSS (e.g., `my-app.css`)
27
+
- App-specific JavaScript (e.g., `my-app.js`)
28
+
- Help content (based on `help-content-template.html`)
17
29
18
-
a) `<!-- APP_TITLE -->`
19
-
Replace with your application's page title
20
-
Example: "Database Designer" or "Task Manager"
30
+
3.**Start the development server**:
31
+
```bash
32
+
npm start
33
+
```
34
+
Server runs on `http://localhost:3000`
21
35
22
-
b) `<!-- APP_NAME -->`
23
-
Replace with your application's display name (appears in header)
24
-
Example: "Database Designer" or "Task Manager"
36
+
## Key Conventions
25
37
26
-
c) `<!-- APP_SPECIFIC_MAIN_CONTENT -->`
27
-
Add your application's main content area
28
-
Example: `<div id="canvas"></div>` or `<div id="editor"></div>`
This section explains how to use the design-system for embedded applications.
59
+
- Wrap all async operations in try-catch blocks
60
+
- Provide meaningful error messages to users
61
+
- Log errors to console for debugging
62
+
- Implement retry logic for network operations
63
+
- Handle localStorage quota exceeded errors
64
+
- Validate data before saving operations
107
65
108
-
## OVERVIEW
109
-
The design-system provides reusable components and design tokens that can be embedded in any website. The design-system uses CSS custom properties and component classes for consistent styling.
66
+
## Development Workflow
110
67
111
-
##BASIC USAGE
68
+
### Build and Test
112
69
113
-
### 1. Include the Design System CSS
114
-
The HTML template already includes all necessary design-system CSS files:
Note: Layout classes like `.header`, `.sidebar`, `.main-layout`, `.content-area` are not provided by the design-system. You may need to create custom layout styles or use semantic HTML with your own CSS.
159
-
160
-
#### Cards
161
-
```html
162
-
<sectionclass="box card">
163
-
<h2>Card Title</h2>
164
-
<h3>Subtitle</h3>
165
-
<p>Card content goes here</p>
166
-
</section>
88
+
This sends alerts to connected clients. Requires `ws` package:
Note: The design-system provides `.input` class for text and number inputs. For other form elements (select, textarea, checkbox, radio, toggle), you may need to create custom styles or use native HTML elements.
├── help-content-template.html # Help content template
113
+
└── design-system/ # CodeSignal Design System
114
+
├── colors/
115
+
├── spacing/
116
+
├── typography/
117
+
└── components/
118
+
server.js # Development server
205
119
```
206
120
207
-
### MODAL COMPONENTS
208
-
209
-
Note: The design-system does not provide modal components. The help-modal.js system creates modals dynamically. For custom modals, you may need to create your own modal styles or use a separate modal library.
210
-
211
-
## CUSTOMIZATION
212
-
213
-
### CSS Custom Properties
214
-
You can override design-system CSS custom properties to customize the appearance:
215
-
216
-
```css
217
-
:root {
218
-
/* Override colors */
219
-
--Colors-Base-Primary-700: #ff6b6b;
220
-
--Colors-Base-Neutral-00: #f0f0f0;
221
-
222
-
/* Override spacing */
223
-
--UI-Spacing-spacing-m: 1.5rem;
224
-
225
-
/* Override border radius */
226
-
--UI-Radius-radius-m: 12px;
227
-
}
228
-
```
229
-
230
-
### Available Custom Properties
231
-
232
-
See the design-system documentation for complete variable lists:
233
-
-**Colors**: See `design-system/colors/README.md` for all color variables
234
-
-**Spacing**: See `design-system/spacing/README.md` for spacing and radius variables
235
-
-**Typography**: See `design-system/typography/README.md` for typography variables
236
-
-**Components**: Each component has its own variables (see component READMEs)
237
-
238
-
## THEME SUPPORT
239
-
240
-
### Automatic Dark Mode
241
-
The design-system automatically detects the user's system preference and switches between light and dark themes using `@media (prefers-color-scheme: dark)`. No additional configuration is needed.
0 commit comments