@basicbenframework/core 0.1.0 → 0.1.5

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 (75) hide show
  1. package/.github/workflows/publish.yml +4 -5
  2. package/LICENSE +9 -0
  3. package/README.md +5 -5
  4. package/create-basicben-app/index.js +11 -9
  5. package/create-basicben-app/package.json +4 -4
  6. package/create-basicben-app/template/README.md +2 -2
  7. package/create-basicben-app/template/gitignore +31 -0
  8. package/create-basicben-app/template/src/client/pages/GettingStarted.jsx +2 -2
  9. package/create-basicben-app/template/src/client/pages/Home.jsx +2 -2
  10. package/package.json +11 -11
  11. package/scripts/publish.sh +125 -0
  12. package/my-test-app/.env.example +0 -24
  13. package/my-test-app/README.md +0 -59
  14. package/my-test-app/basicben.config.js +0 -33
  15. package/my-test-app/database.sqlite-shm +0 -0
  16. package/my-test-app/database.sqlite-wal +0 -0
  17. package/my-test-app/index.html +0 -54
  18. package/my-test-app/migrations/001_create_users.js +0 -15
  19. package/my-test-app/migrations/002_create_posts.js +0 -18
  20. package/my-test-app/package-lock.json +0 -2160
  21. package/my-test-app/package.json +0 -29
  22. package/my-test-app/public/.gitkeep +0 -0
  23. package/my-test-app/seeds/01_users.js +0 -29
  24. package/my-test-app/seeds/02_posts.js +0 -43
  25. package/my-test-app/src/client/components/Alert.jsx +0 -11
  26. package/my-test-app/src/client/components/Avatar.jsx +0 -11
  27. package/my-test-app/src/client/components/BackLink.jsx +0 -10
  28. package/my-test-app/src/client/components/Button.jsx +0 -19
  29. package/my-test-app/src/client/components/Card.jsx +0 -10
  30. package/my-test-app/src/client/components/Empty.jsx +0 -6
  31. package/my-test-app/src/client/components/Input.jsx +0 -12
  32. package/my-test-app/src/client/components/Loading.jsx +0 -6
  33. package/my-test-app/src/client/components/Logo.jsx +0 -40
  34. package/my-test-app/src/client/components/Nav/DarkModeToggle.jsx +0 -23
  35. package/my-test-app/src/client/components/Nav/DesktopNav.jsx +0 -32
  36. package/my-test-app/src/client/components/Nav/MobileNav.jsx +0 -107
  37. package/my-test-app/src/client/components/NavLink.jsx +0 -10
  38. package/my-test-app/src/client/components/PageHeader.jsx +0 -8
  39. package/my-test-app/src/client/components/PostCard.jsx +0 -19
  40. package/my-test-app/src/client/components/Textarea.jsx +0 -12
  41. package/my-test-app/src/client/components/ThemeContext.jsx +0 -5
  42. package/my-test-app/src/client/contexts/AppContext.jsx +0 -13
  43. package/my-test-app/src/client/contexts/ToastContext.jsx +0 -94
  44. package/my-test-app/src/client/layouts/AppLayout.jsx +0 -60
  45. package/my-test-app/src/client/layouts/AuthLayout.jsx +0 -33
  46. package/my-test-app/src/client/layouts/DocsLayout.jsx +0 -60
  47. package/my-test-app/src/client/layouts/RootLayout.jsx +0 -25
  48. package/my-test-app/src/client/pages/Auth.jsx +0 -55
  49. package/my-test-app/src/client/pages/Authentication.jsx +0 -236
  50. package/my-test-app/src/client/pages/Database.jsx +0 -426
  51. package/my-test-app/src/client/pages/Feed.jsx +0 -34
  52. package/my-test-app/src/client/pages/FeedPost.jsx +0 -37
  53. package/my-test-app/src/client/pages/GettingStarted.jsx +0 -136
  54. package/my-test-app/src/client/pages/Home.jsx +0 -206
  55. package/my-test-app/src/client/pages/PostForm.jsx +0 -69
  56. package/my-test-app/src/client/pages/Posts.jsx +0 -59
  57. package/my-test-app/src/client/pages/Profile.jsx +0 -68
  58. package/my-test-app/src/client/pages/Routing.jsx +0 -207
  59. package/my-test-app/src/client/pages/Testing.jsx +0 -251
  60. package/my-test-app/src/client/pages/Validation.jsx +0 -210
  61. package/my-test-app/src/controllers/AuthController.js +0 -81
  62. package/my-test-app/src/controllers/HomeController.js +0 -17
  63. package/my-test-app/src/controllers/PostController.js +0 -86
  64. package/my-test-app/src/controllers/ProfileController.js +0 -66
  65. package/my-test-app/src/helpers/api.js +0 -24
  66. package/my-test-app/src/main.jsx +0 -9
  67. package/my-test-app/src/middleware/auth.js +0 -16
  68. package/my-test-app/src/models/Post.js +0 -63
  69. package/my-test-app/src/models/User.js +0 -42
  70. package/my-test-app/src/routes/App.jsx +0 -38
  71. package/my-test-app/src/routes/api/auth.js +0 -7
  72. package/my-test-app/src/routes/api/posts.js +0 -15
  73. package/my-test-app/src/routes/api/profile.js +0 -8
  74. package/my-test-app/src/server/index.js +0 -16
  75. package/my-test-app/vite.config.js +0 -18
@@ -20,16 +20,15 @@ jobs:
20
20
  node-version: '24'
21
21
  registry-url: 'https://registry.npmjs.org'
22
22
 
23
+ - name: Install test dependencies
24
+ run: npm install better-sqlite3
25
+
23
26
  - name: Run tests
24
27
  run: npm test
25
28
 
26
29
  - name: Publish @basicbenframework/core
27
30
  run: npm publish --access public --provenance
28
- env:
29
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
30
31
 
31
- - name: Publish create-basicben-app
32
+ - name: Publish @basicbenframework/create
32
33
  working-directory: ./create-basicben-app
33
34
  run: npm publish --access public --provenance
34
- env:
35
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2025 Ling Chi Tao (@ctmakes)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -35,7 +35,7 @@ Most JS frameworks make one of two mistakes: they do too much (Next.js, Remix) o
35
35
  ## Quick Start
36
36
 
37
37
  ```bash
38
- npx create-basicben-app my-app
38
+ npx @basicbenframework/create my-app
39
39
  cd my-app
40
40
  npm install
41
41
  npx basicben migrate
@@ -49,10 +49,10 @@ Your app is running at `http://localhost:3000` with a fully functional blog app
49
49
  To develop against a local copy of the framework:
50
50
 
51
51
  ```bash
52
- npx create-basicben-app my-app --local
52
+ npx @basicbenframework/create my-app --local
53
53
  ```
54
54
 
55
- This sets the `basicben` dependency to `file:../basicben-framework` instead of fetching from npm.
55
+ This sets the `basicben` dependency to `file:../core` instead of fetching from npm.
56
56
 
57
57
  ---
58
58
 
@@ -567,8 +567,8 @@ BasicBen has **zero runtime dependencies**:
567
567
  BasicBen is early. Contributions, issues, and ideas are welcome.
568
568
 
569
569
  ```bash
570
- git clone https://github.com/BasicBenFramework/basicben-framework
571
- cd basicben-framework
570
+ git clone https://github.com/BasicBenFramework/core
571
+ cd core
572
572
  npm install
573
573
  npm run dev
574
574
  ```
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * create-basicben-app
4
+ * @basicbenframework/create
5
5
  *
6
6
  * Scaffolds a new BasicBen project with the recommended structure.
7
7
  *
8
8
  * Usage:
9
- * npx create-basicben-app my-app
10
- * npx create-basicben-app my-app --template minimal
9
+ * npx @basicbenframework/create my-app
10
+ * npx @basicbenframework/create my-app --template minimal
11
11
  */
12
12
 
13
13
  import { mkdirSync, writeFileSync, copyFileSync, readdirSync, statSync, existsSync } from 'node:fs'
@@ -43,7 +43,7 @@ async function main() {
43
43
 
44
44
  if (!projectName || projectName.startsWith('-')) {
45
45
  console.error(`\n${red('Error:')} Please provide a project name.\n`)
46
- console.log(` ${cyan('npx create-basicben-app')} ${dim('<project-name>')}\n`)
46
+ console.log(` ${cyan('npx @basicbenframework/create')} ${dim('<project-name>')}\n`)
47
47
  process.exit(1)
48
48
  }
49
49
 
@@ -150,18 +150,18 @@ VITE_PORT=3000 # Frontend dev server
150
150
  */
151
151
  function showHelp() {
152
152
  console.log(`
153
- ${bold('create-basicben-app')} - Create a new BasicBen project
153
+ ${bold('@basicbenframework/create')} - Create a new BasicBen project
154
154
 
155
155
  ${bold('Usage:')}
156
- npx create-basicben-app ${dim('<project-name>')} [options]
156
+ npx @basicbenframework/create ${dim('<project-name>')} [options]
157
157
 
158
158
  ${bold('Options:')}
159
159
  --local Use local framework (for development)
160
160
  -h, --help Show this help message
161
161
 
162
162
  ${bold('Examples:')}
163
- npx create-basicben-app my-app
164
- npx create-basicben-app my-app --local ${dim('# Use local framework')}
163
+ npx @basicbenframework/create my-app
164
+ npx @basicbenframework/create my-app --local ${dim('# Use local framework')}
165
165
  `)
166
166
  }
167
167
 
@@ -176,7 +176,9 @@ function copyDir(src, dest) {
176
176
 
177
177
  for (const entry of entries) {
178
178
  const srcPath = join(src, entry.name)
179
- const destPath = join(dest, entry.name)
179
+ // Rename gitignore to .gitignore (npm strips dotfiles during publish)
180
+ const destName = entry.name === 'gitignore' ? '.gitignore' : entry.name
181
+ const destPath = join(dest, destName)
180
182
 
181
183
  if (entry.isDirectory()) {
182
184
  copyDir(srcPath, destPath)
@@ -1,10 +1,10 @@
1
1
  {
2
- "name": "create-basicben-app",
3
- "version": "0.1.0",
2
+ "name": "@basicbenframework/create",
3
+ "version": "0.1.5",
4
4
  "description": "Create a new BasicBen application",
5
5
  "type": "module",
6
6
  "bin": {
7
- "create-basicben-app": "./index.js"
7
+ "create-basicben": "./index.js"
8
8
  },
9
9
  "files": [
10
10
  "index.js",
@@ -22,7 +22,7 @@
22
22
  "license": "MIT",
23
23
  "repository": {
24
24
  "type": "git",
25
- "url": "https://github.com/BasicBenFramework/basicben-framework"
25
+ "url": "https://github.com/BasicBenFramework/core"
26
26
  },
27
27
  "engines": {
28
28
  "node": ">=24.14.0"
@@ -1,6 +1,6 @@
1
1
  # My BasicBen App
2
2
 
3
- Built with [BasicBen](https://github.com/BasicBenFramework/basicben-framework) — a full-stack React framework with zero runtime dependencies.
3
+ Built with [BasicBen](https://github.com/BasicBenFramework/core) — a full-stack React framework with zero runtime dependencies.
4
4
 
5
5
  ## Getting Started
6
6
 
@@ -56,4 +56,4 @@ Edit `basicben.config.js` to customize server settings, CORS, database, and more
56
56
 
57
57
  ## Documentation
58
58
 
59
- Full documentation: [github.com/BasicBenFramework/basicben-framework](https://github.com/BasicBenFramework/basicben-framework)
59
+ Full documentation: [github.com/BasicBenFramework/core](https://github.com/BasicBenFramework/core)
@@ -0,0 +1,31 @@
1
+ # Dependencies
2
+ node_modules/
3
+
4
+ # Build output
5
+ dist/
6
+
7
+ # Environment
8
+ .env
9
+ .env.local
10
+ .env.*.local
11
+
12
+ # Database
13
+ *.db
14
+ *.sqlite
15
+
16
+ # IDE
17
+ .idea/
18
+ .vscode/
19
+ *.swp
20
+ *.swo
21
+
22
+ # OS
23
+ .DS_Store
24
+ Thumbs.db
25
+
26
+ # Logs
27
+ *.log
28
+ npm-debug.log*
29
+
30
+ # Test coverage
31
+ coverage/
@@ -41,7 +41,7 @@ export function GettingStarted() {
41
41
  <h2 className="text-lg font-semibold mb-4">Quick Start</h2>
42
42
  <div className={`rounded-lg p-4 font-mono text-sm ${t.card} border ${t.border} overflow-x-auto`}>
43
43
  <div className={t.muted}># Create a new project</div>
44
- <div>npx create-basicben-app my-app</div>
44
+ <div>npx @basicbenframework/create my-app</div>
45
45
  <div className="mt-2" />
46
46
  <div className={t.muted}># Navigate to the project</div>
47
47
  <div>cd my-app</div>
@@ -107,7 +107,7 @@ export function GettingStarted() {
107
107
  <h2 className="text-lg font-semibold mb-4">Resources</h2>
108
108
  <div className="flex flex-wrap gap-3">
109
109
  <a
110
- href="https://github.com/BasicBenFramework/basicben-framework"
110
+ href="https://github.com/BasicBenFramework/core"
111
111
  target="_blank"
112
112
  rel="noopener noreferrer"
113
113
  className={`inline-flex items-center gap-2 px-4 py-2 rounded-lg ${t.btnSecondary} transition text-sm`}
@@ -81,11 +81,11 @@ export function Home() {
81
81
  </p>
82
82
  <div className="flex flex-col items-center gap-4">
83
83
  <div className={`px-4 py-3 rounded-lg ${t.card} border ${t.border} font-mono text-sm`}>
84
- <span className={t.muted}>$</span> npx create-basicben-app my-app
84
+ <span className={t.muted}>$</span> npx @basicbenframework/create my-app
85
85
  </div>
86
86
  <div className="flex gap-3">
87
87
  <Button onClick={() => navigate('/docs')}>Get Started</Button>
88
- <Button variant="secondary" onClick={() => window.open('https://github.com/BasicBenFramework/basicben-framework', '_blank')}>
88
+ <Button variant="secondary" onClick={() => window.open('https://github.com/BasicBenFramework/core', '_blank')}>
89
89
  GitHub
90
90
  </Button>
91
91
  </div>
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@basicbenframework/core",
3
- "version": "0.1.0",
3
+ "version": "0.1.5",
4
4
  "description": "A full-stack framework for React. Minimal dependencies, maximum clarity.",
5
5
  "author": "ctmakes",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git+https://github.com/BasicBenFramework/basicben-framework.git"
8
+ "url": "git+https://github.com/BasicBenFramework/core.git"
9
9
  },
10
- "homepage": "https://github.com/BasicBenFramework/basicben-framework#readme",
10
+ "homepage": "https://github.com/BasicBenFramework/core#readme",
11
11
  "bugs": {
12
- "url": "https://github.com/BasicBenFramework/basicben-framework/issues"
12
+ "url": "https://github.com/BasicBenFramework/core/issues"
13
13
  },
14
14
  "type": "module",
15
15
  "bin": {
@@ -34,7 +34,8 @@
34
34
  "test:server": "node --test src/server/**/*.test.js",
35
35
  "test:cli": "node --test src/cli/**/*.test.js",
36
36
  "test:scaffolding": "node --test src/scaffolding/**/*.test.js",
37
- "test:app": "./scripts/test-app.sh"
37
+ "test:app": "./scripts/test-app.sh",
38
+ "release": "./scripts/publish.sh"
38
39
  },
39
40
  "keywords": [
40
41
  "react",
@@ -44,18 +45,17 @@
44
45
  "minimal"
45
46
  ],
46
47
  "license": "MIT",
47
- "dependencies": {},
48
48
  "peerDependencies": {
49
+ "@vitejs/plugin-react": ">=5",
49
50
  "react": ">=18",
50
51
  "react-dom": ">=18",
51
- "vite": ">=7",
52
- "@vitejs/plugin-react": ">=5"
52
+ "vite": ">=7"
53
53
  },
54
54
  "optionalDependencies": {
55
- "better-sqlite3": ">=12",
56
- "pg": ">=8",
57
55
  "@libsql/client": ">=0.17",
56
+ "@neondatabase/serverless": ">=1.0",
58
57
  "@planetscale/database": ">=1",
59
- "@neondatabase/serverless": ">=1.0"
58
+ "better-sqlite3": "^12.6.2",
59
+ "pg": ">=8"
60
60
  }
61
61
  }
@@ -0,0 +1,125 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ # Colors
5
+ RED='\033[0;31m'
6
+ GREEN='\033[0;32m'
7
+ YELLOW='\033[1;33m'
8
+ NC='\033[0m' # No Color
9
+
10
+ # Get the script directory and project root
11
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
12
+ ROOT_DIR="$(dirname "$SCRIPT_DIR")"
13
+
14
+ cd "$ROOT_DIR"
15
+
16
+ # Get current version
17
+ CURRENT_VERSION=$(node -p "require('./package.json').version")
18
+
19
+ echo -e "${YELLOW}Current version: ${NC}$CURRENT_VERSION"
20
+ echo ""
21
+
22
+ # Get new version from argument or prompt
23
+ if [ -n "$1" ]; then
24
+ NEW_VERSION="$1"
25
+ else
26
+ echo "Enter new version (or press enter for options):"
27
+ read -r NEW_VERSION
28
+
29
+ if [ -z "$NEW_VERSION" ]; then
30
+ echo ""
31
+ echo "Version bump options:"
32
+ echo " 1) patch (x.x.X)"
33
+ echo " 2) minor (x.X.0)"
34
+ echo " 3) major (X.0.0)"
35
+ echo ""
36
+ read -p "Select [1-3]: " BUMP_TYPE
37
+
38
+ IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
39
+
40
+ case $BUMP_TYPE in
41
+ 1) NEW_VERSION="$MAJOR.$MINOR.$((PATCH + 1))" ;;
42
+ 2) NEW_VERSION="$MAJOR.$((MINOR + 1)).0" ;;
43
+ 3) NEW_VERSION="$((MAJOR + 1)).0.0" ;;
44
+ *) echo -e "${RED}Invalid option${NC}"; exit 1 ;;
45
+ esac
46
+ fi
47
+ fi
48
+
49
+ # Validate semver format
50
+ if ! [[ "$NEW_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
51
+ echo -e "${RED}Error: Invalid version format. Use semver (e.g., 1.2.3)${NC}"
52
+ exit 1
53
+ fi
54
+
55
+ echo ""
56
+ echo -e "${YELLOW}Publishing version: ${NC}$NEW_VERSION"
57
+ echo ""
58
+
59
+ # Confirm
60
+ read -p "Continue? [y/N] " CONFIRM
61
+ if [[ ! "$CONFIRM" =~ ^[Yy]$ ]]; then
62
+ echo "Aborted."
63
+ exit 0
64
+ fi
65
+
66
+ echo ""
67
+
68
+ # Check for uncommitted changes
69
+ if ! git diff --quiet || ! git diff --cached --quiet; then
70
+ echo -e "${RED}Error: You have uncommitted changes. Please commit or stash them first.${NC}"
71
+ exit 1
72
+ fi
73
+
74
+ # Check we're on main branch
75
+ CURRENT_BRANCH=$(git branch --show-current)
76
+ if [ "$CURRENT_BRANCH" != "main" ]; then
77
+ echo -e "${YELLOW}Warning: You're on branch '$CURRENT_BRANCH', not 'main'.${NC}"
78
+ read -p "Continue anyway? [y/N] " CONFIRM
79
+ if [[ ! "$CONFIRM" =~ ^[Yy]$ ]]; then
80
+ echo "Aborted."
81
+ exit 0
82
+ fi
83
+ fi
84
+
85
+ # Update version in root package.json
86
+ echo -e "${GREEN}Updating version in package.json...${NC}"
87
+ node -e "
88
+ const fs = require('fs');
89
+ const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
90
+ pkg.version = '$NEW_VERSION';
91
+ fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2) + '\n');
92
+ "
93
+
94
+ # Update version in create-basicben-app/package.json
95
+ echo -e "${GREEN}Updating version in create-basicben-app/package.json...${NC}"
96
+ node -e "
97
+ const fs = require('fs');
98
+ const pkg = JSON.parse(fs.readFileSync('./create-basicben-app/package.json', 'utf8'));
99
+ pkg.version = '$NEW_VERSION';
100
+ fs.writeFileSync('./create-basicben-app/package.json', JSON.stringify(pkg, null, 2) + '\n');
101
+ "
102
+
103
+ # Commit
104
+ echo -e "${GREEN}Committing changes...${NC}"
105
+ git add package.json create-basicben-app/package.json
106
+ git commit -m "v$NEW_VERSION"
107
+
108
+ # Tag
109
+ echo -e "${GREEN}Creating tag v$NEW_VERSION...${NC}"
110
+ git tag "v$NEW_VERSION"
111
+
112
+ # Push
113
+ echo -e "${GREEN}Pushing to origin...${NC}"
114
+ git push origin "$CURRENT_BRANCH" --tags
115
+
116
+ echo ""
117
+ echo -e "${GREEN}✓ Done!${NC}"
118
+ echo ""
119
+ echo "GitHub Actions will now:"
120
+ echo " 1. Run tests"
121
+ echo " 2. Publish @basicbenframework/core"
122
+ echo " 3. Publish @basicbenframework/create"
123
+ echo ""
124
+ echo "Watch the workflow at:"
125
+ echo " https://github.com/BasicBenFramework/core/actions"
@@ -1,24 +0,0 @@
1
- # Application
2
- APP_KEY=your-secret-key-here
3
-
4
- # Server Ports
5
- PORT=3001 # API server
6
- VITE_PORT=3000 # Frontend dev server
7
-
8
- # Database - uncomment ONE of the following:
9
-
10
- # SQLite (default)
11
- DATABASE_URL=./database.sqlite
12
-
13
- # PostgreSQL
14
- # DATABASE_URL=postgres://user:pass@localhost:5432/mydb
15
-
16
- # Turso (edge SQLite)
17
- # TURSO_URL=libsql://your-db-name.turso.io
18
- # TURSO_AUTH_TOKEN=your-auth-token
19
-
20
- # PlanetScale (serverless MySQL)
21
- # DATABASE_URL=mysql://user:pass@host/database?ssl={"rejectUnauthorized":true}
22
-
23
- # Neon (serverless Postgres)
24
- # DATABASE_URL=postgres://user:pass@ep-cool-name.us-east-2.aws.neon.tech/mydb?sslmode=require
@@ -1,59 +0,0 @@
1
- # My BasicBen App
2
-
3
- Built with [BasicBen](https://github.com/BasicBenFramework/basicben-framework) — a full-stack React framework with zero runtime dependencies.
4
-
5
- ## Getting Started
6
-
7
- ```bash
8
- npm install
9
- npm run dev
10
- ```
11
-
12
- Open [http://localhost:3000](http://localhost:3000) to view your app.
13
-
14
- ## Commands
15
-
16
- ```bash
17
- npm run dev # Start development server
18
- npm run build # Build for production
19
- npm run start # Run production server
20
- npm run test # Run tests
21
-
22
- npm run migrate # Run database migrations
23
- npm run migrate:fresh # Reset and re-run all migrations
24
- ```
25
-
26
- ## Project Structure
27
-
28
- ```
29
- src/
30
- ├── main.jsx # React entry point
31
- ├── routes/
32
- │ ├── App.jsx # Client routes
33
- │ └── api/ # API routes (auto-loaded)
34
- ├── controllers/ # Business logic
35
- ├── models/ # Database queries
36
- ├── middleware/ # Route middleware
37
- ├── helpers/ # Utility functions
38
- └── client/
39
- ├── layouts/ # Layout components
40
- ├── pages/ # Page components
41
- └── components/ # Reusable UI
42
- ```
43
-
44
- ## Scaffolding
45
-
46
- ```bash
47
- npx basicben make:controller User
48
- npx basicben make:model User
49
- npx basicben make:route users
50
- npx basicben make:migration create_users
51
- ```
52
-
53
- ## Configuration
54
-
55
- Edit `basicben.config.js` to customize server settings, CORS, database, and more.
56
-
57
- ## Documentation
58
-
59
- Full documentation: [github.com/BasicBenFramework/basicben-framework](https://github.com/BasicBenFramework/basicben-framework)
@@ -1,33 +0,0 @@
1
- /**
2
- * BasicBen Configuration
3
- *
4
- * See documentation for all available options.
5
- */
6
-
7
- export default {
8
- // Server options
9
- port: 3001,
10
-
11
- // CORS configuration
12
- cors: {
13
- origin: '*',
14
- methods: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'],
15
- credentials: true
16
- },
17
-
18
- // Body parser options
19
- bodyParser: {
20
- limit: '1mb'
21
- },
22
-
23
- // Static file serving
24
- static: {
25
- dir: 'public'
26
- },
27
-
28
- // Database configuration
29
- // db: {
30
- // driver: 'sqlite',
31
- // url: process.env.DATABASE_URL || './data.db'
32
- // }
33
- }
Binary file
Binary file
@@ -1,54 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>BasicBen App</title>
7
- <script src="https://cdn.tailwindcss.com"></script>
8
- <script>
9
- tailwind.config = {
10
- darkMode: 'class',
11
- theme: {
12
- extend: {
13
- colors: {
14
- dark: {
15
- 900: '#0f0f0f',
16
- 800: '#1a1a1a',
17
- 700: '#222222',
18
- 600: '#333333'
19
- }
20
- },
21
- animation: {
22
- 'slide-in': 'slideIn 0.3s ease-out',
23
- 'slide-out': 'slideOut 0.2s ease-in',
24
- 'fade-in': 'fadeIn 0.2s ease-out',
25
- 'fade-out': 'fadeOut 0.15s ease-in',
26
- },
27
- keyframes: {
28
- slideIn: {
29
- '0%': { transform: 'translateX(100%)', opacity: '0' },
30
- '100%': { transform: 'translateX(0)', opacity: '1' }
31
- },
32
- slideOut: {
33
- '0%': { transform: 'translateX(0)', opacity: '1' },
34
- '100%': { transform: 'translateX(100%)', opacity: '0' }
35
- },
36
- fadeIn: {
37
- '0%': { opacity: '0' },
38
- '100%': { opacity: '1' }
39
- },
40
- fadeOut: {
41
- '0%': { opacity: '1' },
42
- '100%': { opacity: '0' }
43
- }
44
- }
45
- }
46
- }
47
- }
48
- </script>
49
- </head>
50
- <body class="bg-dark-900 text-white">
51
- <div id="root"></div>
52
- <script type="module" src="/src/main.jsx"></script>
53
- </body>
54
- </html>
@@ -1,15 +0,0 @@
1
- export const up = async (db) => {
2
- await db.exec(`
3
- CREATE TABLE users (
4
- id INTEGER PRIMARY KEY AUTOINCREMENT,
5
- name TEXT NOT NULL,
6
- email TEXT UNIQUE NOT NULL,
7
- password TEXT NOT NULL,
8
- created_at DATETIME DEFAULT CURRENT_TIMESTAMP
9
- )
10
- `)
11
- }
12
-
13
- export const down = async (db) => {
14
- await db.exec('DROP TABLE IF EXISTS users')
15
- }
@@ -1,18 +0,0 @@
1
- export const up = async (db) => {
2
- await db.exec(`
3
- CREATE TABLE posts (
4
- id INTEGER PRIMARY KEY AUTOINCREMENT,
5
- user_id INTEGER NOT NULL,
6
- title TEXT NOT NULL,
7
- content TEXT NOT NULL,
8
- published BOOLEAN DEFAULT 0,
9
- created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
10
- updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
11
- FOREIGN KEY (user_id) REFERENCES users(id)
12
- )
13
- `)
14
- }
15
-
16
- export const down = async (db) => {
17
- await db.exec('DROP TABLE IF EXISTS posts')
18
- }