Skip to content

Commit 301f312

Browse files
committed
Moved all JS packages into a single monorepo.
0 parents  commit 301f312

File tree

809 files changed

+78029
-0
lines changed

Some content is hidden

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

809 files changed

+78029
-0
lines changed

.flowconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[ignore]
2+
./packages-api/**/tests/**/*.js
3+
./packages-api/**/lib/**/*.js
4+
[include]
5+
./packages-api/**/src/**/*.js
6+
[libs]
7+
packages-api/webiny-api/flow-typed
8+
[lints]
9+
10+
[options]
11+
12+
[strict]

.gitattributes

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Auto detect text files and perform LF normalization
2+
3+
* text=auto
4+
5+
*.html text diff=html
6+
*.css text
7+
*.js text
8+
*.sql text
9+
*.php text
10+
*.md text
11+
*.txt text
12+
*.tpl text diff=html
13+
*.json text
14+
*.pdf diff=astextplain
15+
*.h text
16+
*.sh text
17+
*.less text
18+
*.svg text
19+
*.yml text
20+
*.xml text
21+
Makefile text
22+
Procfile text
23+
*.c text
24+
*.cfg text
25+
*.coffee text
26+
*.ini text
27+
28+
*.png binary
29+
*.jpg binary
30+
*.gif binary
31+
*.bmp binary
32+
*.bz2 binary
33+
*.jar binary
34+
*.jpe binary
35+
*.tar.gz binary
36+
*.zip binary
37+
38+
*.gitattributes text
39+
*.gitignore text

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.idea/
2+
node_modules
3+
.DS_Store
4+
coverage
5+
.nyc_output
6+
lib/
7+
dist/

.travis.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
language: node_js
2+
sudo: false
3+
node_js:
4+
- "node"
5+
- "8"
6+
install:
7+
- yarn install
8+
script:
9+
- yarn test:travis
10+
notifications:
11+
slack:
12+
on_success: change
13+
on_failure: always
14+
rooms:
15+
- webiny:rw9auyqJpDRRGcVmFCektrH5

README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Webiny JS
2+
===
3+
Our goal is a single web app development platform to develop APIs as well as React apps.
4+
5+
## API layer
6+
API is implemented as an `express` middleware so you can plug it into an existing express app, spin up a new express server or even deploy it using serverless providers.
7+
Last year we have released a PHP version of our API framework, but as JS is constantly growing and `serverless` architecture is gaining more and more momentum we decided we have to board the train and go 100% JS.
8+
9+
For the past couple of months we have been working on migrating our PHP API philosophy to JS, adapting things to JS environment, writing tons of tests and so far we are very happy with the results.
10+
11+
## Client layer (SPA)
12+
Our client (SPA) layer is based on React and features over 70+ ready to use components, you can [see and try all of them here](https://www.webiny.com/docs/current/components/alert).
13+
14+
## Database support
15+
So far we are only focused on `MySQL` but our storage layer allows 3rd party drivers.
16+
17+
## Documentation
18+
Documentation is a `work in progress` and will be available when we reach the pre-launch stage.
19+
20+
## Project organization
21+
We have decided to use a `monorepo` organization with multiple `yarn` workspaces to reduce the amount of repo maintenance.
22+
So far it is working out pretty well but we are still testing the structure. If you have any ideas or suggestions, feel free to get in touch with us.

examples/Client/Admin/App.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React from 'react';
2+
import {Webiny} from 'webiny-client';
3+
import Backend from 'webiny-backend-app';
4+
import Dashboard from './Modules/Dashboard';
5+
6+
class Admin extends Webiny.App {
7+
constructor() {
8+
super();
9+
this.name = 'MyApp.Frontend';
10+
11+
this.dependencies = [
12+
new Backend.App()
13+
];
14+
15+
this.modules = [
16+
new Dashboard(this)
17+
];
18+
19+
Webiny.Router.setTitlePattern('%s | MyApp');
20+
Webiny.Router.setDefaultRoute('Dashboard');
21+
}
22+
}
23+
24+
export default Admin;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import React from 'react';
2+
import {Webiny} from 'webiny-client';
3+
4+
class Dashboard extends Webiny.Ui.View {
5+
render() {
6+
const {View} = this.props;
7+
const user = Webiny.Model.get('User');
8+
9+
return (
10+
<View.Dashboard>
11+
<View.Header
12+
title="My Dashboard"
13+
description="Here you will find latest information about your account.">
14+
</View.Header>
15+
<View.Body>
16+
<p>You can now begin developing your app :)</p>
17+
</View.Body>
18+
</View.Dashboard>
19+
);
20+
}
21+
}
22+
23+
// This will create a component class and lazy load the defined modules
24+
// when this view is about to be mounted.
25+
export default Webiny.createComponent(Dashboard, {modules: ['View']});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import React from 'react';
2+
import {Webiny} from 'webiny-client';
3+
import DashboardView from './Dashboard';
4+
5+
class Dashboard extends Webiny.App.Module {
6+
init() {
7+
this.name = 'Dashboard';
8+
9+
this.registerMenus(
10+
// Create a Menu with title "Dashboard", which points to route "Dashboard"
11+
// and has an icon "fa-home"
12+
<Webiny.Ui.Menu label="Dashboard" route="Dashboard" icon="fa-home"/>
13+
);
14+
15+
this.registerRoutes(
16+
// Create a Route called "Dashboard", which matches the root of our app
17+
// and renders DashboardView component with document title of "Dashboard"
18+
new Webiny.Route('Dashboard', '/', DashboardView, 'Dashboard')
19+
);
20+
}
21+
}
22+
23+
export default Dashboard;

examples/Client/Admin/index.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>ADMINISTRATION</title>
6+
<link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700" rel="stylesheet" type="text/css">
7+
</head>
8+
<body>
9+
<div id="root"></div>
10+
</body>
11+
</html>

examples/Client/Admin/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import App from './App';
2+
import {renderApp} from 'webiny-client';
3+
4+
renderApp({app: new App(), root: document.getElementById('root'), module});
2.71 KB
Loading

examples/Client/Configs.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = {
2+
admin: {
3+
Api: {
4+
Url: 'http://thehub.app:8001/api',
5+
AggregateRequests: true
6+
},
7+
I18n: {
8+
enabled: false
9+
}
10+
},
11+
frontend: {
12+
Api: {
13+
Url: 'http://thehub.app:8001/api',
14+
AggregateRequests: false
15+
},
16+
I18n: {
17+
enabled: false
18+
}
19+
},
20+
userarea: {
21+
Api: {
22+
Url: 'http://thehub.app:8001/api',
23+
AggregateRequests: false
24+
},
25+
I18n: {
26+
enabled: false
27+
}
28+
}
29+
};

examples/Client/Frontend/App.js

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import React from 'react';
2+
import {Webiny} from 'webiny-client';
3+
import Skeleton from 'webiny-skeleton-app';
4+
import Dashboard from './Modules/Dashboard';
5+
import logo from './../Assets/images/logo.png';
6+
7+
class MyAppFrontend extends Webiny.App {
8+
constructor() {
9+
super();
10+
11+
this.name = 'MyApp.Frontend';
12+
this.dependencies = [
13+
new Skeleton.App()
14+
];
15+
16+
this.modules = [
17+
new Dashboard(this)
18+
];
19+
20+
Webiny.configureModule('Webiny/Layout/Logo', (Logo) => {
21+
Logo.configure({
22+
defaultProps: {
23+
img: logo
24+
}
25+
});
26+
});
27+
28+
Webiny.Router.setBaseUrl('/');
29+
Webiny.Router.setTitlePattern('%s | MyApp');
30+
Webiny.Router.setDefaultRoute('Dashboard');
31+
}
32+
}
33+
34+
export default MyAppFrontend;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import React from 'react';
2+
import {Webiny} from 'webiny-client';
3+
4+
class Dashboard extends Webiny.Ui.View {
5+
render() {
6+
const {View} = this.props;
7+
const user = Webiny.Model.get('User');
8+
9+
return (
10+
<View.Dashboard>
11+
<View.Header
12+
title="My Dashboard"
13+
description="Here you will find latest information about your account.">
14+
</View.Header>
15+
<View.Body>
16+
<p>You can now begin developing your next app :)</p>
17+
</View.Body>
18+
</View.Dashboard>
19+
);
20+
}
21+
}
22+
23+
// This will create a component class and lazy load the defined modules
24+
// when this view is about to be mounted.
25+
export default Webiny.createComponent(Dashboard, {modules: ['View']});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import React from 'react';
2+
import {Webiny} from 'webiny-client';
3+
import DashboardView from './Dashboard';
4+
5+
class Dashboard extends Webiny.App.Module {
6+
init() {
7+
this.name = 'Dashboard';
8+
9+
this.registerMenus(
10+
// Create a Menu with title "Dashboard", which points to route "Dashboard"
11+
// and has an icon "fa-home"
12+
<Webiny.Ui.Menu label="Dashboard" route="Dashboard" icon="fa-home"/>
13+
);
14+
15+
this.registerRoutes(
16+
// Create a Route called "Dashboard", which matches the root of our app
17+
// and renders DashboardView component with document title of "Dashboard"
18+
new Webiny.Route('Dashboard', '/', DashboardView, 'Dashboard')
19+
);
20+
}
21+
}
22+
23+
export default Dashboard;

examples/Client/Frontend/index.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>FRONTEND</title>
6+
<link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700" rel="stylesheet" type="text/css">
7+
</head>
8+
<body>
9+
<div id="root"></div>
10+
</body>
11+
</html>

examples/Client/Frontend/index.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import App from './App';
2+
import require from './require';
3+
import {Webiny, renderApp} from 'webiny-client';
4+
5+
renderApp({
6+
app: new App(),
7+
root: document.getElementById('root'),
8+
module,
9+
beforeRender() {
10+
return new Promise((resolve, reject) => {
11+
$.getJSON('/tenants/12345.json', data => {
12+
console.log("Tenant", data);
13+
Webiny.Config.Api.Url = data.api;
14+
require(`/themes/${data.theme}/index`, function (err, module) {
15+
resolve(module());
16+
});
17+
});
18+
});
19+
}
20+
});

examples/Client/Frontend/require.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/Client/UserArea/App.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React from 'react';
2+
import {Webiny} from 'webiny-client';
3+
import Backend from 'webiny-backend-app';
4+
import Dashboard from './Modules/Dashboard';
5+
6+
class MyAppFrontend extends Webiny.App {
7+
constructor() {
8+
super();
9+
10+
this.name = 'MyApp.UserArea';
11+
12+
this.dependencies = [
13+
new Backend.App()
14+
];
15+
16+
this.modules = [
17+
new Dashboard(this)
18+
];
19+
20+
Webiny.Router.setBaseUrl('/userarea');
21+
}
22+
}
23+
24+
export default MyAppFrontend;

0 commit comments

Comments
 (0)