Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ff1866
commit fa84e33
Showing
54 changed files
with
10,016 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM node:12.12.0-alpine | ||
WORKDIR /frontend-src/ | ||
|
||
COPY package.json /frontend-src | ||
COPY package-lock.json /frontend-src | ||
RUN npm install | ||
COPY src/ /frontend-src/src | ||
COPY Gulpfile.js /frontend-src | ||
RUN npm run gulp | ||
RUN mv /frontend-src/build /maniwani-frontend | ||
RUN cp -r /frontend-src/node_modules /maniwani-frontend/ | ||
WORKDIR /maniwani-frontend | ||
COPY entrypoint.sh /maniwani-frontend | ||
EXPOSE 3000 | ||
ENTRYPOINT ["sh", "./entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
const { series, parallel, src, dest } = require('gulp'); | ||
var gulp = require('gulp'); | ||
var babel = require('gulp-babel'); | ||
var filter = require('gulp-filter'); | ||
var log = require('gulplog'); | ||
var tap = require('gulp-tap'); | ||
var uglify = require('gulp-uglify'); | ||
var browserify = require('browserify'); | ||
var buffer = require('vinyl-buffer'); | ||
|
||
function compile_jsx() { | ||
return gulp.src('src/**/*.jsx'). | ||
pipe(babel({ | ||
plugins: ['@babel/transform-react-jsx', '@babel/plugin-transform-modules-commonjs'], | ||
presets: ['@babel/env'] | ||
})). | ||
pipe(gulp.dest('build/')); | ||
} | ||
function compile_js() { | ||
return gulp.src('src/**/*.js'). | ||
pipe(babel({ | ||
presets: ['@babel/env']})). | ||
pipe(gulp.dest('build/')); | ||
} | ||
function compile_client() { | ||
return gulp.src('build/client/*.js'). | ||
pipe(tap(function (file) { | ||
log.info('bundling ' + file.path); | ||
file.contents = browserify(file.path, {debug: true}).bundle(); | ||
})). | ||
pipe(buffer()). | ||
pipe(uglify()). | ||
pipe(gulp.dest('build/client-bundle')); | ||
} | ||
|
||
exports.jsx = compile_jsx; | ||
exports.js = compile_js; | ||
exports.build = series(parallel(exports.jsx, exports.js), compile_client); | ||
exports.default = exports.build; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Express/React frontend for Maniwani | ||
=================================== | ||
|
||
|
||
Building | ||
-------- | ||
|
||
The frontend builds with Docker, so the following should work: | ||
|
||
docker build -t maniwani-frontend . | ||
|
||
|
||
Running | ||
------- | ||
|
||
The frontend currently takes no options, so running it should be as simple as: | ||
|
||
docker run -p 3000:3000 maniwani-frontend | ||
|
||
Point to the hostname and port combo of the frontend in `maniwani.cfg`, and | ||
the backend should communicate with it correctly. See the `docker-compose.yml` | ||
and `maniwani.cfg` included with this repository for an example. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
|
||
cd /maniwani-frontend | ||
node server.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
node server.js |
Oops, something went wrong.