Skip to content

Commit 0de1b66

Browse files
authored
Merge pull request #3 from gobeam/dev
Dev
2 parents fa89d1a + 242da20 commit 0de1b66

File tree

9 files changed

+137
-56
lines changed

9 files changed

+137
-56
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

app/assets/sass/layout/_navbar.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,19 @@
2727
.home-page {
2828
.navbar{
2929
width: 100%;
30+
.logos{
31+
width: 250px;
32+
@include d-y-center;
33+
flex-grow: 1;
34+
font-weight: 900;
35+
color: $primary;
36+
font-size: 24px;
37+
text-shadow: #e0e0e0 1px 1px 0;
38+
}
39+
.header-main{
40+
width: calc(100% - 250px);
41+
@include d-y-center;
42+
}
3043
}
3144
.ant-layout-header {
3245
background: #ececec;

app/assets/sass/pages/_home.scss

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@100;300;400;500;60;7000&display=swap');
22
.home-wrapper {
3-
@include d-center;
3+
@include d-x-center;
44
flex-direction: column;
55
background-color: $bg-color;
66
}
@@ -185,7 +185,7 @@
185185

186186

187187
.layout-page-content > :nth-child(2){
188-
flex: initial;
188+
flex: initial !important;
189189
}
190190

191191
.ant-card {
@@ -194,6 +194,9 @@
194194

195195
.banner{
196196
background-color: #ececec;
197+
min-height: calc(100vh - 230px);
198+
display: flex;
199+
align-items: center;
197200
}
198201

199202
img{
@@ -265,14 +268,16 @@ img{
265268
background: url('assets/images/helps-bg.jpg') no-repeat center center fixed;
266269
background-size: cover;
267270
// height: 200px;
268-
271+
padding: 60px 0;
272+
h3{
273+
margin-bottom: 50px;
274+
}
269275
.card-inner{
270276
text-align: center;
271277
.img-wrap{
272278
svg{
273279
font-size: 50px;
274-
color: #3875e3;
275-
margin-bottom: 40px;
280+
margin-bottom: 20px;
276281
}
277282
}
278283
h4{
@@ -290,19 +295,23 @@ img{
290295
.ant-card{
291296
background-color: rgb(244, 246, 248);
292297
padding: 25px;
298+
box-shadow: rgba(145, 158, 171, 0.40) -6px 7px 20px 0px;
299+
margin-bottom: 40px;
300+
.img-wrap{
301+
svg{
302+
color: $primary;
303+
}
304+
}
305+
min-height: 350px;
293306
}
294307
.card-one{
295308

296-
margin-top: -40px;
309+
// margin-top: -40px;
297310
}
298311
.card-two{
299312
background-color: rgb(255, 255, 255);
300313
box-shadow: rgba(145, 158, 171, 0.40) -6px 7px 20px 0px;
301-
.img-wrap{
302-
svg{
303-
color: $primary;
304-
}
305-
}
314+
306315
}
307316
.card-three{
308317
margin-top: 80px;
@@ -325,7 +334,7 @@ img{
325334
margin: 40px 0;
326335
width: 100%;
327336
.ant-card{
328-
padding: 20px 40px;
337+
padding: 20px 40px 60px;
329338
width: 100%;
330339
cursor: pointer;
331340
// background-color: transparent;
@@ -336,39 +345,39 @@ img{
336345
box-shadow: 0px 8px 45px rgba(210, 210, 215, 0.9);
337346
&:hover{
338347
.designation{
339-
opacity: 1;
348+
// opacity: 1;
340349
}
341350
}
342351
}
352+
.ant-card-body{
353+
padding: 20px 0 5px;
354+
}
343355
.card-inner{
344356
display: flex;
345357
align-items: center;
346358
justify-content: center;
347359
flex-direction: column;
348-
.img-wrap{
349-
height: 100px;
350-
width: 100px;
351-
background: #ffffff;
352-
border-radius: 8px;
353-
display: flex;
354-
align-items: center;
355-
justify-content: center;
360+
h4{
361+
font-size: 22px;
362+
font-weight: 600;
363+
text-align: center;
356364
}
357365
.designation{
358366
position: absolute;
359367
bottom: 0;
360-
opacity: 0;
361-
padding-bottom: 20px;
368+
opacity: 1;
369+
padding-bottom: 25px;
362370
transition: all ease .5s;
371+
@include d-y-center;
363372
.icon{
364373
cursor: pointer;
365374
svg{
366-
font-size: 20px;
375+
margin-right: 10px;
376+
font-size: 23px;
367377
color: #000000;
368378
}
369379
}
370380
.linked{
371-
margin-left: 10px;
372381
svg{
373382
color: #0084be;
374383
}

app/assets/sass/pages/_user-account.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,3 @@
5656
}
5757
}
5858

59-

app/common/layout/Navbar.js

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,21 @@ function Navbar() {
1111
<Header className="d-flex w-100 headers">
1212
<div className="container-fluid d-flex w-100">
1313
<div className="logos"> Truthy</div>
14-
<div className="w-100">
15-
<Menu
16-
mode="horizontal"
17-
defaultSelectedKeys={['1']}
18-
className="ml-auto"
19-
>
20-
<Menu.Item key="1">
21-
<Link className="login-form-forgot" to="/">
22-
<FormattedMessage {...messages.home} />
23-
</Link>
24-
</Menu.Item>
25-
<Menu.Item key="2">
26-
<Link className="login-form-forgot" to="/login">
27-
<FormattedMessage {...messages.login} />
28-
</Link>
29-
</Menu.Item>
30-
</Menu>
14+
<div className="header-main">
15+
<div className="ml-auto">
16+
<Menu mode="horizontal" defaultSelectedKeys={['1']}>
17+
<Menu.Item key="1">
18+
<Link className="login-form-forgot" to="/">
19+
<FormattedMessage {...messages.home} />
20+
</Link>
21+
</Menu.Item>
22+
<Menu.Item key="2">
23+
<Link className="login-form-forgot" to="/login">
24+
<FormattedMessage {...messages.login} />
25+
</Link>
26+
</Menu.Item>
27+
</Menu>
28+
</div>
3129
</div>
3230
</div>
3331
</Header>

app/containers/HomePage/contributors.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ const Contributors = ({ contributors, loading = true }) => {
3232
}
3333
>
3434
<div className="card-inner">
35-
<div className="img-wrap">
35+
{/* <div className="img-wrap">
3636
<h4 className="text-center">{item.author}</h4>
37-
</div>
37+
</div> */}
3838
<h4>{item.author}</h4>
3939
<p className="mb-3">{item.designation}</p>
4040

app/containers/HomePage/truthyHelp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const TruthyHelps = () => {
5757
<Row gutter={20}>
5858
{functionalities.map((functionality) => (
5959
<Col lg={8} key={functionality.title}>
60-
<Card className="card-one">
60+
<Card>
6161
<div className="card-inner">
6262
<div className="img-wrap">{functionality.icon}</div>
6363
<h4>{functionality.title}</h4>

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)