@lucifer91299/create-portal-app 1.0.0 → 1.0.3

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 (2) hide show
  1. package/README.md +230 -0
  2. package/package.json +4 -2
package/README.md ADDED
@@ -0,0 +1,230 @@
1
+ # `create-portal-app`
2
+
3
+ > Scaffold a complete Next.js 15 authenticated portal in seconds — animated login, dashboard layout, JWT auth, and full theming. No backend required.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@lucifer91299/create-portal-app)](https://www.npmjs.com/package/@lucifer91299/create-portal-app)
6
+ [![npm downloads](https://img.shields.io/npm/dm/@lucifer91299/create-portal-app)](https://www.npmjs.com/package/@lucifer91299/create-portal-app)
7
+ [![license](https://img.shields.io/npm/l/@lucifer91299/create-portal-app)](https://github.com/aakashkanojiya91299/nexportal/blob/main/LICENSE)
8
+
9
+ ---
10
+
11
+ ## Quick start
12
+
13
+ ```bash
14
+ npx create-portal-app my-portal
15
+ ```
16
+
17
+ The CLI walks you through each choice with arrow-key menus, then generates a ready-to-run project.
18
+
19
+ ```bash
20
+ cd my-portal
21
+ npm install
22
+ npm run dev
23
+ # → http://localhost:3000/login
24
+ # → admin@demo.com / password123
25
+ ```
26
+
27
+ ---
28
+
29
+ ## Non-interactive (`--yes`)
30
+
31
+ Skip every prompt and use defaults instantly:
32
+
33
+ ```bash
34
+ npx create-portal-app my-portal --yes
35
+ ```
36
+
37
+ Override specific options while skipping the rest:
38
+
39
+ ```bash
40
+ # Change login style and sidebar
41
+ npx create-portal-app my-portal --yes --login=simple --sidebar=rail
42
+
43
+ # Custom brand colours
44
+ npx create-portal-app my-portal --yes --primary=#E11D48 --accent=#F59E0B --success=#10B981
45
+
46
+ # Laravel backend
47
+ npx create-portal-app my-portal --yes --auth=laravel
48
+
49
+ # Show all flags
50
+ npx create-portal-app --help
51
+ ```
52
+
53
+ ---
54
+
55
+ ## All flags
56
+
57
+ | Flag | Values | Default | Description |
58
+ |------|--------|---------|-------------|
59
+ | `[project-name]` | any string | `my-portal` | Output folder name |
60
+ | `--yes`, `-y` | — | — | Skip all prompts, use defaults |
61
+ | `--auth=` | `jwt` \| `multi-role` \| `laravel` | `jwt` | Auth strategy |
62
+ | `--login=` | `animated` \| `simple` | `animated` | Login page style |
63
+ | `--sidebar=` | `full` \| `rail` \| `both` | `full` | Sidebar variant |
64
+ | `--primary=` | `#hex` | `#000080` | Primary brand colour |
65
+ | `--accent=` | `#hex` | `#FF9933` | Accent colour |
66
+ | `--success=` | `#hex` | `#138808` | Success / green colour |
67
+ | `--api-url=` | URL | `http://localhost:3000` | Backend API URL (written to `.env.local`) |
68
+ | `--pm=` | `npm` \| `pnpm` \| `yarn` | `npm` | Package manager for install instructions |
69
+ | `--local-ui=` | relative path | — | Use a local `@lucifer91299/ui` build (dev mode) |
70
+ | `--help`, `-h` | — | — | Show help and exit |
71
+
72
+ ---
73
+
74
+ ## Defaults (when `--yes` is used)
75
+
76
+ ```
77
+ Auth mode : jwt cookie-based JWT, demo /api/auth/* routes
78
+ Login style : animated floating orbs + particle canvas + tricolor stripe
79
+ Sidebar : full wide sidebar with nav groups and labels
80
+ Primary : #000080 navy blue
81
+ Accent : #FF9933 saffron
82
+ Success : #138808 green
83
+ State mgmt : redux-query Redux Toolkit + TanStack Query
84
+ Package mgr : npm
85
+ ```
86
+
87
+ ---
88
+
89
+ ## What gets generated
90
+
91
+ ```
92
+ my-portal/
93
+ ├── src/
94
+ │ ├── app/
95
+ │ │ ├── layout.tsx root layout — ThemeProvider + CSS imports
96
+ │ │ ├── globals.css Tailwind directives only
97
+ │ │ ├── page.tsx redirects / → /login
98
+ │ │ ├── login/
99
+ │ │ │ └── page.tsx LoginPage (animated) or LoginPageSimple
100
+ │ │ ├── dashboard/
101
+ │ │ │ ├── layout.tsx DashboardLayout + useJwtAuth
102
+ │ │ │ └── page.tsx dashboard home page
103
+ │ │ └── api/
104
+ │ │ └── auth/
105
+ │ │ ├── login/route.ts POST — signs JWT, sets httpOnly cookie
106
+ │ │ ├── user/route.ts GET — verifies JWT, returns user payload
107
+ │ │ └── logout/route.ts POST — clears cookie
108
+ │ ├── components/
109
+ │ │ └── nav-config.tsx navGroups definition
110
+ │ ├── lib/
111
+ │ │ └── api.ts axios client
112
+ │ ├── store/ Redux store + auth slice
113
+ │ ├── middleware.ts JWT edge middleware (guards /dashboard)
114
+ │ └── theme.config.ts createTheme({ primary, accent, ... })
115
+ ├── public/
116
+ │ └── brand/
117
+ │ └── logo.svg placeholder — replace with your logo
118
+ ├── tailwind.config.ts
119
+ ├── next.config.ts transpilePackages: ['@lucifer91299/ui']
120
+ └── .env.local NEXT_PUBLIC_API_URL, JWT_SECRET
121
+ ```
122
+
123
+ ---
124
+
125
+ ## Demo credentials
126
+
127
+ The generated project works out of the box — no backend required:
128
+
129
+ ```
130
+ Email : admin@demo.com
131
+ Password : password123
132
+ ```
133
+
134
+ The `/api/auth/login` route uses `jose` to sign a 7-day JWT and stores it in an `httpOnly` cookie.
135
+ The `/api/auth/user` route verifies it.
136
+ `middleware.ts` protects every path under `/dashboard`.
137
+
138
+ **Change `JWT_SECRET` in `.env.local` before you deploy.**
139
+
140
+ ---
141
+
142
+ ## Auth modes
143
+
144
+ ### `jwt` (default)
145
+
146
+ Cookie-based JWT. Works with any backend (NestJS, Express, FastAPI, etc.) — or use the generated demo routes with no backend at all.
147
+
148
+ ### `multi-role`
149
+
150
+ Each role gets its own cookie (`portal_coach_token`, `portal_judge_token`, …). A role-select splash screen is shown after login when the user holds multiple roles.
151
+
152
+ ### `laravel`
153
+
154
+ Generates the Laravel session auth setup. Prompts for Laravel URL, DB credentials, and scaffolds the config accordingly.
155
+
156
+ ---
157
+
158
+ ## Login styles
159
+
160
+ ### `animated` (default)
161
+
162
+ Full-screen login with:
163
+ - Floating parallax orbs in brand colours
164
+ - Particle canvas background
165
+ - Animated tricolor stripe entrance
166
+ - Staggered card reveal
167
+
168
+ Best for institutional, government, or high-impact portals.
169
+
170
+ ### `simple`
171
+
172
+ Clean gradient card login with optional role-select splash. Best for SaaS or minimal designs.
173
+
174
+ ---
175
+
176
+ ## Sidebar variants
177
+
178
+ | Value | Description |
179
+ |-------|-------------|
180
+ | `full` | Wide sidebar with group headings, nav labels, and collapsible sections |
181
+ | `rail` | Icon-only narrow sidebar |
182
+ | `both` | Full on desktop, rail on mobile/tablet |
183
+
184
+ ---
185
+
186
+ ## Stack generated
187
+
188
+ - **Next.js 15** (App Router) + TypeScript
189
+ - **Tailwind CSS 3** with `@lucifer91299/ui` preset
190
+ - **`@lucifer91299/ui`** — components, hooks, design system
191
+ - **framer-motion 12** — entrance animations
192
+ - **jose 5** — JWT sign + verify
193
+ - **Redux Toolkit + TanStack Query** (state management)
194
+ - **lucide-react** — icons
195
+
196
+ ---
197
+
198
+ ## Local development (use a local SDK build)
199
+
200
+ ```bash
201
+ npx create-portal-app my-portal --yes --local-ui=../../packages/ui
202
+ # generates: "@lucifer91299/ui": "file:../../packages/ui" in package.json
203
+ ```
204
+
205
+ ---
206
+
207
+ ## UI library
208
+
209
+ This CLI scaffolds projects using **`@lucifer91299/ui`**.
210
+ See the full component and theming documentation at:
211
+
212
+ - [npm — @lucifer91299/ui](https://www.npmjs.com/package/@lucifer91299/ui)
213
+ - [GitHub — aakashkanojiya91299/nexportal](https://github.com/aakashkanojiya91299/nexportal)
214
+
215
+ ---
216
+
217
+ ## Changelog
218
+
219
+ ### v1.0.3
220
+ - Added `workflow_dispatch` to GitHub Actions — manual publish trigger from Actions tab
221
+ - README improvements: badges, changelog
222
+
223
+ ### v1.0.2
224
+ - Renamed scope from `@nexportal` → `@lucifer91299`
225
+ - Added per-package README files (shown on npm)
226
+ - Default login style changed to `animated`
227
+ - Added `--local-ui` flag for local SDK development
228
+
229
+ ### v1.0.1
230
+ - Initial public release
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucifer91299/create-portal-app",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "description": "Scaffold a Next.js authenticated portal with full design system in one command",
5
5
  "license": "MIT",
6
6
  "author": "Aakash Kanojiya",
@@ -8,7 +8,9 @@
8
8
  "create-portal-app": "dist/cli/index.js"
9
9
  },
10
10
  "main": "dist/cli/index.js",
11
- "files": ["dist"],
11
+ "files": [
12
+ "dist"
13
+ ],
12
14
  "scripts": {
13
15
  "build": "tsup",
14
16
  "dev": "tsup --watch",