@seip/blue-bird 0.3.1 → 0.3.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 (43) hide show
  1. package/.env_example +23 -13
  2. package/LICENSE +21 -21
  3. package/README.md +79 -79
  4. package/backend/index.js +12 -12
  5. package/backend/routes/api.js +34 -34
  6. package/backend/routes/frontend.js +1 -8
  7. package/core/app.js +359 -359
  8. package/core/auth.js +69 -69
  9. package/core/cache.js +35 -35
  10. package/core/cli/component.js +42 -42
  11. package/core/cli/init.js +120 -118
  12. package/core/cli/react.js +383 -409
  13. package/core/cli/route.js +42 -42
  14. package/core/cli/scaffolding-auth.js +967 -0
  15. package/core/config.js +41 -41
  16. package/core/debug.js +248 -248
  17. package/core/logger.js +80 -80
  18. package/core/middleware.js +27 -27
  19. package/core/router.js +134 -134
  20. package/core/swagger.js +24 -24
  21. package/core/template.js +288 -288
  22. package/core/upload.js +76 -76
  23. package/core/validate.js +291 -290
  24. package/frontend/index.html +28 -22
  25. package/frontend/resources/js/App.jsx +28 -42
  26. package/frontend/resources/js/Main.jsx +17 -17
  27. package/frontend/resources/js/blue-bird/components/Button.jsx +67 -0
  28. package/frontend/resources/js/blue-bird/components/Card.jsx +17 -0
  29. package/frontend/resources/js/blue-bird/components/DataTable.jsx +126 -0
  30. package/frontend/resources/js/blue-bird/components/Input.jsx +21 -0
  31. package/frontend/resources/js/blue-bird/components/Label.jsx +12 -0
  32. package/frontend/resources/js/blue-bird/components/Modal.jsx +27 -0
  33. package/frontend/resources/js/blue-bird/components/Translate.jsx +12 -0
  34. package/frontend/resources/js/blue-bird/components/Typography.jsx +25 -0
  35. package/frontend/resources/js/blue-bird/contexts/LanguageContext.jsx +29 -0
  36. package/frontend/resources/js/blue-bird/contexts/SnackbarContext.jsx +38 -0
  37. package/frontend/resources/js/blue-bird/contexts/ThemeContext.jsx +49 -0
  38. package/frontend/resources/js/blue-bird/locales/en.json +30 -0
  39. package/frontend/resources/js/blue-bird/locales/es.json +30 -0
  40. package/frontend/resources/js/pages/About.jsx +33 -15
  41. package/frontend/resources/js/pages/Home.jsx +93 -68
  42. package/package.json +56 -55
  43. package/vite.config.js +21 -21
@@ -1,16 +1,34 @@
1
- import React from 'react';
2
-
3
- export default function About() {
4
- return (
5
- <div className='p-4'>
6
- <h1 className='text-xl font-bold text-gray-900 mb-4'>About Blue Bird</h1>
7
- <p className='text-gray-500 leading-1.6'>
8
- Blue Bird is a modern framework designed to bridge the gap between backend routing and frontend interactivity.
9
- It provides a seamless developer experience for building fast, reactive web applications.
10
- </p>
11
- <p className='text-red-500 text-xl mt-8 '>
12
- Check your console JS
13
- </p>
14
- </div>
15
- );
1
+ import React from 'react';
2
+ import { Link } from 'react-router-dom';
3
+
4
+ export default function About() {
5
+ return (
6
+ <div
7
+ className="bg-white dark:bg-slate-900 text-gray-900 dark:text-gray-100 min-h-screen"
8
+ >
9
+ <nav
10
+ className='bg-white dark:bg-slate-900 text-gray-900 dark:text-gray-100 border-b border-gray-200 dark:border-slate-800 px-4 py-4 flex justify-between items-center gap-4 sticky top-0 z-10'
11
+ >
12
+ <div className='font-bold text-xl text-blue-600 dark:text-blue-400'>
13
+ Blue Bird
14
+ </div>
15
+ <div className='flex justify-between items-center gap-4'>
16
+ <Link to="/" className='text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100'>Home</Link>
17
+ <Link to="/about" className='text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100'>About</Link>
18
+ </div>
19
+ </nav>
20
+ <main className='max-w-7xl mx-auto'>
21
+ <div className='p-4'>
22
+ <h1 className='text-xl font-bold text-gray-900 dark:text-gray-100 mb-4'>About Blue Bird</h1>
23
+ <p className='text-gray-500 dark:text-gray-400 leading-1.6'>
24
+ Blue Bird is a modern framework designed to bridge the gap between backend routing and frontend interactivity.
25
+ It provides a seamless developer experience for building fast, reactive web applications.
26
+ </p>
27
+ <p className='text-red-500 text-xl mt-8 '>
28
+ Check your console JS
29
+ </p>
30
+ </div>
31
+ </main>
32
+ </div>
33
+ );
16
34
  }
@@ -1,68 +1,93 @@
1
- import React, { useEffect } from 'react';
2
-
3
- export default function Home() {
4
- useEffect(() => {
5
- // Example API call to the backend
6
- fetch("http://localhost:3000/login", {
7
- method: "POST",
8
- headers: {
9
- "Content-Type": "application/json",
10
- },
11
- body: JSON.stringify({
12
- email: "example@example.com",
13
- password: "myPassword123"
14
- }),
15
- })
16
- .then((response) => response.json())
17
- .then((data) => console.log('Backend response:', data))
18
- .catch((error) => console.error('Error fetching from backend:', error));
19
- }, []);
20
-
21
- return (
22
- <div className='text-center p-4'>
23
- <header className='mb-4'>
24
- <h1 className='text-3xl font-bold bg-gradient-to-r from-blue-500 to-blue-600 bg-clip-text text-transparent mb-4'>
25
- Welcome to Blue Bird
26
- </h1>
27
- <p className='text-gray-500 max-w-600px mx-auto'>
28
- The elegant, fast, and weightless framework for modern web development.
29
- </p>
30
- </header>
31
-
32
- <div className='flex gap-4 justify-center mb-8'>
33
- <a
34
- href="https://seip25.github.io/Blue-bird/en.html"
35
- target="_blank"
36
- rel="noopener noreferrer"
37
- className='bg-blue-600 text-white px-4 py-2 rounded-lg font-semibold transition-colors hover:bg-blue-400'
38
- >
39
- Documentation (Eng)
40
- </a>
41
- <a
42
- href="https://seip25.github.io/Blue-bird/"
43
- target="_blank"
44
- rel="noopener noreferrer"
45
- className='bg-blue-50 text-blue-500 px-4 py-2 rounded-lg font-semibold transition-colors hover:bg-blue-100 '
46
- >
47
- Documentación (Esp)
48
-
49
- </a>
50
- </div>
51
-
52
- <div className='mt-8 grid grid-cols-1 md:grid-cols-3 gap-4 max-w-1000px mx-auto'>
53
- <div className='p-4 rounded-lg bg-gray-50 shadow-sm'>
54
- <h3 className='text-blue-500 font-semibold text-xl mb-4'>Lightweight</h3>
55
- <p>Built with performance and simplicity in mind.</p>
56
- </div>
57
- <div className='p-4 rounded-lg bg-gray-50 shadow-sm'>
58
- <h3 className='text-blue-500 font-semibold text-xl mb-4'>React Powered</h3>
59
- <p>Full React + Vite integration .</p>
60
- </div>
61
- <div className='p-4 rounded-lg bg-gray-50 shadow-sm'>
62
- <h3 className='text-blue-500 font-semibold text-xl mb-4'>Express Backend</h3>
63
- <p>Robust and scalable backend architecture.</p>
64
- </div>
65
- </div>
66
- </div>
67
- );
68
- }
1
+ import React, { useEffect } from 'react';
2
+ import { Link } from 'react-router-dom';
3
+ import Card from '../blue-bird/components/Card';
4
+
5
+ export default function Home() {
6
+ useEffect(() => {
7
+ // Example API call to the backend
8
+ fetch("http://localhost:3000/login", {
9
+ method: "POST",
10
+ headers: {
11
+ "Content-Type": "application/json",
12
+ },
13
+ body: JSON.stringify({
14
+ email: "example@example.com",
15
+ password: "myPassword123"
16
+ }),
17
+ })
18
+ .then((response) => response.json())
19
+ .then((data) => console.log('Backend response:', data))
20
+ .catch((error) => console.error('Error fetching from backend:', error));
21
+ }, []);
22
+
23
+ return (
24
+ <div
25
+ className="bg-white dark:bg-slate-900 text-gray-900 dark:text-gray-100 min-h-screen"
26
+ >
27
+ <nav
28
+ className='bg-white dark:bg-slate-900 text-gray-900 dark:text-gray-100 border-b border-gray-200 dark:border-slate-800 px-4 py-4 flex justify-between items-center gap-4 sticky top-0 z-10'
29
+ >
30
+ <div className='font-bold text-xl text-blue-600 dark:text-blue-400'>
31
+ Blue Bird
32
+ </div>
33
+ <div className='flex justify-between items-center gap-4'>
34
+ <Link to="/" className='text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100'>Home</Link>
35
+ <Link to="/about" className='text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100'>About</Link>
36
+ </div>
37
+ </nav>
38
+ <main className='max-w-7xl mx-auto'>
39
+ <div className='text-center p-4'>
40
+ <header className='mb-4'>
41
+ <h1 className='text-3xl font-bold bg-gradient-to-r from-blue-500 to-blue-600 dark:from-blue-400 dark:to-blue-500 bg-clip-text text-transparent mb-4'>
42
+ Welcome to Blue Bird
43
+ </h1>
44
+ <p className='text-gray-500 dark:text-gray-400 max-w-600px mx-auto'>
45
+ The elegant, fast, and weightless framework for modern web development.
46
+ </p>
47
+ </header>
48
+
49
+ <Card title={" Documentation (Eng)"} className='mt-8 border-none shadow-none'>
50
+ <div className='flex gap-4 justify-center mb-8'>
51
+ <a
52
+ href="https://seip25.github.io/Blue-bird/en.html"
53
+ target="_blank"
54
+ rel="noopener noreferrer"
55
+ className='bg-blue-600 text-white px-4 py-2 rounded-lg font-semibold transition-colors hover:bg-blue-500 dark:hover:bg-blue-700'
56
+ >
57
+ Documentation(Eng)
58
+
59
+ </a>
60
+ <a
61
+ href="https://seip25.github.io/Blue-bird/"
62
+ target="_blank"
63
+ rel="noopener noreferrer"
64
+ className='bg-blue-50 dark:bg-slate-800 text-blue-500 dark:text-blue-400 px-4 py-2 rounded-lg font-semibold transition-colors hover:bg-blue-100 dark:hover:bg-slate-700'
65
+ >
66
+ Documentación (Esp)
67
+
68
+ </a>
69
+ </div>
70
+ </Card>
71
+
72
+ <Card className='mt-4 border-none shadow-none'>
73
+ <div className='mt-8 grid grid-cols-1 md:grid-cols-3 gap-4 max-w-1000px mx-auto'>
74
+ <div className='p-4 rounded-lg bg-gray-50 dark:bg-slate-800 shadow-sm'>
75
+ <h3 className='text-blue-500 dark:text-blue-400 font-semibold text-xl mb-4'>Lightweight</h3>
76
+ <p className="dark:text-slate-300">Built with performance and simplicity in mind.</p>
77
+ </div>
78
+ <div className='p-4 rounded-lg bg-gray-50 dark:bg-slate-800 shadow-sm'>
79
+ <h3 className='text-blue-500 dark:text-blue-400 font-semibold text-xl mb-4'>React Powered</h3>
80
+ <p className="dark:text-slate-300">Full React + Vite integration .</p>
81
+ </div>
82
+ <div className='p-4 rounded-lg bg-gray-50 dark:bg-slate-800 shadow-sm'>
83
+ <h3 className='text-blue-500 dark:text-blue-400 font-semibold text-xl mb-4'>Express Backend</h3>
84
+ <p className="dark:text-slate-300">Robust and scalable backend architecture.</p>
85
+ </div>
86
+ </div>
87
+ </Card>
88
+
89
+ </div>
90
+ </main>
91
+ </div>
92
+ );
93
+ }
package/package.json CHANGED
@@ -1,55 +1,56 @@
1
- {
2
- "name": "@seip/blue-bird",
3
- "version": "0.3.1",
4
- "description": "Express + React opinionated framework with SPA or API architecture and built-in JWT auth",
5
- "type": "module",
6
- "bin": {
7
- "blue-bird": "core/cli/init.js"
8
- },
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/seip25/Blue-bird.git"
12
- },
13
- "keywords": [
14
- "express",
15
- "react",
16
- "framework",
17
- "vite"
18
- ],
19
- "author": "Seip25",
20
- "license": "MIT",
21
- "bugs": {
22
- "url": "https://github.com/seip25/Blue-bird/issues"
23
- },
24
- "homepage": "https://seip25.github.io/Blue-bird/",
25
- "scripts": {
26
- "dev": "node --watch --env-file=.env backend/index.js",
27
- "start": "node --env-file=.env backend/index.js",
28
- "create-react-app": "node core/cli/react.js",
29
- "react": "node core/cli/react.js",
30
- "init": "node core/cli/init.js",
31
- "route": "node core/cli/route.js",
32
- "component": "node core/cli/component.js",
33
- "swagger-install": "node core/cli/swagger.js",
34
- "vite:dev": "vite",
35
- "vite:build": "vite build"
36
- },
37
- "dependencies": {
38
- "chalk": "^5.6.2",
39
- "cookie-parser": "^1.4.7",
40
- "cors": "^2.8.6",
41
- "express": "^5.2.1",
42
- "express-rate-limit": "^8.2.1",
43
- "helmet": "^8.1.0",
44
- "jsonwebtoken": "^9.0.2",
45
- "multer": "^2.0.2",
46
- "react": "^19.2.4",
47
- "react-dom": "^19.2.4",
48
- "react-router-dom": "7.13.1",
49
- "xss": "^1.0.15"
50
- },
51
- "devDependencies": {
52
- "@vitejs/plugin-react": "^4.2.0",
53
- "vite": "7.3.1"
54
- }
55
- }
1
+ {
2
+ "name": "@seip/blue-bird",
3
+ "version": "0.3.4",
4
+ "description": "Express + React opinionated framework with SPA or API architecture and built-in JWT auth",
5
+ "type": "module",
6
+ "bin": {
7
+ "blue-bird": "core/cli/init.js"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/seip25/Blue-bird.git"
12
+ },
13
+ "keywords": [
14
+ "express",
15
+ "react",
16
+ "framework",
17
+ "vite"
18
+ ],
19
+ "author": "Seip25",
20
+ "license": "MIT",
21
+ "bugs": {
22
+ "url": "https://github.com/seip25/Blue-bird/issues"
23
+ },
24
+ "homepage": "https://seip25.github.io/Blue-bird/",
25
+ "scripts": {
26
+ "dev": "node --watch --env-file=.env backend/index.js",
27
+ "start": "node --env-file=.env backend/index.js",
28
+ "create-react-app": "node core/cli/react.js",
29
+ "react": "node core/cli/react.js",
30
+ "init": "node core/cli/init.js",
31
+ "route": "node core/cli/route.js",
32
+ "component": "node core/cli/component.js",
33
+ "swagger-install": "node core/cli/swagger.js",
34
+ "scaffolding-auth": "node core/cli/scaffolding-auth.js",
35
+ "vite:dev": "vite",
36
+ "vite:build": "vite build"
37
+ },
38
+ "dependencies": {
39
+ "chalk": "^5.6.2",
40
+ "cookie-parser": "^1.4.7",
41
+ "cors": "^2.8.6",
42
+ "express": "^5.2.1",
43
+ "express-rate-limit": "^8.2.1",
44
+ "helmet": "^8.1.0",
45
+ "jsonwebtoken": "^9.0.2",
46
+ "multer": "^2.0.2",
47
+ "react": "^19.2.4",
48
+ "react-dom": "^19.2.4",
49
+ "react-router-dom": "7.13.1",
50
+ "xss": "^1.0.15"
51
+ },
52
+ "devDependencies": {
53
+ "@vitejs/plugin-react": "^4.2.0",
54
+ "vite": "7.3.1"
55
+ }
56
+ }
package/vite.config.js CHANGED
@@ -1,22 +1,22 @@
1
- import { defineConfig } from 'vite';
2
- import react from '@vitejs/plugin-react';
3
- import path from 'path';
4
-
5
- export default defineConfig({
6
- plugins: [react()],
7
- root: path.resolve(__dirname, 'frontend/resources/js'),
8
- base: '/build/',
9
- build: {
10
- outDir: path.resolve(__dirname, 'frontend/public/build'),
11
- emptyOutDir: true,
12
- manifest: true,
13
- rollupOptions: {
14
- input: path.resolve(__dirname, 'frontend/resources/js/Main.jsx'),
15
- },
16
- },
17
- server: {
18
- origin: 'http://localhost:5173',
19
- strictPort: true,
20
- cors: true,
21
- },
1
+ import { defineConfig } from 'vite';
2
+ import react from '@vitejs/plugin-react';
3
+ import path from 'path';
4
+
5
+ export default defineConfig({
6
+ plugins: [react()],
7
+ root: path.resolve(__dirname, 'frontend/resources/js'),
8
+ base: '/build/',
9
+ build: {
10
+ outDir: path.resolve(__dirname, 'frontend/public/build'),
11
+ emptyOutDir: true,
12
+ manifest: true,
13
+ rollupOptions: {
14
+ input: path.resolve(__dirname, 'frontend/resources/js/Main.jsx'),
15
+ },
16
+ },
17
+ server: {
18
+ origin: 'http://localhost:5173',
19
+ strictPort: true,
20
+ cors: true,
21
+ },
22
22
  });