Skip to content

Commit 242da20

Browse files
committed
fix: update README.md and npx command
1 parent ee9543e commit 242da20

File tree

3 files changed

+72
-10
lines changed

3 files changed

+72
-10
lines changed

README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
<div align="center">
2+
<img src="./app/assets/images/logo/short-logo.svg" alt="Truthy Logo">
3+
</div><br>
14
<h1 align="center">
25
Truthy CMS (ReactJS Starter)
36
</h1>
47

5-
<div align="center"> This repository is frontend part of Truthy CMS written in ReactJS & Redux-Saga. [Ant design](https://ant.design/) is used as a UI library. This project includes User Management, Role Management, Permission Management, Email Module, Account Settings, OTP, RBAC support, Localization, and many more. </div>
8+
<div align="center"> This repository is frontend part of Truthy CMS written in ReactJS & Redux-Saga. For Backend API please visit https://github.com/gobeam/truthy. Ant design (https://ant.design/) is used as a UI library. This project includes User Management, Role Management, Permission Management, Email Module, Account Settings, OTP, RBAC support, Localization, and many more. Hope you like it.<br>
9+
If you love it don't forget to share your experience. If you want to contribute to the Truthy CMS in any way like API, Frontend, Design, Logo you're more than welcome to do so. Our plan is to make this no. 1 CMS maintained by opensource community.
10+
</div>
611

712
<br>
813
<div align="center">
@@ -33,27 +38,27 @@ https://nodejs.org/en/
3338

3439
In the project directory, you can run:
3540

36-
### `npm start`
41+
### `yarn start`
3742

3843
Runs the app in the development mode.<br>
3944
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
4045

4146
Hot reload is supported on the development environment page will reload if you make edits.<br>
4247
You will also see any lint errors in the console.
4348

44-
### `npm run build`
49+
### `yarn build`
4550

4651
Builds the app for production to the `build` folder.<br>
4752
It correctly bundles React in production mode and optimizes the build for the best performance.
4853

4954
The build is minified and the filenames include the hashes.<br>
5055
Your app is ready to be deployed!
5156

52-
### `npm run lint`
57+
### `yarn lint`
5358

5459
Lints all the files inside `./src` and shows the result without fixing.
5560

56-
### `lint:js:fix`
61+
### `yarn lint:js:fix`
5762

5863
Lints all the files inside `./src`.
5964

@@ -116,11 +121,11 @@ app
116121
│ └── helpers * Common Helper functions.
117122
│ └── hooks * Feature to use state and other React functionalities without writing class.
118123
│ └── i18n * Translation files.
119-
│ └── reducers * Pure function that takes an action and the previous state of the application and returns the new state.
124+
│ └── reducers * Pure function that takes an action and the previous state of the application and returns the
120125
│ └── routes * Routes list.
121126
│ └── scss * Scss files for the project.
122127
│ └── services * Common services file.
123-
│ └── store * The Redux action types in action-type.js, reducers, selectors, and main store in the sub-folders.
128+
│ └── store * The Redux action types in action-type.js, reducers, selectors, and main store in the
124129
│ └── utils * Common utils.
125130
│ └── app.js * Main app component.
126131
│ └── global-style.js * Global styles.
@@ -139,6 +144,8 @@ app
139144
├── .env * Environment variables (env.production, env.local, env.uat, etc).
140145
├── .eslintrc.json * ESLint configuration and rules.
141146
├── .prettierrc * Formatting Prettier options.
147+
├── Dockerfile * Docker file for prod environment.
148+
├── Dockerfile.dev * Docker file for dev environment.
142149
```
143150

144151
## Contributing

bin/cli.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env node
2+
const { execSync } = require('child_process');
3+
4+
const RESET = '\x1b[0m';
5+
const GREEN = '\x1b[32m';
6+
const YELLOW = '\x1b[33m';
7+
const WHITE = '\x1b[37m';
8+
const RED = '\x1b[31m';
9+
const CYAN = '\x1b[36m';
10+
const MAGENTA = '\x1b[35m';
11+
12+
const getColoredText = (text, color) => {
13+
if (color == null) {
14+
// eslint-disable-next-line no-param-reassign
15+
color = WHITE;
16+
}
17+
return color + text + RESET;
18+
};
19+
20+
const runCommand = (command) => {
21+
try {
22+
execSync(`${command}`, { stdio: 'inherit' });
23+
} catch (e) {
24+
console.error(
25+
getColoredText(`Failed to execute ${command}. Error: ${e}`, RED),
26+
);
27+
return false;
28+
}
29+
return true;
30+
};
31+
32+
const repoName = process.argv[2];
33+
const gitCheckoutCommand = `git clone --depth 1 https://github.com/gobeam/truthy-react-frontend ${repoName}`;
34+
const installDepsCommand = `cd ${repoName} && yarn install`;
35+
36+
console.log(
37+
getColoredText(`Cloning the repository with name ${repoName}`, CYAN),
38+
);
39+
const checkedOut = runCommand(gitCheckoutCommand);
40+
if (!checkedOut) process.exit(-1);
41+
42+
console.log(getColoredText(`Installing dependencies for ${repoName}`, YELLOW));
43+
const installedDeps = runCommand(installDepsCommand);
44+
if (!installedDeps) process.exit(-1);
45+
46+
console.log(
47+
getColoredText(
48+
'Congratulations! You are ready. Follow the following commands to start',
49+
MAGENTA,
50+
),
51+
);
52+
console.log(getColoredText(`cd ${repoName} && yarn start`, GREEN));

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "truthy-react-cms",
3-
"description": "",
3+
"description": "Truthy CMS starter template for React",
44
"version": "0.1.0",
55
"license": "MIT",
66
"author": "gobeam <[email protected]>",
@@ -18,9 +18,12 @@
1818
"react dashboard",
1919
"react admin template",
2020
"free react",
21-
"react ui library"
21+
"react ui library",
22+
"antd",
23+
"react-antd",
24+
"opensource cms"
2225
],
23-
"private": true,
26+
"bin": "./bin/cli.js",
2427
"scripts": {
2528
"prebuild": "npm run build:clean",
2629
"build": "cross-env NODE_ENV=production webpack --config internals/webpack/webpack.prod.babel.js --color --progress",

0 commit comments

Comments
 (0)