arcanajs 2.5.0 → 2.5.1
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/framework/cli/index.d.ts +1 -0
- package/framework/cli/index.js +204 -0
- package/framework/cli/templates.d.ts +6 -0
- package/framework/cli/templates.js +59 -0
- package/framework/cli/webpack.config.d.ts +3 -0
- package/framework/cli/webpack.config.js +310 -0
- package/framework/lib/client/index.d.ts +59 -0
- package/framework/lib/client/index.js +97 -0
- package/framework/lib/config/index.d.ts +46 -0
- package/framework/lib/config/index.js +115 -0
- package/framework/lib/global.d.ts +65 -0
- package/framework/lib/index.d.ts +19 -0
- package/framework/lib/index.js +59 -0
- package/framework/lib/server/ArcanaJSMiddleware.d.ts +24 -0
- package/framework/lib/server/ArcanaJSMiddleware.js +114 -0
- package/framework/lib/server/ArcanaJSServer.d.ts +55 -0
- package/framework/lib/server/ArcanaJSServer.js +441 -0
- package/framework/lib/server/ControllerBinder.d.ts +4 -0
- package/framework/lib/server/ControllerBinder.js +32 -0
- package/framework/lib/server/CsrfMiddleware.d.ts +2 -0
- package/framework/lib/server/CsrfMiddleware.js +34 -0
- package/framework/lib/server/DynamicRouter.d.ts +2 -0
- package/framework/lib/server/DynamicRouter.js +50 -0
- package/framework/lib/server/ResponseHandlerMiddleware.d.ts +27 -0
- package/framework/lib/server/ResponseHandlerMiddleware.js +30 -0
- package/framework/lib/server/Router.d.ts +94 -0
- package/framework/lib/server/Router.js +203 -0
- package/framework/lib/server/default-index.html +12 -0
- package/framework/lib/server.d.ts +32 -0
- package/framework/lib/server.js +69 -0
- package/framework/lib/shared/components/Body.d.ts +6 -0
- package/framework/lib/shared/components/Body.js +8 -0
- package/framework/lib/shared/components/Head.d.ts +4 -0
- package/framework/lib/shared/components/Head.js +125 -0
- package/framework/lib/shared/components/Link.d.ts +7 -0
- package/framework/lib/shared/components/Link.js +27 -0
- package/framework/lib/shared/components/NavLink.d.ts +9 -0
- package/framework/lib/shared/components/NavLink.js +13 -0
- package/framework/lib/shared/components/Page.d.ts +6 -0
- package/framework/lib/shared/components/Page.js +10 -0
- package/framework/lib/shared/context/HeadContext.d.ts +6 -0
- package/framework/lib/shared/context/HeadContext.js +5 -0
- package/framework/lib/shared/context/PageContext.d.ts +1 -0
- package/framework/lib/shared/context/PageContext.js +5 -0
- package/framework/lib/shared/context/RouterContext.d.ts +15 -0
- package/framework/lib/shared/context/RouterContext.js +10 -0
- package/framework/lib/shared/core/ArcanaJSApp.d.ts +14 -0
- package/framework/lib/shared/core/ArcanaJSApp.js +153 -0
- package/framework/lib/shared/hooks/useHead.d.ts +1 -0
- package/framework/lib/shared/hooks/useHead.js +7 -0
- package/framework/lib/shared/hooks/useLocation.d.ts +5 -0
- package/framework/lib/shared/hooks/useLocation.js +13 -0
- package/framework/lib/shared/hooks/usePage.d.ts +1 -0
- package/framework/lib/shared/hooks/usePage.js +7 -0
- package/framework/lib/shared/hooks/useParams.d.ts +1 -0
- package/framework/lib/shared/hooks/useParams.js +13 -0
- package/framework/lib/shared/hooks/useQuery.d.ts +1 -0
- package/framework/lib/shared/hooks/useQuery.js +9 -0
- package/framework/lib/shared/hooks/useRouter.d.ts +1 -0
- package/framework/lib/shared/hooks/useRouter.js +13 -0
- package/framework/lib/shared/utils/createSingletonContext.d.ts +11 -0
- package/framework/lib/shared/utils/createSingletonContext.js +21 -0
- package/framework/lib/shared/views/ErrorPage.d.ts +7 -0
- package/framework/lib/shared/views/ErrorPage.js +12 -0
- package/framework/lib/shared/views/NotFoundPage.d.ts +5 -0
- package/framework/lib/shared/views/NotFoundPage.js +11 -0
- package/framework/lib/types.d.ts +174 -0
- package/framework/lib/types.js +8 -0
- package/framework/templates/arcanajs.config.ts +44 -0
- package/framework/templates/package.json +15 -0
- package/framework/templates/postcss.config.js +6 -0
- package/framework/templates/public/arcanajs.png +0 -0
- package/framework/templates/public/arcanajs.svg +12 -0
- package/framework/templates/public/favicon.ico +0 -0
- package/framework/templates/src/arcanajs.d.ts +8 -0
- package/framework/templates/src/client/globals.css +199 -0
- package/framework/templates/src/client/index.tsx +7 -0
- package/framework/templates/src/db/mongo.ts +10 -0
- package/framework/templates/src/db/mongoose.ts +12 -0
- package/framework/templates/src/db/mysql.ts +15 -0
- package/framework/templates/src/db/postgres.ts +8 -0
- package/framework/templates/src/server/controllers/HomeController.ts +7 -0
- package/framework/templates/src/server/controllers/UsersController.ts +37 -0
- package/framework/templates/src/server/index.ts +35 -0
- package/framework/templates/src/server/routes/api.ts +6 -0
- package/framework/templates/src/server/routes/web.ts +7 -0
- package/framework/templates/src/views/ErrorPage.tsx +136 -0
- package/framework/templates/src/views/HomePage.tsx +344 -0
- package/framework/templates/src/views/NotFoundPage.tsx +108 -0
- package/framework/templates/tsconfig.json +27 -0
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default async function dbConnect() {
|
|
2
|
+
// Example MongoDB connection using the official driver
|
|
3
|
+
const { MongoClient } = await import("mongodb");
|
|
4
|
+
const url = process.env.MONGO_URL || "mongodb://localhost:27017";
|
|
5
|
+
const dbName = process.env.MONGO_DB || "mydb";
|
|
6
|
+
const client = new MongoClient(url);
|
|
7
|
+
await client.connect();
|
|
8
|
+
const db = client.db(dbName);
|
|
9
|
+
return { client, db };
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
|
|
3
|
+
export default async function dbConnect() {
|
|
4
|
+
const uri =
|
|
5
|
+
process.env.MONGOOSE_URI ||
|
|
6
|
+
process.env.MONGO_URL ||
|
|
7
|
+
"mongodb://localhost:27017/mydb";
|
|
8
|
+
const options = {} as mongoose.ConnectOptions;
|
|
9
|
+
|
|
10
|
+
await mongoose.connect(uri, options);
|
|
11
|
+
return mongoose;
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default async function dbConnect() {
|
|
2
|
+
const mysql = await import("mysql2/promise");
|
|
3
|
+
const uri = process.env.MYSQL_URL;
|
|
4
|
+
if (uri) {
|
|
5
|
+
return await mysql.createConnection(uri as any);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const connection = await mysql.createConnection({
|
|
9
|
+
host: process.env.MYSQL_HOST || "localhost",
|
|
10
|
+
user: process.env.MYSQL_USER || "root",
|
|
11
|
+
database: process.env.MYSQL_DB || "mydb",
|
|
12
|
+
password: process.env.MYSQL_PASSWORD || undefined,
|
|
13
|
+
});
|
|
14
|
+
return connection;
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export default async function dbConnect() {
|
|
2
|
+
const { Client } = await import("pg");
|
|
3
|
+
const connectionString =
|
|
4
|
+
process.env.PG_CONNECTION || process.env.DATABASE_URL;
|
|
5
|
+
const client = new Client({ connectionString });
|
|
6
|
+
await client.connect();
|
|
7
|
+
return client;
|
|
8
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Request, Response } from "express";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* UsersController - example controller for users endpoints.
|
|
5
|
+
*/
|
|
6
|
+
export default class UsersController {
|
|
7
|
+
async users(req: Request, res: Response) {
|
|
8
|
+
try {
|
|
9
|
+
const normalized: any = (req as any).db || req.app?.locals?.db;
|
|
10
|
+
if (!normalized) return res.error("No DB connection", 500, null, null);
|
|
11
|
+
|
|
12
|
+
const client: any = normalized.client || normalized;
|
|
13
|
+
const db: any = normalized.db || normalized;
|
|
14
|
+
|
|
15
|
+
if (db && typeof db.collection === "function") {
|
|
16
|
+
const users = await db.collection("users").find().toArray();
|
|
17
|
+
return res.success(users, "Users retrieved successfully", 200);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (client && typeof client.query === "function") {
|
|
21
|
+
const result = await client.query("SELECT * FROM users LIMIT 100");
|
|
22
|
+
const rows = result.rows || result[0] || result;
|
|
23
|
+
return res.success(rows, "Users retrieved successfully", 200);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return res.error(
|
|
27
|
+
"Unsupported DB client in template example",
|
|
28
|
+
400,
|
|
29
|
+
null,
|
|
30
|
+
null
|
|
31
|
+
);
|
|
32
|
+
} catch (err) {
|
|
33
|
+
console.error(err);
|
|
34
|
+
return res.error("Query failed", 500, err as any, null);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ArcanaJSServer } from "arcanajs/server";
|
|
2
|
+
import apiRoutes from "./routes/api";
|
|
3
|
+
import webRoutes from "./routes/web";
|
|
4
|
+
|
|
5
|
+
// Example DB connectors included in templates:
|
|
6
|
+
// import mongoDb from '../db/mongo';
|
|
7
|
+
// import mongooseDb from '../db/mongoose';
|
|
8
|
+
// import pgDb from '../db/postgres';
|
|
9
|
+
// import mysqlDb from '../db/mysql';
|
|
10
|
+
|
|
11
|
+
const PORT = process.env.PORT || 3000;
|
|
12
|
+
|
|
13
|
+
const server = new ArcanaJSServer({
|
|
14
|
+
port: PORT,
|
|
15
|
+
routes: webRoutes,
|
|
16
|
+
// Separate API routes (mounted under /api by default)
|
|
17
|
+
apiRoutes: apiRoutes,
|
|
18
|
+
// To change the base path, set apiBase: '/v1' for example or similar
|
|
19
|
+
apiBase: "/api",
|
|
20
|
+
// Example: provide a dbConnect function that returns the DB client/connection.
|
|
21
|
+
// You can connect to MySQL/Postgres/MongoDB here and return the client.
|
|
22
|
+
// dbConnect: async () => {
|
|
23
|
+
// const { MongoClient } = await import('mongodb');
|
|
24
|
+
// const client = new MongoClient(process.env.MONGO_URL || 'mongodb://localhost:27017');
|
|
25
|
+
// await client.connect();
|
|
26
|
+
// return client.db('mydb');
|
|
27
|
+
// },
|
|
28
|
+
// Or use one of the provided DB templates (uncomment one):
|
|
29
|
+
// dbConnect: mongoDb,
|
|
30
|
+
// dbConnect: mongooseDb,
|
|
31
|
+
// dbConnect: pgDb,
|
|
32
|
+
// dbConnect: mysqlDb,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
server.start();
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { Body, Head, Link, Page } from "arcanajs";
|
|
2
|
+
|
|
3
|
+
interface ErrorPageProps {
|
|
4
|
+
message?: string;
|
|
5
|
+
statusCode?: number;
|
|
6
|
+
stack?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default function ErrorPage({
|
|
10
|
+
message = "Something went wrong",
|
|
11
|
+
statusCode = 500,
|
|
12
|
+
stack,
|
|
13
|
+
}: ErrorPageProps) {
|
|
14
|
+
const isDevelopment = process.env.NODE_ENV === "development";
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<Page>
|
|
18
|
+
<Head>
|
|
19
|
+
<title>{statusCode} - Server Error</title>
|
|
20
|
+
<meta name="description" content="An error occurred on the server" />
|
|
21
|
+
</Head>
|
|
22
|
+
<Body>
|
|
23
|
+
<div className="relative min-h-screen overflow-hidden bg-black text-white flex flex-col justify-center items-center px-4 font-sans">
|
|
24
|
+
{/* Animated Background */}
|
|
25
|
+
<div className="fixed inset-0 z-0 overflow-hidden pointer-events-none">
|
|
26
|
+
<div className="absolute inset-0 grid-pattern opacity-30"></div>
|
|
27
|
+
<div className="absolute top-1/4 right-1/4 w-96 h-96 bg-red-600 rounded-full opacity-20 blur-3xl animate-glow"></div>
|
|
28
|
+
<div
|
|
29
|
+
className="absolute bottom-1/4 left-1/4 w-96 h-96 bg-orange-600 rounded-full opacity-10 blur-3xl animate-glow"
|
|
30
|
+
style={{ animationDelay: "2s" }}
|
|
31
|
+
></div>
|
|
32
|
+
<div className="absolute inset-0 hero-gradient"></div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div className="relative z-10 max-w-2xl w-full text-center animate-scale-in">
|
|
36
|
+
<div className="glass-card rounded-3xl p-12 border border-white/10 shadow-2xl">
|
|
37
|
+
<div className="mb-8">
|
|
38
|
+
<div className="text-6xl mb-6 animate-float">
|
|
39
|
+
<span className="text-red-500 drop-shadow-lg filter">⚠️</span>
|
|
40
|
+
</div>
|
|
41
|
+
<h1 className="text-8xl font-bold text-transparent bg-clip-text bg-gradient-to-br from-red-500 to-orange-500 mb-4">
|
|
42
|
+
{statusCode}
|
|
43
|
+
</h1>
|
|
44
|
+
<h2 className="text-3xl font-bold text-white mb-4">
|
|
45
|
+
Server Error
|
|
46
|
+
</h2>
|
|
47
|
+
<p className="text-gray-400 text-lg leading-relaxed">
|
|
48
|
+
{message}
|
|
49
|
+
</p>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div className="flex flex-col sm:flex-row gap-4 justify-center mb-8">
|
|
53
|
+
<Link
|
|
54
|
+
href="/"
|
|
55
|
+
className="btn-primary px-8 py-3.5 text-white font-semibold rounded-xl inline-flex items-center justify-center gap-2 w-full sm:w-auto bg-gradient-to-r from-red-600 to-orange-600 hover:from-red-500 hover:to-orange-500 border-none shadow-red-900/20"
|
|
56
|
+
>
|
|
57
|
+
<svg
|
|
58
|
+
className="w-5 h-5"
|
|
59
|
+
fill="none"
|
|
60
|
+
stroke="currentColor"
|
|
61
|
+
viewBox="0 0 24 24"
|
|
62
|
+
>
|
|
63
|
+
<path
|
|
64
|
+
strokeLinecap="round"
|
|
65
|
+
strokeLinejoin="round"
|
|
66
|
+
strokeWidth={2}
|
|
67
|
+
d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"
|
|
68
|
+
/>
|
|
69
|
+
</svg>
|
|
70
|
+
Go Home
|
|
71
|
+
</Link>
|
|
72
|
+
|
|
73
|
+
<button
|
|
74
|
+
onClick={() => window.location.reload()}
|
|
75
|
+
className="btn-secondary px-8 py-3.5 text-white font-semibold rounded-xl inline-flex items-center justify-center gap-2 w-full sm:w-auto"
|
|
76
|
+
>
|
|
77
|
+
<svg
|
|
78
|
+
className="w-5 h-5"
|
|
79
|
+
fill="none"
|
|
80
|
+
stroke="currentColor"
|
|
81
|
+
viewBox="0 0 24 24"
|
|
82
|
+
>
|
|
83
|
+
<path
|
|
84
|
+
strokeLinecap="round"
|
|
85
|
+
strokeLinejoin="round"
|
|
86
|
+
strokeWidth={2}
|
|
87
|
+
d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
|
|
88
|
+
/>
|
|
89
|
+
</svg>
|
|
90
|
+
Try Again
|
|
91
|
+
</button>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
{isDevelopment && stack && (
|
|
95
|
+
<div className="mt-8 text-left animate-slide-up">
|
|
96
|
+
<details className="bg-black/40 border border-white/10 rounded-xl overflow-hidden group">
|
|
97
|
+
<summary className="cursor-pointer font-medium text-gray-300 p-4 hover:bg-white/5 transition-colors flex items-center justify-between select-none">
|
|
98
|
+
<span>Stack Trace (Development Only)</span>
|
|
99
|
+
<svg
|
|
100
|
+
className="w-5 h-5 text-gray-500 group-open:rotate-180 transition-transform"
|
|
101
|
+
fill="none"
|
|
102
|
+
stroke="currentColor"
|
|
103
|
+
viewBox="0 0 24 24"
|
|
104
|
+
>
|
|
105
|
+
<path
|
|
106
|
+
strokeLinecap="round"
|
|
107
|
+
strokeLinejoin="round"
|
|
108
|
+
strokeWidth={2}
|
|
109
|
+
d="M19 9l-7 7-7-7"
|
|
110
|
+
/>
|
|
111
|
+
</svg>
|
|
112
|
+
</summary>
|
|
113
|
+
<pre className="text-xs text-red-300/80 p-4 overflow-x-auto whitespace-pre-wrap font-mono border-t border-white/5 bg-black/20">
|
|
114
|
+
{stack}
|
|
115
|
+
</pre>
|
|
116
|
+
</details>
|
|
117
|
+
</div>
|
|
118
|
+
)}
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
<div className="mt-8 text-gray-500 text-sm">
|
|
122
|
+
If this problem persists, please{" "}
|
|
123
|
+
<Link
|
|
124
|
+
href="/contact"
|
|
125
|
+
className="text-red-400 hover:text-red-300 underline transition-colors"
|
|
126
|
+
>
|
|
127
|
+
contact support
|
|
128
|
+
</Link>
|
|
129
|
+
.
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
</Body>
|
|
134
|
+
</Page>
|
|
135
|
+
);
|
|
136
|
+
}
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import { Body, Head, Page } from "arcanajs";
|
|
2
|
+
|
|
3
|
+
export default function HomePage() {
|
|
4
|
+
return (
|
|
5
|
+
<Page>
|
|
6
|
+
<Head>
|
|
7
|
+
<title>Welcome to ArcanaJS</title>
|
|
8
|
+
<meta
|
|
9
|
+
name="description"
|
|
10
|
+
content="A modern React framework with Tailwind CSS v4"
|
|
11
|
+
/>
|
|
12
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
13
|
+
</Head>
|
|
14
|
+
<Body>
|
|
15
|
+
<div className="relative min-h-screen overflow-hidden bg-black text-white">
|
|
16
|
+
{/* Animated Background */}
|
|
17
|
+
<div className="fixed inset-0 z-0 overflow-hidden pointer-events-none">
|
|
18
|
+
{/* Grid Pattern */}
|
|
19
|
+
<div className="absolute inset-0 grid-pattern opacity-30"></div>
|
|
20
|
+
<div className="absolute inset-0 grid-pattern opacity-30"></div>
|
|
21
|
+
|
|
22
|
+
{/* Animated Orbs */}
|
|
23
|
+
<div className="absolute top-1/4 left-1/4 w-96 h-96 bg-orange-500 rounded-full opacity-20 blur-3xl animate-glow"></div>
|
|
24
|
+
<div
|
|
25
|
+
className="absolute top-1/3 right-1/4 w-96 h-96 bg-purple-500 rounded-full opacity-15 blur-3xl animate-glow"
|
|
26
|
+
style={{ animationDelay: "2s" }}
|
|
27
|
+
></div>
|
|
28
|
+
<div
|
|
29
|
+
className="absolute bottom-1/4 left-1/2 w-96 h-96 bg-blue-500 rounded-full opacity-10 blur-3xl animate-glow"
|
|
30
|
+
style={{ animationDelay: "4s" }}
|
|
31
|
+
></div>
|
|
32
|
+
|
|
33
|
+
{/* Radial Gradient Accent */}
|
|
34
|
+
<div className="absolute inset-0 hero-gradient"></div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div className="relative z-10">
|
|
38
|
+
{/* Navigation */}
|
|
39
|
+
<nav className="fixed top-0 w-full z-50 nav-blur animate-slide-down border-b border-white/5 backdrop-blur-sm">
|
|
40
|
+
<div className="container mx-auto px-6 py-4 flex items-center justify-between">
|
|
41
|
+
<div className="flex items-center gap-3 group cursor-pointer">
|
|
42
|
+
<div className="relative w-16 h-16">
|
|
43
|
+
<div className="absolute inset-0 bg-gradient-to-br from-orange-500 to-red-600 rounded-full blur-lg opacity-40 group-hover:opacity-100 transition-opacity"></div>
|
|
44
|
+
<img
|
|
45
|
+
src="arcanajs.png"
|
|
46
|
+
alt="ArcanaJS Logo"
|
|
47
|
+
className="relative w-full h-full object-contain"
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
<div className="hidden md:flex space-x-8">
|
|
52
|
+
<a
|
|
53
|
+
href="#features"
|
|
54
|
+
className="text-gray-400 hover:text-white transition-colors text-sm font-medium"
|
|
55
|
+
>
|
|
56
|
+
Features
|
|
57
|
+
</a>
|
|
58
|
+
<a
|
|
59
|
+
href="#docs"
|
|
60
|
+
className="text-gray-400 hover:text-white transition-colors text-sm font-medium"
|
|
61
|
+
>
|
|
62
|
+
Docs
|
|
63
|
+
</a>
|
|
64
|
+
<a
|
|
65
|
+
href="#examples"
|
|
66
|
+
className="text-gray-400 hover:text-white transition-colors text-sm font-medium"
|
|
67
|
+
>
|
|
68
|
+
Examples
|
|
69
|
+
</a>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</nav>
|
|
73
|
+
|
|
74
|
+
{/* Hero Section */}
|
|
75
|
+
<main className="pt-32 pb-12 px-4 sm:px-6 lg:px-8">
|
|
76
|
+
<div className="max-w-5xl mx-auto text-center">
|
|
77
|
+
<div className="glass-card rounded-3xl p-8 md:p-12 mb-12 animate-scale-in border-white/10">
|
|
78
|
+
<h1 className="text-5xl md:text-7xl font-bold text-white mb-6 tracking-tight drop-shadow-2xl">
|
|
79
|
+
Welcome to <span className="gradient-text">ArcanaJS</span>
|
|
80
|
+
</h1>
|
|
81
|
+
<p className="text-xl md:text-2xl text-gray-300 mb-10 max-w-3xl mx-auto text-balance font-light leading-relaxed">
|
|
82
|
+
A modern React framework with server-side rendering and
|
|
83
|
+
Tailwind CSS v4 support. Build fast, beautiful applications
|
|
84
|
+
with zero configuration.
|
|
85
|
+
</p>
|
|
86
|
+
<div className="flex flex-col sm:flex-row gap-4 justify-center">
|
|
87
|
+
<button className="btn-primary px-8 py-3.5 text-lg font-semibold rounded-xl inline-flex items-center justify-center gap-2">
|
|
88
|
+
Get Started
|
|
89
|
+
<svg
|
|
90
|
+
className="w-5 h-5"
|
|
91
|
+
fill="none"
|
|
92
|
+
stroke="currentColor"
|
|
93
|
+
viewBox="0 0 24 24"
|
|
94
|
+
>
|
|
95
|
+
<path
|
|
96
|
+
strokeLinecap="round"
|
|
97
|
+
strokeLinejoin="round"
|
|
98
|
+
strokeWidth={2}
|
|
99
|
+
d="M13 7l5 5m0 0l-5 5m5-5H6"
|
|
100
|
+
/>
|
|
101
|
+
</svg>
|
|
102
|
+
</button>
|
|
103
|
+
<button className="btn-secondary px-8 py-3.5 text-lg font-semibold rounded-xl inline-flex items-center justify-center gap-2">
|
|
104
|
+
View Examples
|
|
105
|
+
</button>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
|
|
109
|
+
{/* Features Grid */}
|
|
110
|
+
<section
|
|
111
|
+
id="features"
|
|
112
|
+
className="grid md:grid-cols-2 lg:grid-cols-3 gap-6 mb-12"
|
|
113
|
+
>
|
|
114
|
+
<div className="glass-card rounded-2xl p-8 feature-card text-center group">
|
|
115
|
+
<div className="w-14 h-14 bg-orange-500/10 rounded-xl flex items-center justify-center mx-auto mb-4 group-hover:scale-110 transition-transform border border-orange-500/20">
|
|
116
|
+
<svg
|
|
117
|
+
className="w-7 h-7 text-orange-500"
|
|
118
|
+
fill="none"
|
|
119
|
+
stroke="currentColor"
|
|
120
|
+
viewBox="0 0 24 24"
|
|
121
|
+
>
|
|
122
|
+
<path
|
|
123
|
+
strokeLinecap="round"
|
|
124
|
+
strokeLinejoin="round"
|
|
125
|
+
strokeWidth={2}
|
|
126
|
+
d="M13 10V3L4 14h7v7l9-11h-7z"
|
|
127
|
+
/>
|
|
128
|
+
</svg>
|
|
129
|
+
</div>
|
|
130
|
+
<h3 className="text-xl font-bold text-white mb-2 group-hover:text-orange-400 transition-colors">
|
|
131
|
+
Fast SSR
|
|
132
|
+
</h3>
|
|
133
|
+
<p className="text-gray-400 text-sm leading-relaxed">
|
|
134
|
+
Server-side rendering for optimal performance and SEO.
|
|
135
|
+
</p>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<div className="glass-card rounded-2xl p-8 feature-card text-center group">
|
|
139
|
+
<div className="w-14 h-14 bg-purple-500/10 rounded-xl flex items-center justify-center mx-auto mb-4 group-hover:scale-110 transition-transform border border-purple-500/20">
|
|
140
|
+
<svg
|
|
141
|
+
className="w-7 h-7 text-purple-500"
|
|
142
|
+
fill="none"
|
|
143
|
+
stroke="currentColor"
|
|
144
|
+
viewBox="0 0 24 24"
|
|
145
|
+
>
|
|
146
|
+
<path
|
|
147
|
+
strokeLinecap="round"
|
|
148
|
+
strokeLinejoin="round"
|
|
149
|
+
strokeWidth={2}
|
|
150
|
+
d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
151
|
+
/>
|
|
152
|
+
</svg>
|
|
153
|
+
</div>
|
|
154
|
+
<h3 className="text-xl font-bold text-white mb-2 group-hover:text-purple-400 transition-colors">
|
|
155
|
+
TypeScript
|
|
156
|
+
</h3>
|
|
157
|
+
<p className="text-gray-400 text-sm leading-relaxed">
|
|
158
|
+
Built-in TypeScript support for better developer
|
|
159
|
+
experience.
|
|
160
|
+
</p>
|
|
161
|
+
</div>
|
|
162
|
+
|
|
163
|
+
<div className="glass-card rounded-2xl p-8 feature-card text-center group">
|
|
164
|
+
<div className="w-14 h-14 bg-blue-500/10 rounded-xl flex items-center justify-center mx-auto mb-4 group-hover:scale-110 transition-transform border border-blue-500/20">
|
|
165
|
+
<svg
|
|
166
|
+
className="w-7 h-7 text-blue-500"
|
|
167
|
+
fill="none"
|
|
168
|
+
stroke="currentColor"
|
|
169
|
+
viewBox="0 0 24 24"
|
|
170
|
+
>
|
|
171
|
+
<path
|
|
172
|
+
strokeLinecap="round"
|
|
173
|
+
strokeLinejoin="round"
|
|
174
|
+
strokeWidth={2}
|
|
175
|
+
d="M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h4a2 2 0 002-2V9a2 2 0 00-2-2H7a2 2 0 00-2 2v6a2 2 0 002 2z"
|
|
176
|
+
/>
|
|
177
|
+
</svg>
|
|
178
|
+
</div>
|
|
179
|
+
<h3 className="text-xl font-bold text-white mb-2 group-hover:text-blue-400 transition-colors">
|
|
180
|
+
Tailwind v4
|
|
181
|
+
</h3>
|
|
182
|
+
<p className="text-gray-400 text-sm leading-relaxed">
|
|
183
|
+
Latest Tailwind CSS with CSS-first configuration.
|
|
184
|
+
</p>
|
|
185
|
+
</div>
|
|
186
|
+
|
|
187
|
+
<div className="glass-card rounded-2xl p-8 feature-card text-center group">
|
|
188
|
+
<div className="w-14 h-14 bg-green-500/10 rounded-xl flex items-center justify-center mx-auto mb-4 group-hover:scale-110 transition-transform border border-green-500/20">
|
|
189
|
+
<svg
|
|
190
|
+
className="w-7 h-7 text-green-500"
|
|
191
|
+
fill="none"
|
|
192
|
+
stroke="currentColor"
|
|
193
|
+
viewBox="0 0 24 24"
|
|
194
|
+
>
|
|
195
|
+
<path
|
|
196
|
+
strokeLinecap="round"
|
|
197
|
+
strokeLinejoin="round"
|
|
198
|
+
strokeWidth={2}
|
|
199
|
+
d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"
|
|
200
|
+
/>
|
|
201
|
+
</svg>
|
|
202
|
+
</div>
|
|
203
|
+
<h3 className="text-xl font-bold text-white mb-2 group-hover:text-green-400 transition-colors">
|
|
204
|
+
Hot Reload
|
|
205
|
+
</h3>
|
|
206
|
+
<p className="text-gray-400 text-sm leading-relaxed">
|
|
207
|
+
Instant updates during development for faster iteration.
|
|
208
|
+
</p>
|
|
209
|
+
</div>
|
|
210
|
+
|
|
211
|
+
<div className="glass-card rounded-2xl p-8 feature-card text-center group">
|
|
212
|
+
<div className="w-14 h-14 bg-red-500/10 rounded-xl flex items-center justify-center mx-auto mb-4 group-hover:scale-110 transition-transform border border-red-500/20">
|
|
213
|
+
<svg
|
|
214
|
+
className="w-7 h-7 text-red-500"
|
|
215
|
+
fill="none"
|
|
216
|
+
stroke="currentColor"
|
|
217
|
+
viewBox="0 0 24 24"
|
|
218
|
+
>
|
|
219
|
+
<path
|
|
220
|
+
strokeLinecap="round"
|
|
221
|
+
strokeLinejoin="round"
|
|
222
|
+
strokeWidth={2}
|
|
223
|
+
d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2H5a2 2 0 00-2-2V7z"
|
|
224
|
+
/>
|
|
225
|
+
</svg>
|
|
226
|
+
</div>
|
|
227
|
+
<h3 className="text-xl font-bold text-white mb-2 group-hover:text-red-400 transition-colors">
|
|
228
|
+
File-based Routing
|
|
229
|
+
</h3>
|
|
230
|
+
<p className="text-gray-400 text-sm leading-relaxed">
|
|
231
|
+
Intuitive routing based on your file structure.
|
|
232
|
+
</p>
|
|
233
|
+
</div>
|
|
234
|
+
|
|
235
|
+
<div className="glass-card rounded-2xl p-8 feature-card text-center group">
|
|
236
|
+
<div className="w-14 h-14 bg-indigo-500/10 rounded-xl flex items-center justify-center mx-auto mb-4 group-hover:scale-110 transition-transform border border-indigo-500/20">
|
|
237
|
+
<svg
|
|
238
|
+
className="w-7 h-7 text-indigo-500"
|
|
239
|
+
fill="none"
|
|
240
|
+
stroke="currentColor"
|
|
241
|
+
viewBox="0 0 24 24"
|
|
242
|
+
>
|
|
243
|
+
<path
|
|
244
|
+
strokeLinecap="round"
|
|
245
|
+
strokeLinejoin="round"
|
|
246
|
+
strokeWidth={2}
|
|
247
|
+
d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"
|
|
248
|
+
/>
|
|
249
|
+
<path
|
|
250
|
+
strokeLinecap="round"
|
|
251
|
+
strokeLinejoin="round"
|
|
252
|
+
strokeWidth={2}
|
|
253
|
+
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
254
|
+
/>
|
|
255
|
+
</svg>
|
|
256
|
+
</div>
|
|
257
|
+
<h3 className="text-xl font-bold text-white mb-2 group-hover:text-indigo-400 transition-colors">
|
|
258
|
+
Zero Config
|
|
259
|
+
</h3>
|
|
260
|
+
<p className="text-gray-400 text-sm leading-relaxed">
|
|
261
|
+
Get started immediately with sensible defaults.
|
|
262
|
+
</p>
|
|
263
|
+
</div>
|
|
264
|
+
</section>
|
|
265
|
+
|
|
266
|
+
{/* Code Example */}
|
|
267
|
+
<section
|
|
268
|
+
id="examples"
|
|
269
|
+
className="glass-card rounded-2xl p-8 text-left border-white/10"
|
|
270
|
+
>
|
|
271
|
+
<h2 className="text-2xl font-bold text-white mb-6 text-center">
|
|
272
|
+
Quick Start
|
|
273
|
+
</h2>
|
|
274
|
+
<div className="bg-black/50 rounded-xl p-6 text-sm font-mono text-gray-300 overflow-x-auto border border-white/10 shadow-inner">
|
|
275
|
+
<div className="mb-4">
|
|
276
|
+
<div className="text-gray-500 mb-1">
|
|
277
|
+
# Create a new folder
|
|
278
|
+
</div>
|
|
279
|
+
<div className="text-orange-400">
|
|
280
|
+
mkdir my-app cd my-app
|
|
281
|
+
</div>
|
|
282
|
+
</div>
|
|
283
|
+
<div className="mb-4">
|
|
284
|
+
<div className="text-gray-500 mb-1">
|
|
285
|
+
# Initialize a new project
|
|
286
|
+
</div>
|
|
287
|
+
<div className="text-orange-400">npx arcanajs init</div>
|
|
288
|
+
</div>
|
|
289
|
+
<div className="mb-4">
|
|
290
|
+
<div className="text-gray-500 mb-1">
|
|
291
|
+
# Install dependencies
|
|
292
|
+
</div>
|
|
293
|
+
<div className="text-white">npm install</div>
|
|
294
|
+
</div>
|
|
295
|
+
<div className="mb-4">
|
|
296
|
+
<div className="text-gray-500 mb-1">
|
|
297
|
+
# Start development server
|
|
298
|
+
</div>
|
|
299
|
+
<div className="text-white">npm run dev</div>
|
|
300
|
+
</div>
|
|
301
|
+
<div className="mb-4">
|
|
302
|
+
<div className="text-gray-500 mb-1">
|
|
303
|
+
# Build for production
|
|
304
|
+
</div>
|
|
305
|
+
<div className="text-white">npm run build</div>
|
|
306
|
+
</div>
|
|
307
|
+
<div className="mb-4">
|
|
308
|
+
<div className="text-gray-500 mb-1">
|
|
309
|
+
# Start production server
|
|
310
|
+
</div>
|
|
311
|
+
<div className="text-white">npm start</div>
|
|
312
|
+
</div>
|
|
313
|
+
</div>
|
|
314
|
+
</section>
|
|
315
|
+
</div>
|
|
316
|
+
</main>
|
|
317
|
+
|
|
318
|
+
{/* Footer */}
|
|
319
|
+
<footer className="border-t border-white/5 mt-12 relative z-10 bg-black/20 backdrop-blur-md">
|
|
320
|
+
<div className="container mx-auto px-6 py-8">
|
|
321
|
+
<div className="flex flex-col md:flex-row items-center justify-between gap-4">
|
|
322
|
+
<div className="text-gray-500 text-sm">
|
|
323
|
+
© 2025 ArcanaJS. All rights reserved.
|
|
324
|
+
</div>
|
|
325
|
+
<div className="flex gap-6 text-gray-500 text-sm">
|
|
326
|
+
<a href="#" className="hover:text-white transition-colors">
|
|
327
|
+
GitHub
|
|
328
|
+
</a>
|
|
329
|
+
<a href="#" className="hover:text-white transition-colors">
|
|
330
|
+
Docs
|
|
331
|
+
</a>
|
|
332
|
+
<a href="#" className="hover:text-white transition-colors">
|
|
333
|
+
Community
|
|
334
|
+
</a>
|
|
335
|
+
</div>
|
|
336
|
+
</div>
|
|
337
|
+
</div>
|
|
338
|
+
</footer>
|
|
339
|
+
</div>
|
|
340
|
+
</div>
|
|
341
|
+
</Body>
|
|
342
|
+
</Page>
|
|
343
|
+
);
|
|
344
|
+
}
|