Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added boilerplate flask, react, docker, compose #22

Merged
merged 1 commit into from
Aug 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Project/Orchestration/docker-compose.yml
Project/python/src/config.cfg
24 changes: 24 additions & 0 deletions Project/Orchestration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Orchestration files
Current implementation: Docker Compose

## How to run
* Duplicate the ```docker-compose-default.yml``` and rename it to ```docker-compose.yml```
* Populate the environment variable for **SODAPY_APPTOKEN** in ```docker-compose.yml```
* From this directory run ```docker-compose up -d --build```
* '-d' runs everything in the background
* '--build' will build both the front and backend images since they are not yet on dockerhub

### Frontend
[Link](http://localhost:3000)

### Backend
[Link](http://localhost:5000)

### PostgreSql Admin Dashboard
[Link](http://localhost:8080)
Login is as follows:
* System: PostgreSql
* server: db
* Username: 311-user
* Password: 311-data-is-r@d
* Database: 311-user
36 changes: 36 additions & 0 deletions Project/Orchestration/docker-compose-default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: '3.1'

services:
backend:
build:
context: ../python
image: 311-data-back:0.0.1
restart: always
environment:
SODAPY_APPTOKEN: <Your Token Here>
ports:
- 5000:5000

frontend:
build:
context: ../javascript/react/311-data
image: 311-data-front:0.0.1
volumes:
- '../javascript/react/311-data:/app'
- '/app/node_modules'
restart: always
ports:
- 3000:3000

db:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: 311-data-is-r@d
POSTGRES_USER: 311-user

adminer:
image: adminer
restart: always
ports:
- 8080:8080
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions Project/javascript/react/311-data/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
23 changes: 23 additions & 0 deletions Project/javascript/react/311-data/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
16 changes: 16 additions & 0 deletions Project/javascript/react/311-data/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# base image
FROM node:12.2.0-alpine

# set working directory
WORKDIR /app

# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH

# install and cache app dependencies
COPY package.json /app/package.json
RUN npm install --silent
RUN npm install [email protected] -g --silent

# start app
CMD ["npm", "start"]
68 changes: 68 additions & 0 deletions Project/javascript/react/311-data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `npm start`

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

The page will reload if you make edits.<br>
You will also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.<br>
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

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

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

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

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.

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.

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.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting

### Analyzing the Bundle Size

This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size

### Making a Progressive Web App

This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app

### Advanced Configuration

This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration

### Deployment

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

### `npm run build` fails to minify

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
Loading