@raclettejs/core 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/LICENSE.md +39 -0
  2. package/README.md +29 -422
  3. package/package.json +4 -3
package/LICENSE.md ADDED
@@ -0,0 +1,39 @@
1
+ # License
2
+
3
+ ## GNU Affero General Public License v3.0 with Application Exception
4
+
5
+ @raclettejs/core is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0-only) with the following exception:
6
+
7
+ ### Application Exception
8
+
9
+ **Applications that use @raclettejs/core as a dependency are not required to be licensed under AGPL-3.0.**
10
+
11
+ This exception allows you to:
12
+
13
+ - Build commercial applications using @raclettejs/core
14
+ - Keep your application source code closed source
15
+ - Distribute your applications under any license you choose
16
+
17
+ ### What Requires AGPL-3.0 Compliance
18
+
19
+ The following activities require full AGPL-3.0 compliance (source code must be made available):
20
+
21
+ - **Modifying @raclettejs/core itself** and distributing those modifications
22
+ - **Creating derivative frameworks** based on raclette core
23
+ - **Offering @raclettejs/core functionality as a network service** (hosting platforms, development tools, deployment services, etc.)
24
+ - **Redistributing @raclettejs/core** (modified or unmodified) as part of another framework or tool
25
+
26
+ ### Summary
27
+
28
+ - ✅ **Applications using @raclettejs/core:** Can be closed source (you can also offer them as SaaS)
29
+ - ❌ **Services offering @raclettejs/core:** Must be open source
30
+ - ❌ **Modified versions of @raclettejs/core:** Must be open source
31
+ - ❌ **Frameworks based on @raclettejs/core:** Must be open source
32
+
33
+ ---
34
+
35
+ **Full License Text**
36
+
37
+ The complete GNU Affero General Public License v3.0 can be found at: https://www.gnu.org/licenses/agpl-3.0.html
38
+
39
+ **Copyright (c) 2025 Pacifico Digital Explorations GmbH**
package/README.md CHANGED
@@ -1,435 +1,42 @@
1
- # raclette
1
+ ## What is **raclette**?
2
2
 
3
- Welcome :)
3
+ **raclette** is a full-stack TypeScript meta-framework designed for building **platforms and portals** with minimal setup. It comes with bootstrapped features like authentication, WebSockets, database handling, containerization, and provides an easy-to-use, opinionated environment.
4
4
 
5
- ## Notes
5
+ **Perfect for:**
6
6
 
7
- run `yarn build` here to generate the "dist" folder. Post-Installation Hook would be perfect here!
7
+ - 🚀 **SaaS platforms** - Get to market faster with built-in auth and user management
8
+ - 🏢 **Customer/Supplier portals** - Enterprise-ready from day one
9
+ - 🛠️ **Internal business tools** - Focus on business logic, not infrastructure
10
+ - ⚡ **MVPs that can scale** - Start fast, grow clean with the plugin architecture
8
11
 
9
- Then run `raclette dev` in your app folder. When using `yarn link` the raclette command should be globally available (at least works on Mac)
12
+ **Key Features:**
10
13
 
11
- This will generate a .raclette folder based on your raclette.config.ts file in the app.
14
+ - **Widget-based frontend** (Vue.js + Vite, React support coming)
15
+ - **Plugin architecture** for reusable business logic
16
+ - **Built-in workbench** - Admin interface out of the box
17
+ - **Full-stack development** with Fastify backend + MongoDB
18
+ - **Docker containerization** for easy deployment
12
19
 
13
- ## VSCode Launch for debugging
20
+ ## What You Get
14
21
 
15
- ### CLI Tool
22
+ - **raclette core & workbench** dependencies with dev dependencies
23
+ - ✅ **raclette.config.js** - Main configuration file
24
+ - ✅ **Development scripts** ready to go
25
+ - ✅ **ESLint + Prettier** configuration
26
+ - ✅ **TypeScript** setup
27
+ - ✅ **Docker-ready** development environment
16
28
 
17
- ```json
18
- {
19
- "type": "node",
20
- "request": "launch",
21
- "name": "Debug Raclette CLI",
22
- "skipFiles": ["<node_internals>/**"],
23
- "program": "${workspaceFolder}/bin/raclette.js",
24
- "args": ["dev"],
25
- "cwd": "${workspaceFolder}/apps/dev-setup",
26
- "outFiles": ["${workspaceFolder}/dist/**/*.js"],
27
- "runtimeArgs": [
28
- "--experimental-specifier-resolution=node",
29
- "--enable-source-maps"
30
- ],
31
- "console": "integratedTerminal"
32
- }
33
- ```
29
+ ## [Getting Started](https://docs.raclettejs.com/docs/introduction/getting-started)
34
30
 
35
- **Important:** To enable debugging, you must add this into your raclette.config:
31
+ Visit the [Getting Started Guide](https://docs.raclettejs.com/docs/introduction/getting-started) in our [online Documentation](https://docs.raclettejs.com)
36
32
 
37
- ```typescript
38
- services: {
39
- backend: {
40
- enableDebug: true,
41
- }
42
- }
43
- ```
33
+ ## Links
44
34
 
45
- ---
35
+ - 🌐 [Website](https://raclettejs.com/)
36
+ - 📚 [Documentation](https://docs.raclettejs.com/)
37
+ - 🚀 [GitLab](https://gitlab.com/raclettejs) (source code)
38
+ - 📦 [npm](https://www.npmjs.com/org/raclettejs) (packages)
46
39
 
47
- # Raclette Framework Technical Documentation
40
+ ## License
48
41
 
49
- ## Table of Contents
50
-
51
- 1. [Introduction](#introduction)
52
- 2. [Framework Architecture](#framework-architecture)
53
- 3. [Core Components](#core-components)
54
- - [Configuration System](#configuration-system)
55
- - [CLI Tool](#cli-tool)
56
- - [Virtual File System](#virtual-file-system)
57
- - [Docker Integration](#docker-integration)
58
- - [Package Management](#package-management)
59
- - [Type System](#type-system)
60
- 4. [Development Workflow](#development-workflow)
61
- 5. [Configuration Reference](#configuration-reference)
62
- 6. [CLI Command Reference](#cli-command-reference)
63
- 7. [Best Practices](#best-practices)
64
-
65
- ## Introduction
66
-
67
- Raclette is a full-stack JavaScript/TypeScript framework designed to provide a Nuxt-like developer experience with Docker integration for service management. The framework aims to streamline development by offering:
68
-
69
- - Better IDE support without explicit dependency installation
70
- - A virtual file system for component overriding
71
- - Integrated Docker support for service management
72
- - Package management for both frontend and backend services
73
- - TypeScript type extensions for enhanced development experience
74
-
75
- ## Framework Architecture
76
-
77
- Raclette follows a modular architecture with clear separation between core functionality and application-specific customizations.
78
-
79
- ### Core Package Structure
80
-
81
- The main npm package `@raclettejs/core` provides both development tools and runtime components:
82
-
83
- ```
84
- core/
85
- ├── services/
86
- │ ├── frontend/ # frontend-side orchestrator (Vue or React)
87
- │ ├── backend/ # Fastify-based API backend
88
- ├── bin/ # CLI executable files
89
- ├── types/ # TypeScript type definitions
90
- └── scripts/ # Utility scripts
91
- ```
92
-
93
- ### Application Structure
94
-
95
- A Raclette application has the following structure:
96
-
97
- ```
98
- my-raclette-app/
99
- ├── services/
100
- │ ├── frontend/ # frontend-side components/overrides
101
- │ ├── backend/ # Server-side customizations
102
- ├── plugins/ # App-specific plugins
103
- ├── pages/ # Page components
104
- ├── .raclette/ # Generated files (git-ignored)
105
- └── raclette.config.js # Main configuration file
106
- ```
107
-
108
- The `.raclette` directory is generated during development and contains:
109
-
110
- - Docker configurations
111
- - Virtual file system mappings
112
- - Service-specific package.json files
113
- - TypeScript declarations for IDE support
114
-
115
- ## Core Components
116
-
117
- ### Configuration System
118
-
119
- The configuration system uses `raclette.config.js` as the single source of truth for application settings.
120
-
121
- #### Configuration Loading Process
122
-
123
- 1. The `config-loader.ts` module looks for a `raclette.config.js` file in the project root
124
- 2. If found, it merges the user configuration with default values
125
- 3. Environment variables from `.env` or `.env.production` files are incorporated
126
- 4. The merged configuration is used throughout the framework
127
-
128
- ```typescript
129
- // Example raclette.config.js
130
- export default {
131
- name: "my-raclette-app",
132
- services: {
133
- frontend: {
134
- enabled: true,
135
- port: 3000,
136
- },
137
- backend: {
138
- enabled: true,
139
- port: 8080,
140
- },
141
- mongodb: {
142
- enabled: true,
143
- port: 27017,
144
- },
145
- cache: {
146
- enabled: true,
147
- port: 6379,
148
- },
149
- },
150
- frontend: {
151
- framework: "vue",
152
- vue: {
153
- plugins: ["my-plugin"],
154
- },
155
- },
156
- modules: [
157
- "raclette-auth",
158
- ["raclette-admin", { roles: ["admin", "editor"] }],
159
- ],
160
- env: {
161
- development: {
162
- LOG_LEVEL: "debug",
163
- },
164
- production: {
165
- LOG_LEVEL: "error",
166
- },
167
- },
168
- }
169
- ```
170
-
171
- ### CLI Tool
172
-
173
- The CLI tool (`cli.ts`) provides commands for development, building, and package management. It uses Commander.js to define commands and their options.
174
-
175
- #### Available Commands
176
-
177
- - `raclette dev`: Start development environment
178
- - `raclette down`: Stop Docker Compose services
179
- - `raclette build`: Build for production
180
- - `raclette add-package <target> <package...>`: Add a package to the project
181
- - `raclette init`: Initialize a new Raclette project
182
-
183
- The CLI ensures the `.raclette` directory exists and handles command execution with appropriate error handling.
184
-
185
- ### Virtual File System
186
-
187
- The virtual file system (`virtual-file-system.ts`) enables component overriding with a priority-based approach. This allows application-specific files to override core framework files without directly modifying them.
188
-
189
- #### Priority Levels
190
-
191
- 1. App files (highest priority) - Located in the application's directory
192
- 2. Module files (medium priority) - From installed Raclette modules
193
- 3. Core files (lowest priority) - From the core framework package
194
-
195
- The virtual file system:
196
-
197
- - Builds a mapping of file paths to their physical locations
198
- - Watches for file changes and updates the mapping accordingly
199
- - Provides a `resolveFile` function for resolving file paths based on priority
200
-
201
- This approach enables hot-reloading during development and ensures that application-specific overrides take precedence.
202
-
203
- ### Docker Integration
204
-
205
- Raclette provides Docker integration for service management through `docker-generator.ts` and `dev-environment.ts`.
206
-
207
- #### Docker Compose Generation
208
-
209
- The framework generates `docker-compose.yml` files based on the configuration:
210
-
211
- 1. It adds services for MongoDB and Cache if enabled
212
- 2. In non-direct mode, it adds containers for frontend and backend
213
- 3. It sets up volumes for node_modules and source code
214
- 4. It configures healthchecks and dependencies between services
215
-
216
- #### Development Environment Setup
217
-
218
- During development:
219
-
220
- 1. Docker services are started based on the generated compose file
221
- 2. If running in direct mode, databases run in Docker while frontend and backend run directly
222
- 3. Logs are filtered based on user preferences
223
- 4. The environment properly handles shutdown and cleanup
224
-
225
- The system includes detailed error handling for Docker-related issues, providing guidance when Docker is not installed or not running.
226
-
227
- ### Package Management
228
-
229
- The package management system (`package-manager.ts`) handles dependencies for frontend and backend services:
230
-
231
- 1. It sets up node packages for services based on the configuration
232
- 2. It copies project files to the `.raclette` directory
233
- 3. It merges package.json files with extra dependencies
234
- 4. It provides commands for adding packages to frontend or backend
235
-
236
- ```bash
237
- # Example: Add a package to the frontend
238
- raclette add-package frontend vue-chartjs
239
-
240
- # Example: Add a package to the backend
241
- raclette add-package backend fastify-auth
242
-
243
- # Example: Add a package to both frontend and backend
244
- raclette add-package both lodash
245
- ```
246
-
247
- ### Type System
248
-
249
- The type system (`types-generator.ts`) generates TypeScript declarations for IDE support:
250
-
251
- 1. It generates FastifyJS type augmentations for the backend
252
- 2. It creates project-specific types based on the configuration
253
- 3. It provides interfaces for Raclette configuration and modules
254
-
255
- The generated types enable autocompletion and type checking in IDEs without explicitly installing dependencies.
256
-
257
- ## Development Workflow
258
-
259
- A typical development workflow with Raclette:
260
-
261
- 1. Create a new Raclette project or navigate to an existing one
262
- 2. Configure services and settings in `raclette.config.js`
263
- 3. Run `raclette dev` to start the development environment
264
- 4. Create or modify files in the `app` directory
265
- 5. Changes are immediately reflected through hot-reloading
266
- 6. Use `raclette add-package` to manage dependencies
267
- 7. Use `raclette build` to prepare for production
268
- 8. Use `raclette down` to stop services when finished
269
-
270
- ## Configuration Reference
271
-
272
- ### RacletteConfig Interface
273
-
274
- ```typescript
275
- interface RacletteConfig {
276
- name: string
277
- services: {
278
- frontend?: {
279
- enabled: boolean
280
- port: number
281
- name?: string
282
- nodeModulesVolume?: string
283
- }
284
- backend?: {
285
- enabled: boolean
286
- port: number
287
- name?: string
288
- nodeModulesVolume?: string
289
- }
290
- mongodb?: {
291
- enabled: boolean
292
- port: number
293
- name?: string
294
- volume?: string
295
- databaseName?: string
296
- }
297
- cache?: {
298
- enabled: boolean
299
- port: number
300
- name?: string
301
- volume?: string
302
- }
303
- workbench?: {
304
- enabled: boolean
305
- port: number
306
- }
307
- [key: string]: any
308
- }
309
- modules: Array<string | [string, any]>
310
- env: {
311
- development: Record<string, any>
312
- production: Record<string, any>
313
- [key: string]: Record<string, any>
314
- }
315
- frontend: {
316
- framework: "vue" | "react"
317
- vue?: {
318
- plugins: string[]
319
- }
320
- react?: {
321
- plugins: string[]
322
- }
323
- }
324
- }
325
- ```
326
-
327
- ### RacletteModule Interface
328
-
329
- ```typescript
330
- interface RacletteModule {
331
- name: string
332
- services?: Record<string, any>
333
- extendConfig?: (config: RacletteConfig, options: any) => RacletteConfig
334
- backendExtensions?: {
335
- plugins?: string[]
336
- routes?: string[]
337
- }
338
- frontendExtensions?: {
339
- components?: string[]
340
- plugins?: string[]
341
- }
342
- hooks?: Record<string, (...args: any[]) => Promise<void>>
343
- }
344
- ```
345
-
346
- ## CLI Command Reference
347
-
348
- ### raclette dev
349
-
350
- Start the development environment.
351
-
352
- ```bash
353
- raclette dev [options]
354
- ```
355
-
356
- Options:
357
-
358
- - `-d, --direct`: Run app services directly instead of in containers
359
- - `-q, --quiet`: Run Docker Compose in detached mode without following logs
360
- - `--filter <service>`: Filter logs to specific services (comma-separated)
361
-
362
- ### raclette down
363
-
364
- Stop Docker Compose services.
365
-
366
- ```bash
367
- raclette down
368
- ```
369
-
370
- ### raclette build
371
-
372
- Build for production.
373
-
374
- ```bash
375
- raclette build
376
- ```
377
-
378
- ### raclette add-package
379
-
380
- Add a package to the project.
381
-
382
- ```bash
383
- raclette add-package <target> <package...>
384
- ```
385
-
386
- Parameters:
387
-
388
- - `target`: frontend, backend, or both
389
- - `package`: One or more package names to install
390
-
391
- ### raclette init
392
-
393
- Initialize a new Raclette project.
394
-
395
- ```bash
396
- raclette init
397
- ```
398
-
399
- ## Best Practices
400
-
401
- ### Directory Structure
402
-
403
- Follow the recommended directory structure:
404
-
405
- - Place frontend-specific files in `services/frontend`
406
- - Place backend-specific files in `services/backend`
407
- - Place shared code in `services/backend/src/shared`
408
- - Use the `plugins` directory for reusable components
409
-
410
- ### Docker Usage
411
-
412
- - Use direct mode (`raclette dev -d`) for faster development iterations
413
- - For full Docker integration, omit the `-d` flag
414
- - Filter logs to focus on relevant services with `--filter`
415
-
416
- ### Configuration
417
-
418
- - Keep all configuration in `raclette.config.js`
419
- - Use environment variables for sensitive information
420
- - Create `.env` files for development and `.env.production` for production
421
-
422
- ### Module Development
423
-
424
- When creating Raclette modules:
425
-
426
- - Follow the `RacletteModule` interface
427
- - Use the `extendConfig` hook to modify the config
428
- - Provide clear documentation for module options
429
- - Test modules in isolation before integration
430
-
431
- ### Performance Considerations
432
-
433
- - Use the virtual file system judiciously to avoid overhead
434
- - Prefer direct mode for development when possible
435
- - Consider using separate Docker volumes for node_modules to speed up builds
42
+ [AGPL-3.0-only](https://gitlab.com/raclettejs/core/-/blob/main/LICENSE?ref_type=heads)
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@raclettejs/core",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "racletteJS core package",
5
- "repository": "https://gitlab.com/raclettejs/raclette-core",
5
+ "repository": "https://gitlab.com/raclettejs/core",
6
6
  "author": "Pacifico Digital Explorations GmbH <info@raclettejs.com>",
7
7
  "license": "AGPL-3.0-only",
8
8
  "type": "module",
@@ -34,7 +34,8 @@
34
34
  "index.js",
35
35
  "README.md",
36
36
  "yarn.lock",
37
- "src/types.ts"
37
+ "src/types.ts",
38
+ "LICENSE.md"
38
39
  ],
39
40
  "exports": {
40
41
  ".": {