-
Notifications
You must be signed in to change notification settings - Fork 26
feat(sdk): add create-nitrolite-app project scaffolding tool #286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
maxpushka
wants to merge
24
commits into
main
Choose a base branch
from
feat/create-nitrolite-app-templater
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
4237b7a
feat: scaffold nextjs project
maxpushka b38fe76
feat: add CLI tool
maxpushka 2bcd721
fix: make welcome screen responsive
maxpushka bca4ad6
feat: add ascii art
maxpushka 7cc278e
refactor: make welcome screen persistent
maxpushka 0101a01
feat: exit the process after showing the completion message
maxpushka fb0d1f2
refactor: drop unused imports
maxpushka e7ab55e
feat: drop redundant templates
maxpushka 4ccafed
refactor: rename nextjs template
maxpushka dae8ae7
feat: add NextJS template
maxpushka c27b533
refactor: update connection status text
maxpushka 46c422f
docs: add README.md for scaffolding tool
maxpushka 725233f
feat: move template selectin before confirmation
maxpushka 7ce8255
fix: privy auth
maxpushka 7196b62
feat: add backend template
maxpushka a19b794
fix: pass template directly to project generator
maxpushka 6ee64ca
refactor: extract utility functions
maxpushka bf89f43
refactor: rework nitrolite client
maxpushka c850b70
refactor: modularize client for maintainability
maxpushka 644da31
refactor: logging cleanup
maxpushka eb3b675
refactor: remove redundant logs
maxpushka cd1989f
fix: deduplicate auth_challenge processing
maxpushka cbbec6e
refactor: drop dependency on express
maxpushka cc7ad6b
refactor: drop dependency on ethers
maxpushka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Build output | ||
| dist/ | ||
|
|
||
| # Auto-generated constants | ||
| src/constants/version.ts | ||
|
|
||
| # Dependencies | ||
| node_modules/ | ||
|
|
||
| # Logs | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
|
|
||
| # Runtime data | ||
| pids | ||
| *.pid | ||
| *.seed | ||
| *.pid.lock | ||
|
|
||
| # Coverage directory used by tools like istanbul | ||
| coverage/ | ||
|
|
||
| # IDE | ||
| .vscode/ | ||
| .idea/ | ||
|
|
||
| # OS | ||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| # TypeScript | ||
| *.tsbuildinfo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| # create-nitrolite-app | ||
|
|
||
| A CLI tool to quickly create new Nitrolite applications with various templates and configurations. | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Interactive Mode (Recommended) | ||
|
|
||
| ```bash | ||
| npx create-nitrolite-app | ||
| ``` | ||
|
|
||
| ### Quick Start | ||
|
|
||
| ```bash | ||
| # Create with default template | ||
| npx create-nitrolite-app my-app | ||
|
|
||
| # Create with specific template | ||
| npx create-nitrolite-app my-app --template nextjs-app | ||
|
|
||
| # Skip prompts and use defaults | ||
| npx create-nitrolite-app my-app --yes | ||
| ``` | ||
|
|
||
| ### Advanced Usage | ||
|
|
||
| ```bash | ||
| # Create without git initialization | ||
| npx create-nitrolite-app my-app --no-git | ||
|
|
||
| # Create without installing dependencies | ||
| npx create-nitrolite-app my-app --no-install | ||
|
|
||
| # Combine options | ||
| npx create-nitrolite-app my-app --template nextjs-app --no-git --yes | ||
| ``` | ||
|
|
||
| ## Available Templates | ||
|
|
||
| ### `nextjs-app` | ||
|
|
||
| - Next.js 15 with App Router | ||
| - TypeScript and TailwindCSS | ||
| - Server-side rendering | ||
| - Optimized for production | ||
|
|
||
| ## CLI Options | ||
|
|
||
| | Option | Description | Default | | ||
| | ------------------- | ---------------------------- | ------------ | | ||
| | `--template <name>` | Template to use | `react-vite` | | ||
| | `--no-git` | Skip git initialization | `false` | | ||
| | `--no-install` | Skip dependency installation | `false` | | ||
| | `--yes` | Skip prompts, use defaults | `false` | | ||
| | `--help` | Show help | - | | ||
| | `--version` | Show version | - | | ||
|
|
||
| ## Development | ||
|
|
||
| ### Build | ||
|
|
||
| ```bash | ||
| npm run build | ||
| ``` | ||
|
|
||
| ### Development | ||
|
|
||
| ```bash | ||
| npm run dev | ||
| ``` | ||
|
|
||
| ### Test | ||
|
|
||
| ```bash | ||
| npm test | ||
| ``` | ||
|
|
||
| ## Project Structure | ||
|
|
||
| ``` | ||
| my-nitrolite-app/ | ||
| ├── src/ | ||
| │ ├── components/ # React/Vue components | ||
| │ ├── hooks/ # Custom hooks (React) | ||
| │ ├── composables/ # Composables (Vue) | ||
| │ ├── utils/ # Utility functions | ||
| │ └── main.tsx # Entry point | ||
| ├── public/ # Static assets | ||
| ├── package.json | ||
| └── README.md | ||
| ``` | ||
|
Comment on lines
+81
to
+92
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| ## Next Steps | ||
|
|
||
| After creating your project: | ||
|
|
||
| 1. **Navigate to your project**: | ||
|
|
||
| ```bash | ||
| cd my-nitrolite-app | ||
| ``` | ||
|
|
||
| 2. **Install dependencies** (if not done automatically): | ||
|
|
||
| ```bash | ||
| npm install | ||
| ``` | ||
|
|
||
| 3. **Start development server**: | ||
|
|
||
| ```bash | ||
| npm run dev | ||
| ``` | ||
|
|
||
| 4. **Configure your WebSocket endpoint** in the config file | ||
|
|
||
| 5. **Start building your Nitrolite application**! | ||
|
|
||
| ## Documentation | ||
|
|
||
| - [Nitrolite SDK Documentation](https://github.com/erc7824/nitrolite) | ||
| - [Examples](../../examples/) | ||
| - [Issue Tracker](https://github.com/erc7824/nitrolite/issues) | ||
|
|
||
| ## Contributing | ||
|
|
||
| Contributions are welcome! Please read the contributing guide in the main repository. | ||
|
|
||
| ## License | ||
|
|
||
| ISC License - see the main repository for details. | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default template in the CLI options table is
react-vite, but this template isn't described in the "Available Templates" section and is not included in the pull request. This inconsistency could confuse users.