Skip to content

Commit 2fcdaaa

Browse files
committed
merge from upstream
2 parents ad34a98 + d0706ff commit 2fcdaaa

File tree

301 files changed

+23419
-53072
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

301 files changed

+23419
-53072
lines changed

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Check out projects built with the help of this open source app. Feel free to add
4646
## Run locally
4747
- Clone the project and run `yarn` to add packages.
4848
- Before you start the app, create a `.env` file at the app's root. This file must have values for some env variables specified below.
49-
- To get `MONGO_URL_TEST`, we recommend a [free MongoDB at mLab](http://docs.mlab.com/).
49+
- To get `MONGO_URL_TEST`, we recommend a [free MongoDB at mLab](http://docs.mlab.com/) (to be updated soon with MongoDB Atlas, see [issue](https://github.com/builderbook/builderbook/issues/138)).
5050
- Get `Google_clientID` and `Google_clientSecret` by following [official OAuth tutorial](https://developers.google.com/identity/sign-in/web/sign-in#before_you_begin).
5151

5252
Important: For Google OAuth app, callback URL is: http://localhost:8000/oauth2callback <br/>
@@ -71,10 +71,14 @@ To use all features and third-party integrations (such as Stripe, Google OAuth,
7171
# Used in server/aws.js
7272
Amazon_accessKeyId="xxxxxx"
7373
Amazon_secretAccessKey="xxxxxx"
74+
Amazon_region="xxxxxx"
7475
7576
# Used in server/models/User.js
7677
EMAIL_SUPPORT_FROM_ADDRESS="xxxxxx"
77-
78+
79+
----------
80+
# All environmental variables above this line are required for successful sign up
81+
7882
# Used in server/github.js
7983
Github_Test_ClientID="xxxxxx"
8084
Github_Test_SecretKey="xxxxxx"
@@ -238,11 +242,13 @@ We also specified styles for all content inside a `<body>` element:
238242
- Create `now.json` file. Make sure to add actual values for `GA_TRACKING_ID`, `StripePublishableKey` (production-level) and `alias`. Read more about how to [configure now](https://zeit.co/docs/features/configuration).
239243
```
240244
{
245+
"version": 1
241246
"env": {
242247
"NODE_ENV": "production",
243248
"GA_TRACKING_ID": "xxxxxx",
244249
"StripePublishableKey": "xxxxxx"
245250
},
251+
"dotenv": true
246252
"alias": "mydomain.com",
247253
"scale": {
248254
"sfo1": {
@@ -308,12 +314,13 @@ Check out [package.json](https://github.com/builderbook/builderbook/blob/master/
308314

309315

310316
## Hire our team
311-
If you're interested in hiring our team to build custom SaaS features, fill out our [form](https://goo.gl/forms/4kk6mvowOjkQY21y2).
317+
We can build any functional SaaS MVP from scratch in 4-6 weeks for a fixed price of $10-20K ([example estimate](https://goo.gl/fw7YQU)).
318+
If you're interested, please fill out our [form](https://goo.gl/forms/4kk6mvowOjkQY21y2).
319+
312320

313-
We currently have 1 spot avaialble (30h/week engagement).
314-
We charge $100/h and are selective about the type of product and client.
321+
If you are a small team who works best in a calm environment and builds a SaaS product that solves a real problem - we want to hear from you.
315322

316-
If you are a small team, who works best in a calm environment and builds a SaaS product that solves a real problem - we want to hear from you.
323+
[Async](https://async-await.com) is the largest project in our portfolio to this date. [Sign up](https://app.async-await.com/signup) at Async to check it out.
317324

318325

319326
## Contributing

boilerplate/components/Header.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import MenuDrop from './MenuDrop';
99

1010
import { styleToolbar } from '../lib/SharedStyles';
1111

12-
1312
const optionsMenu = [
1413
{
1514
text: 'Got question?',

boilerplate/lib/context.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ const theme = createMuiTheme({
88
primary: { main: blue[700] },
99
secondary: { main: grey[700] },
1010
},
11+
typography: {
12+
useNextVariants: true,
13+
},
1114
});
1215

1316
function createPageContext() {

boilerplate/lib/withAuth.js

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ let globalUser = null;
77
export default (
88
Page,
99
{ loginRequired = true, logoutRequired = false, adminRequired = false } = {},
10-
) =>
11-
class BaseComponent extends React.Component {
10+
) => class BaseComponent extends React.Component {
1211
static propTypes = {
1312
user: PropTypes.shape({
1413
id: PropTypes.string,
@@ -21,6 +20,27 @@ export default (
2120
user: null,
2221
};
2322

23+
componentDidMount() {
24+
const { user, isFromServer } = this.props;
25+
26+
if (isFromServer) {
27+
globalUser = user;
28+
}
29+
30+
if (loginRequired && !logoutRequired && !user) {
31+
Router.push('/public/login', '/login');
32+
return;
33+
}
34+
35+
if (logoutRequired && user) {
36+
Router.push('/');
37+
}
38+
39+
if (adminRequired && (!user || !user.isAdmin)) {
40+
Router.push('/');
41+
}
42+
}
43+
2444
static async getInitialProps(ctx) {
2545
const isFromServer = !!ctx.req;
2646
const user = ctx.req ? ctx.req.user && ctx.req.user.toObject() : globalUser;
@@ -38,42 +58,21 @@ export default (
3858
return props;
3959
}
4060

41-
componentDidMount() {
42-
const { user } = this.props;
43-
44-
if (this.props.isFromServer) {
45-
globalUser = this.props.user;
46-
}
47-
48-
if (loginRequired && !logoutRequired && !user) {
49-
Router.push('/login');
50-
return;
51-
}
52-
53-
if (adminRequired && (!user || !user.isAdmin)) {
54-
Router.push('/');
55-
}
56-
57-
if (logoutRequired && user) {
58-
Router.push('/');
59-
}
60-
}
61-
6261
render() {
6362
const { user } = this.props;
6463

6564
if (loginRequired && !logoutRequired && !user) {
6665
return null;
6766
}
6867

69-
if (adminRequired && (!user || !user.isAdmin)) {
68+
if (logoutRequired && user) {
7069
return null;
7170
}
7271

73-
if (logoutRequired && user) {
72+
if (adminRequired && (!user || !user.isAdmin)) {
7473
return null;
7574
}
7675

7776
return <Page {...this.props} />;
7877
}
79-
};
78+
};

boilerplate/lib/withLayout.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import NProgress from 'nprogress';
55
import { MuiThemeProvider } from '@material-ui/core/styles';
66
import CssBaseline from '@material-ui/core/CssBaseline';
77

8-
import getContext from '../lib/context';
8+
import getContext from './context';
99
import Header from '../components/Header';
1010

1111
Router.onRouteChangeStart = () => NProgress.start();
@@ -14,9 +14,10 @@ Router.onRouteChangeError = () => NProgress.done();
1414

1515
function withLayout(BaseComponent) {
1616
class App extends React.Component {
17-
constructor(props, context) {
18-
super(props, context);
19-
this.pageContext = this.props.pageContext || getContext();
17+
constructor(props) {
18+
super(props);
19+
const { pageContext } = this.props;
20+
this.pageContext = pageContext || getContext();
2021
}
2122

2223
componentDidMount() {

boilerplate/now.json

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
2-
"env": {
3-
"NODE_ENV": "production"
4-
},
5-
"dotenv": true,
6-
"alias": "mydomain.com",
7-
"scale": {
8-
"sfo1": {
9-
"min": 1,
10-
"max": 1
11-
}
2+
"version": 1,
3+
"env": {
4+
"NODE_ENV": "production"
5+
},
6+
"dotenv": true,
7+
"alias": "mydomain.com",
8+
"scale": {
9+
"sfo1": {
10+
"min": 1,
11+
"max": 1
1212
}
13+
}
1314
}

boilerplate/package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,30 @@
1010
"lint": "eslint components pages lib server"
1111
},
1212
"dependencies": {
13-
"@material-ui/core": "^1.3.0",
13+
"@material-ui/core": "^3.2.2",
1414
"connect-mongo": "^2.0.1",
15-
"dotenv": "^6.0.0",
16-
"express": "^4.16.3",
15+
"dotenv": "^6.1.0",
16+
"express": "^4.16.4",
1717
"express-session": "^1.15.6",
18-
"googleapis": "^32.0.0",
19-
"lodash": "^4.17.10",
20-
"mongoose": "^5.1.7",
21-
"next": "^6.1.1",
18+
"googleapis": "^34.0.0",
19+
"lodash": "^4.17.11",
20+
"mongoose": "^5.3.4",
21+
"next": "^7.0.2",
2222
"nprogress": "^0.2.0",
2323
"passport": "^0.4.0",
2424
"passport-google-oauth": "^1.0.0",
2525
"prop-types": "^15.6.2",
26-
"react": "^16.4.1",
27-
"react-dom": "^16.4.1",
28-
"react-jss": "^8.6.0"
26+
"react": "^16.5.2",
27+
"react-dom": "^16.5.2",
28+
"react-jss": "^8.6.1"
2929
},
3030
"devDependencies": {
31-
"babel-eslint": "^8.2.5",
32-
"eslint": "^5.0.1",
33-
"eslint-config-airbnb": "^17.0.0",
34-
"eslint-plugin-import": "^2.13.0",
35-
"eslint-plugin-jsx-a11y": "^6.0.3",
36-
"eslint-plugin-react": "^7.10.0",
37-
"nodemon": "^1.17.5"
31+
"babel-eslint": "^10.0.1",
32+
"eslint": "^5.7.0",
33+
"eslint-config-airbnb": "^17.1.0",
34+
"eslint-plugin-import": "^2.14.0",
35+
"eslint-plugin-jsx-a11y": "^6.1.2",
36+
"eslint-plugin-react": "^7.11.1",
37+
"nodemon": "^1.18.4"
3838
}
3939
}

boilerplate/pages/login.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const Login = () => (
2121
You’ll be logged in for 14 days unless you log out manually.
2222
</p>
2323
<br />
24-
<Button variant="raised" style={styleLoginButton} href="/auth/google">
24+
<Button variant="contained" style={styleLoginButton} href="/auth/google">
2525
<img
2626
src="https://storage.googleapis.com/builderbook/G.svg"
2727
alt="Log in with Google"

0 commit comments

Comments
 (0)