Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions docs/api/auth-service.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@create-mern-app/auth-service</title>
<link rel="stylesheet" href="https://mernjs.github.io/create-mern-app/assets/plugins/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="https://mernjs.github.io/create-mern-app/assets/plugins/prism/prism.css">
<link rel="stylesheet" href="https://mernjs.github.io/create-mern-app/assets/css/styles.css" id="theme-style">
</head>
<body>
<div class="container" style="margin-top:40px;margin-bottom:60px;">
<a href="./index.html">← Back to API Index</a>
<h1>@create-mern-app/auth-service</h1>
<p class="lead">Simple OAuth2.0 helper: auth URL, token exchange, refresh, profile.</p>

<h2>Install</h2>
<pre><code class="language-bash">npm install @create-mern-app/auth-service</code></pre>

<h2>Usage</h2>
<pre><code class="language-javascript">import AuthService from '@create-mern-app/auth-service';

const authService = new AuthService({
clientId: 'your_client_id',
clientSecret: 'your_client_secret',
redirectUri: 'http://localhost:5500/callback',
authBaseUrl: 'http://localhost:3000'
});

const url = authService.getAuthUrl();
// Redirect user to `url`

const { accessToken, refreshToken } = await authService.getAccessToken('auth_code');
const refreshed = await authService.getRefreshToken(refreshToken);
const profile = await authService.getUserProfile(accessToken);
</code></pre>

<h2>API</h2>
<ul>
<li><code>constructor({ clientId, clientSecret, redirectUri, authBaseUrl })</code></li>
<li><code>getAuthUrl()</code></li>
<li><code>getAccessToken(authCode)</code> → <code>{ accessToken, refreshToken? }</code></li>
<li><code>getRefreshToken(refreshToken)</code> → <code>{ accessToken, refreshToken? }</code></li>
<li><code>getUserProfile(accessToken)</code></li>
</ul>
</div>

<script src="https://mernjs.github.io/create-mern-app/assets/plugins/prism/prism.js"></script>
</body>
</html>
77 changes: 77 additions & 0 deletions docs/api/create-mernjs-app.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CLI: create-mernjs-app</title>
<link rel="stylesheet" href="https://mernjs.github.io/create-mern-app/assets/plugins/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="https://mernjs.github.io/create-mern-app/assets/plugins/prism/prism.css">
<link rel="stylesheet" href="https://mernjs.github.io/create-mern-app/assets/css/styles.css" id="theme-style">
</head>
<body>
<div class="container" style="margin-top:40px;margin-bottom:60px;">
<a href="./index.html">← Back to API Index</a>
<h1>create-mernjs-app (CLI)</h1>
<p class="lead">Scaffold apps, libraries, packages, and snippets from curated templates.</p>

<h2>Requirements</h2>
<ul>
<li>Node.js 18+</li>
</ul>

<h2>Usage</h2>
<pre><code class="language-bash">npx create-mernjs-app &lt;project-directory&gt; [--template app|library|packages|snippets] [--yes]</code></pre>

<h3>Arguments</h3>
<ul>
<li><code>&lt;project-directory&gt;</code>: Name of the folder to create.</li>
</ul>

<h3>Options</h3>
<ul>
<li><code>-y, --yes</code>: Skip confirmation prompt.</li>
<li><code>--template &lt;type&gt;</code>: Choose template catalog: <code>app</code>, <code>library</code>, <code>packages</code>, or <code>snippets</code>.</li>
</ul>

<h2>Examples</h2>
<pre><code class="language-bash"># Create an app (interactive category selection)
npx create-mernjs-app my-app

# Create a library project
npx create-mernjs-app my-lib --template library

# Create from packages catalog
npx create-mernjs-app my-tool --template packages

# Create from snippets catalog, auto-confirm
npx create-mernjs-app my-sample --template snippets --yes</code></pre>

<h2>What it does</h2>
<ol>
<li>Validates project name and Node version.</li>
<li>Loads live template list from GitHub.</li>
<li>Prompts for a template within the chosen catalog.</li>
<li>Performs a sparse checkout to copy only the selected template.</li>
<li>Rewrites <code>package.json</code> name (and <code>app.json</code> for React Native).</li>
<li>Runs <code>npm install --legacy-peer-deps</code>.</li>
<li>Prints next steps: <code>cd &lt;project&gt;</code> and <code>npm run dev</code>.</li>
</ol>

<h2>Troubleshooting</h2>
<ul>
<li><strong>Folder exists</strong>: Use a new <code>project-directory</code>.</li>
<li><strong>Git required</strong>: Ensure Git is installed for sparse checkout.</li>
<li><strong>Network access</strong>: CLI fetches templates via GitHub API.</li>
</ul>

<h2>Links</h2>
<ul>
<li><a href="https://www.npmjs.com/package/create-mernjs-app" target="_blank" rel="noopener">NPM</a></li>
<li><a href="https://github.com/mernjs/create-mern-app" target="_blank" rel="noopener">Repository</a></li>
</ul>
</div>

<script src="https://mernjs.github.io/create-mern-app/assets/plugins/prism/prism.js"></script>
</body>
</html>
40 changes: 40 additions & 0 deletions docs/api/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Create MERN App - API Docs</title>
<link rel="stylesheet" href="https://mernjs.github.io/create-mern-app/assets/plugins/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="https://mernjs.github.io/create-mern-app/assets/plugins/prism/prism.css">
<link rel="stylesheet" href="https://mernjs.github.io/create-mern-app/assets/css/styles.css" id="theme-style">
</head>
<body>
<div class="container" style="margin-top:40px;margin-bottom:60px;">
<h1>Create MERN App - API Documentation</h1>
<p class="lead">Public commands, functions, and components with concise usage examples.</p>

<h2>CLI</h2>
<ul>
<li><a href="./create-mernjs-app.html">create-mernjs-app (CLI)</a></li>
</ul>

<h2>Packages</h2>
<ul>
<li><a href="./react-svg-icons-loader.html">react-svg-icons-loader</a></li>
<li><a href="./xml-to-json-chunk-processor.html">xml-to-json-chunk-processor</a></li>
<li><a href="./xml-to-mongodb-importer.html">xml-to-mongodb-importer</a></li>
<li><a href="./node-google-sheet.html">@mernjs/googlesheets</a></li>
<li><a href="./auth-service.html">@create-mern-app/auth-service</a></li>
</ul>

<h2>Templates and Boilerplates</h2>
<p>See the main site for template catalogs and usage steps.</p>
<ul>
<li><a href="../index.html">Template Catalog</a></li>
</ul>
</div>

<script src="https://mernjs.github.io/create-mern-app/assets/plugins/prism/prism.js"></script>
</body>
</html>
52 changes: 52 additions & 0 deletions docs/api/node-google-sheet.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@mernjs/googlesheets</title>
<link rel="stylesheet" href="https://mernjs.github.io/create-mern-app/assets/plugins/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="https://mernjs.github.io/create-mern-app/assets/plugins/prism/prism.css">
<link rel="stylesheet" href="https://mernjs.github.io/create-mern-app/assets/css/styles.css" id="theme-style">
</head>
<body>
<div class="container" style="margin-top:40px;margin-bottom:60px;">
<a href="./index.html">← Back to API Index</a>
<h1>@mernjs/googlesheets</h1>
<p class="lead">Wrapper for Google Sheets: authorize, manage sheets, and CRUD data.</p>

<h2>Install</h2>
<pre><code class="language-bash">npm install @mernjs/googlesheets</code></pre>

<h2>Quick start</h2>
<pre><code class="language-javascript">import GoogleSheets from '@mernjs/googlesheets';

const sheets = new GoogleSheets();
await sheets.authorize('path/to/key.json', 'spreadsheet-id');
await sheets.connectSheet('MyActiveSheet');

await sheets.createSheet('NewSheetTitle');
const all = await sheets.getAllSheets();
const values = await sheets.getSheet('sheetId');
await sheets.updateSheet('sheetId', 'UpdatedTitle');
await sheets.deleteSheet('sheetId');

await sheets.addHeader(['Name', 'Email']);
await sheets.insertData([{ Name: 'Alice', Email: '[email protected]' }]);
const found = await sheets.findData({ Email: '[email protected]' });
await sheets.updateData({ Email: '[email protected]' }, { Name: 'Alice A.'});
await sheets.deleteData({ Email: '[email protected]' });
</code></pre>

<h2>Key methods</h2>
<ul>
<li><code>authorize(keyFile, spreadsheetId)</code></li>
<li><code>connectSheet(sheetName)</code></li>
<li><code>createSheet(title)</code>, <code>getAllSheets()</code>, <code>getSheet(sheetId)</code>, <code>updateSheet(sheetId, newTitle)</code>, <code>deleteSheet(sheetId)</code></li>
<li><code>addHeader(headers)</code>, <code>insertData(rows)</code>, <code>findData(query)</code>, <code>updateData(filter, update)</code>, <code>deleteData(filter)</code></li>
</ul>
</div>

<script src="https://mernjs.github.io/create-mern-app/assets/plugins/prism/prism.js"></script>
</body>
</html>
56 changes: 56 additions & 0 deletions docs/api/react-svg-icons-loader.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>react-svg-icons-loader</title>
<link rel="stylesheet" href="https://mernjs.github.io/create-mern-app/assets/plugins/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="https://mernjs.github.io/create-mern-app/assets/plugins/prism/prism.css">
<link rel="stylesheet" href="https://mernjs.github.io/create-mern-app/assets/css/styles.css" id="theme-style">
</head>
<body>
<div class="container" style="margin-top:40px;margin-bottom:60px;">
<a href="./index.html">← Back to API Index</a>
<h1>react-svg-icons-loader</h1>
<p class="lead">Lightweight React SVG icon loader with component and named exports.</p>

<h2>Install</h2>
<pre><code class="language-bash">npm install react-svg-icons-loader</code></pre>

<h2>Usage</h2>
<h3>Icon component</h3>
<pre><code class="language-jsx">import Icon from 'react-svg-icons-loader';

export default function Example() {
return (
&lt;div&gt;
&lt;Icon name="Hierarchical" size={100} color="blue" /&gt;
&lt;Icon name="Businessman" size={100} color="blue" /&gt;
&lt;/div&gt;
);
}</code></pre>

<h3>Named icons</h3>
<pre><code class="language-jsx">import { Businessman, Hierarchical } from 'react-svg-icons-loader';

export default function Example() {
return (
&lt;div&gt;
&lt;Hierarchical size={100} color="blue" /&gt;
&lt;Businessman size={100} color="blue" /&gt;
&lt;/div&gt;
);
}</code></pre>

<h2>Props</h2>
<ul>
<li><code>name</code> (Icon only): string icon name</li>
<li><code>size</code>: number pixels</li>
<li><code>color</code>: string CSS color</li>
</ul>
</div>

<script src="https://mernjs.github.io/create-mern-app/assets/plugins/prism/prism.js"></script>
</body>
</html>
51 changes: 51 additions & 0 deletions docs/api/xml-to-json-chunk-processor.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>xml-to-json-chunk-processor</title>
<link rel="stylesheet" href="https://mernjs.github.io/create-mern-app/assets/plugins/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="https://mernjs.github.io/create-mern-app/assets/plugins/prism/prism.css">
<link rel="stylesheet" href="https://mernjs.github.io/create-mern-app/assets/css/styles.css" id="theme-style">
</head>
<body>
<div class="container" style="margin-top:40px;margin-bottom:60px;">
<a href="./index.html">← Back to API Index</a>
<h1>xml-to-json-chunk-processor</h1>
<p class="lead">Split large XML files by tag and convert chunks to JSON with callbacks.</p>

<h2>Install</h2>
<pre><code class="language-bash">npm install xml-to-json-chunk-processor</code></pre>

<h2>Usage</h2>
<pre><code class="language-javascript">const xmltoJson = require('xml-to-json-chunk-processor');

const params = {
xmlUrl: 'path/to/large.xml',
openingTag: '&lt;item&gt;',
closingTag: '&lt;/item&gt;',
chunkSize: 2500,
callback: (data) => {
console.log('Processed data:', data);
}
};

xmltoJson(params)
.then(() => console.log('XML Processing Completed'))
.catch(console.error);
</code></pre>

<h2>Parameters</h2>
<ul>
<li><code>xmlUrl</code>: string path to XML file</li>
<li><code>openingTag</code>: string like <code>&lt;item&gt;</code></li>
<li><code>closingTag</code>: string like <code>&lt;/item&gt;</code></li>
<li><code>chunkSize</code>: number, default 2500</li>
<li><code>callback</code>: function receiving parsed JSON per chunk</li>
</ul>
</div>

<script src="https://mernjs.github.io/create-mern-app/assets/plugins/prism/prism.js"></script>
</body>
</html>
54 changes: 54 additions & 0 deletions docs/api/xml-to-mongodb-importer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>xml-to-mongodb-importer</title>
<link rel="stylesheet" href="https://mernjs.github.io/create-mern-app/assets/plugins/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="https://mernjs.github.io/create-mern-app/assets/plugins/prism/prism.css">
<link rel="stylesheet" href="https://mernjs.github.io/create-mern-app/assets/css/styles.css" id="theme-style">
</head>
<body>
<div class="container" style="margin-top:40px;margin-bottom:60px;">
<a href="./index.html">← Back to API Index</a>
<h1>xml-to-mongodb-importer</h1>
<p class="lead">Split large XML files and import parsed JSON into MongoDB.</p>

<h2>Install</h2>
<pre><code class="language-bash">npm install xml-to-mongodb-importer</code></pre>

<h2>Usage</h2>
<pre><code class="language-javascript">const { runImporter } = require('xml-to-mongodb-importer');

const params = {
xmlUrl: 'path/to/file.xml',
openingTag: '&lt;item&gt;',
closingTag: '&lt;/item&gt;',
connection: {
mongoURI: 'mongodb://localhost:27017',
databaseName: 'yourDb',
collectionName: 'items'
},
chunkSize: 2500
};

runImporter(params)
.then(() => console.log('Import completed successfully!'))
.catch(console.error);
</code></pre>

<h2>Parameters</h2>
<ul>
<li><code>xmlUrl</code>: string, path to <code>.xml</code> file</li>
<li><code>openingTag</code>, <code>closingTag</code>: strings like <code>&lt;item&gt;</code>, <code>&lt;/item&gt;</code></li>
<li><code>connection.mongoURI</code>: Mongo connection URI</li>
<li><code>connection.databaseName</code>: Database name</li>
<li><code>connection.collectionName</code>: Collection name</li>
<li><code>chunkSize</code>: number, default 2500</li>
</ul>
</div>

<script src="https://mernjs.github.io/create-mern-app/assets/plugins/prism/prism.js"></script>
</body>
</html>
Loading