odac 0.9.0
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.
- package/.editorconfig +21 -0
- package/.github/workflows/auto-pr-description.yml +49 -0
- package/.github/workflows/release.yml +32 -0
- package/.github/workflows/test-coverage.yml +58 -0
- package/.husky/pre-commit +2 -0
- package/.kiro/steering/code-style.md +56 -0
- package/.kiro/steering/product.md +20 -0
- package/.kiro/steering/structure.md +77 -0
- package/.kiro/steering/tech.md +87 -0
- package/.prettierrc +10 -0
- package/.releaserc.js +134 -0
- package/AGENTS.md +84 -0
- package/CHANGELOG.md +181 -0
- package/CODE_OF_CONDUCT.md +83 -0
- package/CONTRIBUTING.md +63 -0
- package/LICENSE +661 -0
- package/README.md +57 -0
- package/SECURITY.md +26 -0
- package/bin/candy +10 -0
- package/bin/candypack +10 -0
- package/cli/index.js +3 -0
- package/cli/src/Cli.js +348 -0
- package/cli/src/Connector.js +93 -0
- package/cli/src/Monitor.js +416 -0
- package/core/Candy.js +87 -0
- package/core/Commands.js +239 -0
- package/core/Config.js +1094 -0
- package/core/Lang.js +52 -0
- package/core/Log.js +43 -0
- package/core/Process.js +26 -0
- package/docs/backend/01-overview/01-whats-in-the-candy-box.md +9 -0
- package/docs/backend/01-overview/02-super-handy-helper-functions.md +9 -0
- package/docs/backend/01-overview/03-development-server.md +79 -0
- package/docs/backend/02-structure/01-typical-project-layout.md +39 -0
- package/docs/backend/03-config/00-configuration-overview.md +214 -0
- package/docs/backend/03-config/01-database-connection.md +60 -0
- package/docs/backend/03-config/02-static-route-mapping-optional.md +20 -0
- package/docs/backend/03-config/03-request-timeout.md +11 -0
- package/docs/backend/03-config/04-environment-variables.md +227 -0
- package/docs/backend/03-config/05-early-hints.md +352 -0
- package/docs/backend/04-routing/01-basic-page-routes.md +28 -0
- package/docs/backend/04-routing/02-controller-less-view-routes.md +43 -0
- package/docs/backend/04-routing/03-api-and-data-routes.md +20 -0
- package/docs/backend/04-routing/04-authentication-aware-routes.md +48 -0
- package/docs/backend/04-routing/05-advanced-routing.md +14 -0
- package/docs/backend/04-routing/06-error-pages.md +101 -0
- package/docs/backend/04-routing/07-cron-jobs.md +149 -0
- package/docs/backend/05-controllers/01-how-to-build-a-controller.md +17 -0
- package/docs/backend/05-controllers/02-your-trusty-candy-assistant.md +20 -0
- package/docs/backend/05-controllers/03-controller-classes.md +93 -0
- package/docs/backend/05-forms/01-custom-forms.md +395 -0
- package/docs/backend/05-forms/02-automatic-database-insert.md +297 -0
- package/docs/backend/06-request-and-response/01-the-request-object-what-is-the-user-asking-for.md +96 -0
- package/docs/backend/06-request-and-response/02-sending-a-response-replying-to-the-user.md +40 -0
- package/docs/backend/07-views/01-the-view-directory.md +73 -0
- package/docs/backend/07-views/02-rendering-a-view.md +179 -0
- package/docs/backend/07-views/03-template-syntax.md +181 -0
- package/docs/backend/07-views/03-variables.md +328 -0
- package/docs/backend/07-views/04-request-data.md +231 -0
- package/docs/backend/07-views/05-conditionals.md +290 -0
- package/docs/backend/07-views/06-loops.md +353 -0
- package/docs/backend/07-views/07-translations.md +358 -0
- package/docs/backend/07-views/08-backend-javascript.md +398 -0
- package/docs/backend/07-views/09-comments.md +297 -0
- package/docs/backend/08-database/01-database-connection.md +99 -0
- package/docs/backend/08-database/02-using-mysql.md +322 -0
- package/docs/backend/09-validation/01-the-validator-service.md +424 -0
- package/docs/backend/10-authentication/01-user-logins-with-authjs.md +53 -0
- package/docs/backend/10-authentication/02-foiling-villains-with-csrf-protection.md +55 -0
- package/docs/backend/10-authentication/03-register.md +134 -0
- package/docs/backend/10-authentication/04-candy-register-forms.md +676 -0
- package/docs/backend/10-authentication/05-session-management.md +159 -0
- package/docs/backend/10-authentication/06-candy-login-forms.md +596 -0
- package/docs/backend/11-mail/01-the-mail-service.md +42 -0
- package/docs/backend/12-streaming/01-streaming-overview.md +300 -0
- package/docs/backend/13-utilities/01-candy-var.md +504 -0
- package/docs/frontend/01-overview/01-introduction.md +146 -0
- package/docs/frontend/02-ajax-navigation/01-quick-start.md +608 -0
- package/docs/frontend/02-ajax-navigation/02-configuration.md +370 -0
- package/docs/frontend/02-ajax-navigation/03-advanced-usage.md +519 -0
- package/docs/frontend/03-forms/01-form-handling.md +420 -0
- package/docs/frontend/04-api-requests/01-get-post.md +443 -0
- package/docs/frontend/05-streaming/01-client-streaming.md +163 -0
- package/docs/index.json +452 -0
- package/docs/server/01-installation/01-quick-install.md +19 -0
- package/docs/server/01-installation/02-manual-installation-via-npm.md +9 -0
- package/docs/server/02-get-started/01-core-concepts.md +7 -0
- package/docs/server/02-get-started/02-basic-commands.md +57 -0
- package/docs/server/02-get-started/03-cli-reference.md +276 -0
- package/docs/server/02-get-started/04-cli-quick-reference.md +102 -0
- package/docs/server/03-service/01-start-a-new-service.md +57 -0
- package/docs/server/03-service/02-delete-a-service.md +48 -0
- package/docs/server/04-web/01-create-a-website.md +36 -0
- package/docs/server/04-web/02-list-websites.md +9 -0
- package/docs/server/04-web/03-delete-a-website.md +29 -0
- package/docs/server/05-subdomain/01-create-a-subdomain.md +32 -0
- package/docs/server/05-subdomain/02-list-subdomains.md +33 -0
- package/docs/server/05-subdomain/03-delete-a-subdomain.md +41 -0
- package/docs/server/06-ssl/01-renew-an-ssl-certificate.md +34 -0
- package/docs/server/07-mail/01-create-a-mail-account.md +23 -0
- package/docs/server/07-mail/02-delete-a-mail-account.md +20 -0
- package/docs/server/07-mail/03-list-mail-accounts.md +20 -0
- package/docs/server/07-mail/04-change-account-password.md +23 -0
- package/eslint.config.mjs +120 -0
- package/framework/index.js +4 -0
- package/framework/src/Auth.js +309 -0
- package/framework/src/Candy.js +81 -0
- package/framework/src/Config.js +79 -0
- package/framework/src/Env.js +60 -0
- package/framework/src/Lang.js +57 -0
- package/framework/src/Mail.js +83 -0
- package/framework/src/Mysql.js +575 -0
- package/framework/src/Request.js +301 -0
- package/framework/src/Route/Cron.js +128 -0
- package/framework/src/Route/Internal.js +439 -0
- package/framework/src/Route.js +455 -0
- package/framework/src/Server.js +15 -0
- package/framework/src/Stream.js +163 -0
- package/framework/src/Token.js +37 -0
- package/framework/src/Validator.js +271 -0
- package/framework/src/Var.js +211 -0
- package/framework/src/View/EarlyHints.js +190 -0
- package/framework/src/View/Form.js +600 -0
- package/framework/src/View.js +513 -0
- package/framework/web/candy.js +838 -0
- package/jest.config.js +22 -0
- package/locale/de-DE.json +80 -0
- package/locale/en-US.json +79 -0
- package/locale/es-ES.json +80 -0
- package/locale/fr-FR.json +80 -0
- package/locale/pt-BR.json +80 -0
- package/locale/ru-RU.json +80 -0
- package/locale/tr-TR.json +85 -0
- package/locale/zh-CN.json +80 -0
- package/package.json +86 -0
- package/server/index.js +5 -0
- package/server/src/Api.js +88 -0
- package/server/src/DNS.js +940 -0
- package/server/src/Hub.js +535 -0
- package/server/src/Mail.js +571 -0
- package/server/src/SSL.js +180 -0
- package/server/src/Server.js +27 -0
- package/server/src/Service.js +248 -0
- package/server/src/Subdomain.js +64 -0
- package/server/src/Web/Firewall.js +170 -0
- package/server/src/Web/Proxy.js +134 -0
- package/server/src/Web.js +451 -0
- package/server/src/mail/imap.js +1091 -0
- package/server/src/mail/server.js +32 -0
- package/server/src/mail/smtp.js +786 -0
- package/test/cli/Cli.test.js +36 -0
- package/test/core/Candy.test.js +234 -0
- package/test/core/Commands.test.js +538 -0
- package/test/core/Config.test.js +1435 -0
- package/test/core/Lang.test.js +250 -0
- package/test/core/Process.test.js +156 -0
- package/test/framework/Route.test.js +239 -0
- package/test/framework/View/EarlyHints.test.js +282 -0
- package/test/scripts/check-coverage.js +132 -0
- package/test/server/Api.test.js +647 -0
- package/test/server/Client.test.js +338 -0
- package/test/server/DNS.test.js +2050 -0
- package/test/server/DNS.test.js.bak +2084 -0
- package/test/server/Log.test.js +73 -0
- package/test/server/Mail.account.test_.js +460 -0
- package/test/server/Mail.init.test_.js +411 -0
- package/test/server/Mail.test_.js +1340 -0
- package/test/server/SSL.test_.js +1491 -0
- package/test/server/Server.test.js +765 -0
- package/test/server/Service.test_.js +1127 -0
- package/test/server/Subdomain.test.js +440 -0
- package/test/server/Web/Firewall.test.js +175 -0
- package/test/server/Web.test_.js +1562 -0
- package/test/server/__mocks__/acme-client.js +17 -0
- package/test/server/__mocks__/bcrypt.js +50 -0
- package/test/server/__mocks__/child_process.js +389 -0
- package/test/server/__mocks__/crypto.js +432 -0
- package/test/server/__mocks__/fs.js +450 -0
- package/test/server/__mocks__/globalCandy.js +227 -0
- package/test/server/__mocks__/http-proxy.js +105 -0
- package/test/server/__mocks__/http.js +575 -0
- package/test/server/__mocks__/https.js +272 -0
- package/test/server/__mocks__/index.js +249 -0
- package/test/server/__mocks__/mail/server.js +100 -0
- package/test/server/__mocks__/mail/smtp.js +31 -0
- package/test/server/__mocks__/mailparser.js +81 -0
- package/test/server/__mocks__/net.js +369 -0
- package/test/server/__mocks__/node-forge.js +328 -0
- package/test/server/__mocks__/os.js +320 -0
- package/test/server/__mocks__/path.js +291 -0
- package/test/server/__mocks__/selfsigned.js +8 -0
- package/test/server/__mocks__/server/src/mail/server.js +100 -0
- package/test/server/__mocks__/server/src/mail/smtp.js +31 -0
- package/test/server/__mocks__/smtp-server.js +106 -0
- package/test/server/__mocks__/sqlite3.js +394 -0
- package/test/server/__mocks__/testFactories.js +299 -0
- package/test/server/__mocks__/testHelpers.js +363 -0
- package/test/server/__mocks__/tls.js +229 -0
- package/watchdog/index.js +3 -0
- package/watchdog/src/Watchdog.js +156 -0
- package/web/config.json +5 -0
- package/web/controller/page/about.js +27 -0
- package/web/controller/page/index.js +34 -0
- package/web/package.json +18 -0
- package/web/public/assets/css/style.css +1835 -0
- package/web/public/assets/js/app.js +96 -0
- package/web/route/www.js +19 -0
- package/web/skeleton/main.html +22 -0
- package/web/view/content/about.html +65 -0
- package/web/view/content/home.html +205 -0
- package/web/view/footer/main.html +11 -0
- package/web/view/head/main.html +5 -0
- package/web/view/header/main.html +14 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CandyPack Template - Client-Side Application
|
|
3
|
+
*
|
|
4
|
+
* This file demonstrates candy.js features including:
|
|
5
|
+
* - AJAX page loading with Candy.loader() for smooth navigation
|
|
6
|
+
* - History API integration
|
|
7
|
+
* - Event delegation
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
Candy.action({
|
|
11
|
+
/**
|
|
12
|
+
* AJAX Navigation
|
|
13
|
+
* Enables smooth page transitions without full page reloads
|
|
14
|
+
*
|
|
15
|
+
* Minimal usage: navigate: 'main'
|
|
16
|
+
* Medium usage: navigate: {update: 'main', on: callback}
|
|
17
|
+
* Full usage: navigate: {links: 'a[href^="/"]', update: {...}, on: callback}
|
|
18
|
+
*/
|
|
19
|
+
navigate: {
|
|
20
|
+
update: 'main' // Update <main> element
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Custom functions
|
|
25
|
+
* These become available as Candy.fn.functionName()
|
|
26
|
+
*/
|
|
27
|
+
function: {
|
|
28
|
+
/**
|
|
29
|
+
* Update active navigation state
|
|
30
|
+
* Highlights the current page in the navigation menu
|
|
31
|
+
*/
|
|
32
|
+
updateActiveNav: function (url) {
|
|
33
|
+
// Remove active class from all navigation links
|
|
34
|
+
const navLinks = document.querySelectorAll('nav a')
|
|
35
|
+
navLinks.forEach(function (link) {
|
|
36
|
+
link.classList.remove('active')
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
// Add active class to current page link
|
|
40
|
+
const currentLink = document.querySelector(`nav a[href="${url}"]`)
|
|
41
|
+
if (currentLink) {
|
|
42
|
+
currentLink.classList.add('active')
|
|
43
|
+
} else if (url === '/' || url === '') {
|
|
44
|
+
// Handle home page
|
|
45
|
+
const homeLink = document.querySelector('nav a[href="/"]')
|
|
46
|
+
if (homeLink) {
|
|
47
|
+
homeLink.classList.add('active')
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Initialize application on page load
|
|
55
|
+
* This runs once when the page first loads
|
|
56
|
+
*/
|
|
57
|
+
load: function () {
|
|
58
|
+
// Set initial active navigation state
|
|
59
|
+
Candy.fn.updateActiveNav(window.location.pathname)
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Page-specific initialization
|
|
64
|
+
* These functions run when specific pages are loaded
|
|
65
|
+
*/
|
|
66
|
+
page: {
|
|
67
|
+
/**
|
|
68
|
+
* Home page initialization
|
|
69
|
+
*/
|
|
70
|
+
index: function () {
|
|
71
|
+
console.log('Home page loaded')
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* About page initialization
|
|
76
|
+
*/
|
|
77
|
+
about: function () {
|
|
78
|
+
console.log('About page loaded')
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Docs page initialization
|
|
83
|
+
*/
|
|
84
|
+
docs: function () {
|
|
85
|
+
console.log('Docs page loaded')
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Add your custom event handlers here
|
|
90
|
+
// Example:
|
|
91
|
+
// click: {
|
|
92
|
+
// '#my-button': function() {
|
|
93
|
+
// console.log('Button clicked')
|
|
94
|
+
// }
|
|
95
|
+
// }
|
|
96
|
+
})
|
package/web/route/www.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// ============================================
|
|
2
|
+
// Page Routes
|
|
3
|
+
// ============================================
|
|
4
|
+
// Page routes render HTML views and support AJAX loading via candy.js
|
|
5
|
+
// Controllers are located in controller/page/ directory
|
|
6
|
+
|
|
7
|
+
// Home page - displays welcome message, features, and interactive demos
|
|
8
|
+
Candy.Route.page('/', 'index')
|
|
9
|
+
|
|
10
|
+
// About page - provides information about CandyPack
|
|
11
|
+
Candy.Route.page('/about', 'about')
|
|
12
|
+
|
|
13
|
+
// ============================================
|
|
14
|
+
// API Routes
|
|
15
|
+
// ============================================
|
|
16
|
+
// Add your API routes here
|
|
17
|
+
// Example:
|
|
18
|
+
// Candy.Route.post('/api/contact', 'contact')
|
|
19
|
+
// Candy.Route.get('/api/data', 'data')
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
{{ HEAD }}
|
|
5
|
+
</head>
|
|
6
|
+
<body>
|
|
7
|
+
<header>
|
|
8
|
+
{{ HEADER }}
|
|
9
|
+
</header>
|
|
10
|
+
|
|
11
|
+
<main>
|
|
12
|
+
{{ CONTENT }}
|
|
13
|
+
</main>
|
|
14
|
+
|
|
15
|
+
<footer>
|
|
16
|
+
{{ FOOTER }}
|
|
17
|
+
</footer>
|
|
18
|
+
|
|
19
|
+
<script src="/assets/js/candy.js"></script>
|
|
20
|
+
<script src="/assets/js/app.js"></script>
|
|
21
|
+
</body>
|
|
22
|
+
</html>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<div class="container">
|
|
2
|
+
<section class="page-hero">
|
|
3
|
+
<h1>🍭 About This Template</h1>
|
|
4
|
+
<p class="lead">This is a starter template for your CandyPack website. Customize it to build your own application.</p>
|
|
5
|
+
</section>
|
|
6
|
+
|
|
7
|
+
<section class="content-section">
|
|
8
|
+
<h2>What You Can Build</h2>
|
|
9
|
+
<p>
|
|
10
|
+
With CandyPack, you can build any type of web application - from simple websites to complex web apps.
|
|
11
|
+
This template provides a solid foundation with modern features and best practices already configured.
|
|
12
|
+
</p>
|
|
13
|
+
</section>
|
|
14
|
+
|
|
15
|
+
<section class="content-section">
|
|
16
|
+
<h2>Template Features</h2>
|
|
17
|
+
<div class="component-grid">
|
|
18
|
+
<div class="component-card">
|
|
19
|
+
<h3>🎨 Modern UI</h3>
|
|
20
|
+
<p>Dark theme with indigo colors, responsive design, and smooth animations.</p>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div class="component-card">
|
|
24
|
+
<h3>⚡ AJAX Navigation</h3>
|
|
25
|
+
<p>Smooth page transitions without full reloads, already configured and working.</p>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div class="component-card">
|
|
29
|
+
<h3>🔒 Security</h3>
|
|
30
|
+
<p>CSRF protection, secure sessions, and authentication ready to use.</p>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div class="component-card">
|
|
34
|
+
<h3>📱 Responsive</h3>
|
|
35
|
+
<p>Mobile-first design that works perfectly on all devices.</p>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</section>
|
|
39
|
+
|
|
40
|
+
<section class="content-section">
|
|
41
|
+
<h2>Next Steps</h2>
|
|
42
|
+
<ul class="philosophy-list">
|
|
43
|
+
<li><strong>Routes:</strong> Define URL patterns in <code>route/www.js</code> to map URLs to controllers</li>
|
|
44
|
+
<li><strong>Controllers:</strong> Create page logic in <code>controller/</code> to handle requests and set data</li>
|
|
45
|
+
<li><strong>Skeleton:</strong> Design your layout structure in <code>skeleton/</code> with placeholders</li>
|
|
46
|
+
<li><strong>Views:</strong> Build page content in <code>view/</code> directory to fill skeleton sections</li>
|
|
47
|
+
<li><strong>Assets:</strong> Customize styles and scripts in <code>public/</code> for your brand</li>
|
|
48
|
+
</ul>
|
|
49
|
+
</section>
|
|
50
|
+
|
|
51
|
+
<section class="content-section">
|
|
52
|
+
<h2>Learn More</h2>
|
|
53
|
+
<div class="links-grid">
|
|
54
|
+
<a href="https://docs.candypack.dev" class="link-card" target="_blank" data-navigate="false">
|
|
55
|
+
<h3>📚 Documentation</h3>
|
|
56
|
+
<p>Complete guides, API reference, and tutorials</p>
|
|
57
|
+
</a>
|
|
58
|
+
|
|
59
|
+
<a href="https://candypack.dev" class="link-card" target="_blank" data-navigate="false">
|
|
60
|
+
<h3>🌐 CandyPack.dev</h3>
|
|
61
|
+
<p>Official website with examples and community</p>
|
|
62
|
+
</a>
|
|
63
|
+
</div>
|
|
64
|
+
</section>
|
|
65
|
+
</div>
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
<!-- Hero Section -->
|
|
2
|
+
<section class="hero">
|
|
3
|
+
<div class="container">
|
|
4
|
+
<div class="hero-content">
|
|
5
|
+
<h1 class="hero-title">🍭 Your CandyPack Site is Ready!</h1>
|
|
6
|
+
<p class="hero-subtitle">You've successfully created a new website with CandyPack</p>
|
|
7
|
+
<p class="hero-description">
|
|
8
|
+
This is your starting template. Edit the files in your project directory to customize your site. Everything you need to build a
|
|
9
|
+
modern web application is already set up and ready to go.
|
|
10
|
+
</p>
|
|
11
|
+
<div class="hero-actions">
|
|
12
|
+
<a href="https://candypack.dev" target="_blank" class="btn btn-primary" data-navigate="false">Visit CandyPack.dev</a>
|
|
13
|
+
<a href="https://docs.candypack.dev" target="_blank" class="btn btn-secondary" data-navigate="false">Read Documentation</a>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</section>
|
|
18
|
+
|
|
19
|
+
<!-- Project Structure Section -->
|
|
20
|
+
<section class="features">
|
|
21
|
+
<div class="container">
|
|
22
|
+
<h2 class="section-title">📁 Your Project Structure</h2>
|
|
23
|
+
<p class="section-description">Here's what you'll find in your project directory:</p>
|
|
24
|
+
|
|
25
|
+
<div class="structure-grid">
|
|
26
|
+
<div class="structure-item">
|
|
27
|
+
<div class="structure-icon">📄</div>
|
|
28
|
+
<h3 class="structure-title">controller/</h3>
|
|
29
|
+
<p class="structure-description">Your application logic lives here. Each file handles requests and prepares data for views.</p>
|
|
30
|
+
<code class="structure-path">controller/page/index.js</code>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div class="structure-item">
|
|
34
|
+
<div class="structure-icon">🎨</div>
|
|
35
|
+
<h3 class="structure-title">view/</h3>
|
|
36
|
+
<p class="structure-description">HTML templates for your pages. Organized by type (content, header, footer).</p>
|
|
37
|
+
<code class="structure-path">view/content/home.html</code>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<div class="structure-item">
|
|
41
|
+
<div class="structure-icon">🎯</div>
|
|
42
|
+
<h3 class="structure-title">route/</h3>
|
|
43
|
+
<p class="structure-description">Define your URL routes here. Map URLs to controllers and views.</p>
|
|
44
|
+
<code class="structure-path">route/www.js</code>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div class="structure-item">
|
|
48
|
+
<div class="structure-icon">💎</div>
|
|
49
|
+
<h3 class="structure-title">public/</h3>
|
|
50
|
+
<p class="structure-description">Static assets like CSS, JavaScript, and images. Served directly to browsers.</p>
|
|
51
|
+
<code class="structure-path">public/assets/css/style.css</code>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<div class="structure-item">
|
|
55
|
+
<div class="structure-icon">🏗️</div>
|
|
56
|
+
<h3 class="structure-title">skeleton/</h3>
|
|
57
|
+
<p class="structure-description">Page layouts that wrap your content. Define your HTML structure once.</p>
|
|
58
|
+
<code class="structure-path">skeleton/main.html</code>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<div class="structure-item">
|
|
62
|
+
<div class="structure-icon">⚙️</div>
|
|
63
|
+
<h3 class="structure-title">config.json</h3>
|
|
64
|
+
<p class="structure-description">Configuration file for database, routes, and other settings.</p>
|
|
65
|
+
<code class="structure-path">config.json</code>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
</section>
|
|
70
|
+
|
|
71
|
+
<!-- Quick Start Section -->
|
|
72
|
+
<section class="demo">
|
|
73
|
+
<div class="container">
|
|
74
|
+
<h2 class="section-title">🚀 Quick Start Guide</h2>
|
|
75
|
+
|
|
76
|
+
<div class="quickstart-grid">
|
|
77
|
+
<div class="quickstart-step">
|
|
78
|
+
<div class="step-number">1</div>
|
|
79
|
+
<h3 class="step-title">Edit Your Content</h3>
|
|
80
|
+
<p class="step-description">
|
|
81
|
+
Open <code>view/content/home.html</code> to customize this page. All your HTML templates are in the <code>view/</code> directory.
|
|
82
|
+
</p>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<div class="quickstart-step">
|
|
86
|
+
<div class="step-number">2</div>
|
|
87
|
+
<h3 class="step-title">Add Routes</h3>
|
|
88
|
+
<p class="step-description">Define new pages in <code>route/www.js</code>. Map URLs to controllers:</p>
|
|
89
|
+
<pre class="code-snippet"><code>Candy.Route.page('/my-page', 'page.mypage')</code></pre>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<div class="quickstart-step">
|
|
93
|
+
<div class="step-number">3</div>
|
|
94
|
+
<h3 class="step-title">Create Controllers</h3>
|
|
95
|
+
<p class="step-description">Add logic in <code>controller/page/mypage.js</code>:</p>
|
|
96
|
+
<pre class="code-snippet"><code>module.exports = function(Candy) {
|
|
97
|
+
Candy.View.skeleton('main')
|
|
98
|
+
Candy.View.set({
|
|
99
|
+
header: 'main',
|
|
100
|
+
content: 'mypage',
|
|
101
|
+
footer: 'main'
|
|
102
|
+
})
|
|
103
|
+
}</code></pre>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<div class="quickstart-step">
|
|
107
|
+
<div class="step-number">4</div>
|
|
108
|
+
<h3 class="step-title">Style Your Site</h3>
|
|
109
|
+
<p class="step-description">
|
|
110
|
+
Customize the look in <code>public/assets/css/style.css</code>. Add your own CSS or use your favorite framework.
|
|
111
|
+
</p>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</section>
|
|
116
|
+
|
|
117
|
+
<!-- Features Section -->
|
|
118
|
+
<section class="code-examples">
|
|
119
|
+
<div class="container">
|
|
120
|
+
<h2 class="section-title">✨ What's Included</h2>
|
|
121
|
+
|
|
122
|
+
<div class="features-list">
|
|
123
|
+
<div class="feature-item">
|
|
124
|
+
<div class="feature-icon">🎯</div>
|
|
125
|
+
<div class="feature-content">
|
|
126
|
+
<h3>AJAX Navigation</h3>
|
|
127
|
+
<p>Smooth page transitions without full reloads. Already configured in <code>public/assets/js/app.js</code></p>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
<div class="feature-item">
|
|
132
|
+
<div class="feature-icon">🔒</div>
|
|
133
|
+
<div class="feature-content">
|
|
134
|
+
<h3>CSRF Protection</h3>
|
|
135
|
+
<p>Automatic security tokens for all forms and AJAX requests. No configuration needed.</p>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
<div class="feature-item">
|
|
140
|
+
<div class="feature-icon">📱</div>
|
|
141
|
+
<div class="feature-content">
|
|
142
|
+
<h3>Responsive Design</h3>
|
|
143
|
+
<p>Mobile-first CSS framework included. Customize in <code>public/assets/css/style.css</code></p>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
<div class="feature-item">
|
|
148
|
+
<div class="feature-icon">⚡</div>
|
|
149
|
+
<div class="feature-content">
|
|
150
|
+
<h3>Fast Development</h3>
|
|
151
|
+
<p>Hot reload enabled. Changes to views and controllers are reflected immediately.</p>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
|
|
155
|
+
<div class="feature-item">
|
|
156
|
+
<div class="feature-icon">🗄️</div>
|
|
157
|
+
<div class="feature-content">
|
|
158
|
+
<h3>Database Ready</h3>
|
|
159
|
+
<p>MySQL and SQLite support built-in. Configure in <code>config.json</code></p>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
|
|
163
|
+
<div class="feature-item">
|
|
164
|
+
<div class="feature-icon">📧</div>
|
|
165
|
+
<div class="feature-content">
|
|
166
|
+
<h3>Email Support</h3>
|
|
167
|
+
<p>Send emails with the built-in mail service. SMTP and IMAP included.</p>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
</section>
|
|
173
|
+
|
|
174
|
+
<!-- Resources Section -->
|
|
175
|
+
<section class="resources">
|
|
176
|
+
<div class="container">
|
|
177
|
+
<h2 class="section-title">📚 Learn More</h2>
|
|
178
|
+
|
|
179
|
+
<div class="resources-grid">
|
|
180
|
+
<a href="https://candypack.dev" target="_blank" class="resource-card" data-navigate="false">
|
|
181
|
+
<div class="resource-icon">🌐</div>
|
|
182
|
+
<h3>CandyPack.dev</h3>
|
|
183
|
+
<p>Official website with guides, tutorials, and community resources</p>
|
|
184
|
+
</a>
|
|
185
|
+
|
|
186
|
+
<a href="https://docs.candypack.dev" target="_blank" class="resource-card" data-navigate="false">
|
|
187
|
+
<div class="resource-icon">📖</div>
|
|
188
|
+
<h3>Documentation</h3>
|
|
189
|
+
<p>Complete API reference, examples, and best practices</p>
|
|
190
|
+
</a>
|
|
191
|
+
|
|
192
|
+
<a href="https://github.com/candypack" target="_blank" class="resource-card" data-navigate="false">
|
|
193
|
+
<div class="resource-icon">💻</div>
|
|
194
|
+
<h3>GitHub</h3>
|
|
195
|
+
<p>Source code, issues, and contribution guidelines</p>
|
|
196
|
+
</a>
|
|
197
|
+
</div>
|
|
198
|
+
|
|
199
|
+
<div class="next-steps">
|
|
200
|
+
<h3>🎨 Ready to Build?</h3>
|
|
201
|
+
<p>Start by editing <code>view/content/home.html</code> to replace this page with your own content.</p>
|
|
202
|
+
<p>Check out the <a href="/about">About</a> page for more examples.</p>
|
|
203
|
+
</div>
|
|
204
|
+
</div>
|
|
205
|
+
</section>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- Footer -->
|
|
2
|
+
<div class="footer">
|
|
3
|
+
<div class="container">
|
|
4
|
+
<p>Powered by <strong>CandyPack</strong> - A next-generation server and framework toolkit</p>
|
|
5
|
+
<p class="footer-links">
|
|
6
|
+
<a href="https://github.com/candypack" target="_blank" data-navigate="false">GitHub</a> •
|
|
7
|
+
<a href="https://docs.candypack.dev" target="_blank" data-navigate="false">Documentation</a> •
|
|
8
|
+
<a href="https://candypack.dev" target="_blank" data-navigate="false">Official Site</a>
|
|
9
|
+
</p>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<meta charset="UTF-8" />
|
|
2
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
3
|
+
<title>CandyPack</title>
|
|
4
|
+
<meta name="description" content="A next-generation server and framework toolkit for modern web development" />
|
|
5
|
+
<link rel="stylesheet" href="/assets/css/style.css" />
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!-- Navigation -->
|
|
2
|
+
<nav class="navbar">
|
|
3
|
+
<div class="container">
|
|
4
|
+
<div class="nav-brand">
|
|
5
|
+
<span class="brand-icon">🍭</span>
|
|
6
|
+
<span class="brand-name">CandyPack</span>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="nav-links">
|
|
9
|
+
<a href="/" class="nav-link active">Getting Started</a>
|
|
10
|
+
<a href="/about" class="nav-link">About</a>
|
|
11
|
+
<a href="https://docs.candypack.dev" class="nav-link" target="_blank" data-navigate="false">Docs ↗</a>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</nav>
|