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
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
</div>
<div align="center">

**Setup web apps in seconds, not hours, with your preferred stack**

[![npm version](https://img.shields.io/npm/v/celtrix.svg)](https://www.npmjs.com/package/celtrix)
[![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)
[![Downloads](https://img.shields.io/npm/dm/celtrix.svg)](https://www.npmjs.com/package/celtrix)

[![npm version](https://img.shields.io/npm/v/celtrix.svg)](https://www.npmjs.com/package/celtrix)
[![Downloads](https://img.shields.io/npm/dm/celtrix.svg)](https://www.npmjs.com/package/celtrix)
[![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)
Expand All @@ -16,20 +22,44 @@
# ✨ Features

### 🎯 **Multiple Stack Options**
Choose from **7+ popular stacks** including MERN, MEAN, T3, Angular+Tailwind, and more!

Choose from **multiple popular stacks** including MERN, MEAN, T3, Angular+Tailwind, and more!

### 🧩 New: MERN Turborepo Monorepo

Generate a production-ready **MERN monorepo** powered by **Turborepo** with a single command:

```
npx celtrix my-monorepo-app
# Select: MERN (Turborepo)
```

Features:

- Root-level workspace management
- Parallel dev for `apps/client` + `apps/server`
- Single install (`npm install`) at root
- Ready to extend with shared packages

<div align="center">
<img width="250" height="250" alt="Celtrix Stack Selection Demo" src="https://github.com/user-attachments/assets/7b6a30be-1e34-443e-a906-8c167230c238" />
</div>

### 🌐 **Language Flexibility**

Pick your preferred programming languages and frameworks to match your workflow.

<div align="center">
<img width="250" height="250" alt="Celtrix Language Selection" src="https://github.com/user-attachments/assets/3f8c775a-b747-4eb1-a22d-c1f236276934" />
</div>

### 🛠️ **Ready-to-Go Setup**

- ✅ **ESLint** configuration included
- ✅ **Sample components** and boilerplate code
- ✅ **API setup** with best practices
- ✅ **Automatic dependency installation**
- ✅ **Modern development tools** pre-configured
- **ESLint** configuration included
- **Sample components** and boilerplate code
- **API setup** with best practices
Expand All @@ -48,6 +78,16 @@ npx celtrix my-awesome-app

That's it! Follow the interactive prompts to customize your project.

For Turborepo MERN projects:

```
cd my-monorepo-app
npm install
npm run dev
```

Client runs on :5173 and server on :4000 by default.

---

## ❓ Frequently Asked Questions (FAQ)
Expand Down
15 changes: 13 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ async function askStackQuestions() {
choices: [
{ name: chalk.bold.blue("MERN") + " → MongoDB + Express + React + Node.js", value: "mern" },
{ name: chalk.bold.green("MERN") + " + Tailwind + Auth", value: "mern+tailwind+auth" },
{ name: chalk.bold.blue("MERN (Turborepo)") + " → Monorepo (apps/client + apps/server)", value: "mern-turbo" },
{ name: chalk.bold.red("MEAN") + " → MongoDB + Express + Angular + Node.js", value: "mean" },
{ name: chalk.bold.magenta("MEAN") + " + Tailwind + Auth", value: "mean+tailwind+auth" },
{ name: chalk.bold.cyan("MEVN") + " → MongoDB + Express + Vue.js + Node.js", value: "mevn" },
Expand Down Expand Up @@ -84,8 +85,18 @@ async function main() {
projectName = await askProjectName();
}
const stackAnswers = await askStackQuestions();
config = { ...stackAnswers, projectName };


// Normalization + backward compatibility (old variant values)
let { stack, language } = stackAnswers;
if (stack === 'mern-turbo-js' || stack === 'mern-turbo-ts') {
// Older variant naming: keep user selected language instead of forcing
stack = 'mern-turbo';
}
// Fallback language if somehow undefined
if (!language) language = 'typescript';
if (!['javascript', 'typescript'].includes(language)) language = 'typescript';
config = { ...stackAnswers, stack, language, projectName };


console.log(chalk.yellow("\n🚀 Creating your project...\n"));
await createProject(projectName, config);
Expand Down
7 changes: 7 additions & 0 deletions templates/mern-turbo/javascript/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
dist
.turbo
.env
*.log
apps/*/node_modules
apps/*/dist
63 changes: 63 additions & 0 deletions templates/mern-turbo/javascript/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# MERN Turborepo Template

A monorepo MERN setup managed by Turborepo.

## Structure

```
.
├── package.json # root with workspaces and turbo scripts
├── turbo.json # Turborepo pipeline config
└── apps
├── client # React + Vite frontend (App.jsx, assets/react.svg, strict mode)
└── server # Express API backend (server.js, health route)
```

## Scripts

From the root:

- `npm run dev` – Runs client and server in parallel via Turborepo
- `npm run build` – Builds all apps
- `npm run lint` – Lints all workspaces
- `npm run dev --filter=client` – Run only client
- `npm run dev --filter=server` – Run only server

## Next Steps After Scaffolding

```
cd <project-name>
npm install
npm run dev
```

Visit:
- Client: http://localhost:5173
- Server: http://localhost:4000/api/health

## Environment Variables

Create a `.env` file in `apps/server/` based on `.env.example`:

```
PORT=4000
MONGO_URI=mongodb://localhost:27017/your_db
NODE_ENV=development
```

If `MONGO_URI` is omitted, the server will start without a DB connection (scaffold-safe behavior).

## Error Handling

The server includes basic 404 and 500 handlers. Extend these in `server.js` as needed.

## Recommended Next Additions

- Add a shared `packages/` workspace for types/utilities
- Add Tailwind or UI lib to client
- Add tests (Vitest + React Testing Library, Supertest for API)
- Add Dockerfile for deployment

## Customization

Add linting, testing, shared packages, or environment configuration as needed.
24 changes: 24 additions & 0 deletions templates/mern-turbo/javascript/apps/client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
12 changes: 12 additions & 0 deletions templates/mern-turbo/javascript/apps/client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# React + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) for information on how to integrate TypeScript and [`typescript-eslint`](https://typescript-eslint.io) in your project.
29 changes: 29 additions & 0 deletions templates/mern-turbo/javascript/apps/client/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import { defineConfig, globalIgnores } from 'eslint/config'

export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{js,jsx}'],
extends: [
js.configs.recommended,
reactHooks.configs['recommended-latest'],
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
rules: {
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
},
},
])
13 changes: 13 additions & 0 deletions templates/mern-turbo/javascript/apps/client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
Loading