Skip to content

Commit 0e2fa27

Browse files
authored
Merge pull request #60 from DenysLins/develop
Add react barebone - Issue 58
2 parents 6f0641d + f4f550e commit 0e2fa27

25 files changed

+15841
-14
lines changed

.github/workflows/react.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: React
4+
5+
# Controls when the action will run. Triggers the workflow on push or pull request
6+
# events but only for the master branch
7+
on:
8+
push:
9+
branches: [ master ]
10+
paths:
11+
- 'react/**'
12+
- '.github/**'
13+
pull_request:
14+
branches: [ master ]
15+
paths:
16+
- 'react/**'
17+
- '.github/**'
18+
19+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
20+
jobs:
21+
# This workflow contains a single job called "build"
22+
build:
23+
# The type of runner that the job will run on
24+
runs-on: ubuntu-latest
25+
26+
# Steps represent a sequence of tasks that will be executed as part of the job
27+
steps:
28+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
29+
- uses: actions/checkout@v2
30+
31+
# Runs a set of commands using the runners shell
32+
- name: React build
33+
run: |
34+
cd react
35+
docker build .

README.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
<img src="https://github.com/Stack-Box/stackBox/workflows/Vue/badge.svg" /></a>
88
<a href="https://github.com/Stack-Box/stackbox/actions?query=workflow%3AAngular" alt="Angular">
99
<img src="https://github.com/Stack-Box/stackBox/workflows/Angular/badge.svg" /></a>
10+
<a href="https://github.com/Stack-Box/stackbox/actions?query=workflow%3AReact" alt="React">
11+
<img src="https://github.com/Stack-Box/stackBox/workflows/React/badge.svg" /></a>
1012
<a href="https://github.com/Stack-Box/stackbox/actions?query=workflow%3AFlask" alt="Flask">
1113
<img src="https://github.com/Stack-Box/stackBox/workflows/Flask/badge.svg" /></a>
1214
<a href="https://github.com/Stack-Box/stackbox/actions?query=workflow%3ARails" alt="Rails">
@@ -22,8 +24,6 @@
2224
<img src="https://img.shields.io/badge/slack-chat-purple.svg?logo=slack" /></a>
2325
</p>
2426
<br/>
25-
26-
2727

2828
Stackbox helps you create app stacks loaded with all your favourite clients, services and infra in under 5 mins. The aim of the project is to help developers setup quick infra and boilerplates to start the dev work asap. Ideally this project is to help rapid prototyping, building PoCs or writing code for hackathons.
2929

@@ -35,6 +35,7 @@ Stackbox helps you create app stacks loaded with all your favourite clients, ser
3535
4. [**Debugging**](https://github.com/Stack-Box/StackBox/wiki/Debugging)
3636

3737
# Get Started
38+
3839
## Run
3940

4041
### Brew installation
@@ -43,6 +44,7 @@ Stackbox helps you create app stacks loaded with all your favourite clients, ser
4344
brew tap Stack-Box/tap
4445
brew install stackbox
4546
```
47+
4648
**Run**
4749

4850
```
@@ -63,21 +65,23 @@ Jump to [_**example-stacks**_](https://github.com/Stack-Box/StackBox/blob/master
6365

6466
## Support
6567

66-
| Clients/Services | Mysql | Elasticsearch | Kibana | Nginx | Kafka | Zookeper | S3 |
67-
| --- | --- | --- | --- | --- | --- | --- | --- |
68-
| **Flask** ||| na | na || na ||
69-
| **Rails** ||| na | na || na ||
70-
| **Vue** ||| na | na || na ||
71-
| **Angular** ||| na | na || na ||
68+
| Clients/Services | Mysql | Elasticsearch | Kibana | Nginx | Kafka | Zookeper | S3 |
69+
| ---------------- | ----- | ------------- | ------ | ----- | ----- | -------- | --- |
70+
| **Flask** ||| na | na || na ||
71+
| **Rails** ||| na | na || na ||
72+
| **Vue** ||| na | na || na ||
73+
| **Angular** ||| na | na || na ||
74+
| **React** ||| na | na || na ||
7275

7376
## Example Stacks
7477

7578
The following is a list of example stacks you could spin-up using Stackbox and quickly get-started with your development.
7679

7780
### 1. Flask-Vue-Mysql-Elasticsearch
81+
7882
#### Run
7983

80-
Run from source - `sh stackbox.sh`
84+
Run from source - `sh stackbox.sh`
8185

8286
or
8387

@@ -86,6 +90,7 @@ Run from Brew installation - `stackbox`
8690
Choose vue for frontend, flask for backend. Choose mysql and elasticsearch (with/without kibana) for services.
8791

8892
#### Test
93+
8994
After the run is finished, the final log should look like the one below.
9095

9196
```
@@ -95,7 +100,7 @@ elasticsearch is up at http://localhost:9200
95100
mysql is up at http://localhost:3306
96101
```
97102

98-
Now you can visit http://localhost:8080 to view the Vue frontend. From there you can click on Mysql/Elasticsearch links to view the preloaded data from mysql/elasticsearch containers being rendered.
103+
Now you can visit <http://localhost:8080> to view the Vue frontend. From there you can click on Mysql/Elasticsearch links to view the preloaded data from mysql/elasticsearch containers being rendered.
99104

100105
**Visit [Working](https://github.com/Stack-Box/StackBox/wiki/Working) or [Debugging](https://github.com/Stack-Box/StackBox/wiki/Debugging) pages to know more about internal details.**
101106

@@ -104,6 +109,7 @@ Now you can visit http://localhost:8080 to view the Vue frontend. From there you
104109
📢 **Contributors needed!!** 📢
105110

106111
**Aux Services**
112+
107113
- [ ] Dynamo
108114
- [x] S3
109115
- [ ] Postgres
@@ -113,11 +119,13 @@ Now you can visit http://localhost:8080 to view the Vue frontend. From there you
113119
- [ ] Hadoop
114120

115121
**Frontend clients**
122+
116123
- [x] Angular
117-
- [ ] React
124+
- [x] React
118125

119126
**Backend services**
127+
120128
- [x] Rails
121129
- [ ] Django
122130
- [ ] Springboot
123-
- [ ] Golang
131+
- [ ] Golang

master.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ angular:
2020
ports:
2121
- '4201:4200'
2222

23+
react:
24+
build:
25+
context: ./react
26+
volumes:
27+
- './react:/app'
28+
- '/app/node_modules'
29+
ports:
30+
- '3000:3000'
31+
stdin_open: true
32+
2333
mysql:
2434
image: mysql:5.7
2535
ports:

react/.eslintrc.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
module.exports = {
2+
parser: "babel-eslint",
3+
env: {
4+
browser: true,
5+
commonjs: true,
6+
es6: true,
7+
node: true,
8+
jest: true,
9+
},
10+
parserOptions: {
11+
ecmaVersion: 2020,
12+
ecmaFeatures: {
13+
impliedStrict: true,
14+
jsx: true,
15+
},
16+
sourceType: "module",
17+
},
18+
plugins: ["react", "react-hooks", "jest"],
19+
extends: [
20+
"eslint:recommended",
21+
"plugin:react/recommended",
22+
"plugin:react-hooks/recommended",
23+
"plugin:jest/recommended"
24+
],
25+
settings: {
26+
react: {
27+
version: "detect",
28+
},
29+
},
30+
rules: {},
31+
};

react/.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*

react/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM node:lts-alpine
2+
3+
WORKDIR '/app'
4+
5+
COPY package*.json ./
6+
7+
RUN npm install
8+
9+
COPY ./ ./
10+
11+
CMD [ "npm", "run", "start" ]

react/README.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2+
3+
## Available Scripts
4+
5+
In the project directory, you can run:
6+
7+
### `npm start`
8+
9+
Runs the app in the development mode.<br />
10+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
11+
12+
The page will reload if you make edits.<br />
13+
You will also see any lint errors in the console.
14+
15+
### `npm test`
16+
17+
Launches the test runner in the interactive watch mode.<br />
18+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19+
20+
### `npm run build`
21+
22+
Builds the app for production to the `build` folder.<br />
23+
It correctly bundles React in production mode and optimizes the build for the best performance.
24+
25+
The build is minified and the filenames include the hashes.<br />
26+
Your app is ready to be deployed!
27+
28+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29+
30+
### `npm run eject`
31+
32+
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33+
34+
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
35+
36+
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
37+
38+
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
39+
40+
## Learn More
41+
42+
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
43+
44+
To learn React, check out the [React documentation](https://reactjs.org/).
45+
46+
### Code Splitting
47+
48+
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
49+
50+
### Analyzing the Bundle Size
51+
52+
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
53+
54+
### Making a Progressive Web App
55+
56+
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
57+
58+
### Advanced Configuration
59+
60+
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
61+
62+
### Deployment
63+
64+
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
65+
66+
### `npm run build` fails to minify
67+
68+
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

0 commit comments

Comments
 (0)