Skip to content

Commit

Permalink
updated git ignore, updated index html for better view, tewaked view …
Browse files Browse the repository at this point in the history
…and added animations on click, initiated firebase function.deployment and storage, added assets to server

Signed-off-by: Manjot Singh <[email protected]>
  • Loading branch information
manjotsk committed Apr 20, 2019
1 parent aaab5ef commit 11fe083
Show file tree
Hide file tree
Showing 35 changed files with 12,322 additions and 32 deletions.
15 changes: 15 additions & 0 deletions .firebase/hosting.YnVpbGQ.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
asset-manifest.json,1555779579319,bf5d0c8c72eee533eea1f92214b9f696b80706360f19dc0b2b8b48ebb76c7bd2
manifest.json,1555749706695,a40a4294484385ec155814f7d72caf5967a19f5efcbedf7a62b2cdff07e42711
index.html,1555779579318,4de4bb5e37bac31641cb80162f55e8ca5e49c916858862f8c417f2baae1e8a3c
precache-manifest.c67e9f732e8db6732d2ed03a1e16ce85.js,1555779579318,276cd44d87b81362fa57c8988c63b0f18b32e5a8bbed17eedeb6aaba175fbcc6
service-worker.js,1555779579319,9af207f0d3d6c69989a78e771a1b0060d7b83dd9916fe54d43c37cd55021ceb8
static/css/main.399ed941.chunk.css,1555779579347,fd46240de96a68765714927c2eb00e54ca8b7608f6f85ffcb636de630ba7bcfa
static/js/main.05f5b823.chunk.js,1555779579346,ecb29640cb24ebcae3b5e5f103ae877df02ca89c8dce86787c5a158d59dedc6f
static/js/main.05f5b823.chunk.js.map,1555779579347,c96cf8a380e2d222680c1e56b951699955496bec60aaebb002fc2f106b0ed46c
static/js/runtime~main.a8a9905a.js,1555779579347,27518aed75eb917ee7575e8c911b596e850b5265b9e5694a7681cba901419f4d
favicon.ico,1555749706695,eae62e993eb980ec8a25058c39d5a51feab118bd2100c4deebb2a9c158ec11f9
static/js/runtime~main.a8a9905a.js.map,1555779579347,d13b46ae2acf0d2863e1c6449a51f64702fa5b464c475c0ec20d6e8de9970ef9
static/css/main.399ed941.chunk.css.map,1555779579347,e46e9f3ecd24de40574ca0d0531da4cb5e1fb05875e3969bd646b987e577ec73
static/media/logo.5d5d9eef.svg,1555779579346,c0528de9db7d849577b204745e2df806c06fc14e27faf121c417111680b4280d
static/js/2.2995bbf7.chunk.js,1555779579348,802c7526a8fbc37bb95a1b3a3ec908c5bd9a870d6cb35766a0e0203b3ea9e71f
static/js/2.2995bbf7.chunk.js.map,1555779579349,9677458b0bbe730e17b3b247cdca6649ea07117d18350f7322da98f0713fa237
3 changes: 3 additions & 0 deletions .firebase/hosting.cHVibGlj.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
index.html,1555749706695,26b1ae42a121ed76124885113f96bd22431c337d5bf4ee17e02847533d418ae5
manifest.json,1555749706695,a40a4294484385ec155814f7d72caf5967a19f5efcbedf7a62b2cdff07e42711
favicon.ico,1555749706695,eae62e993eb980ec8a25058c39d5a51feab118bd2100c4deebb2a9c158ec11f9
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "portfoliovr-7b79e"
}
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
*node_modules*
/.pnp
.pnp.js

Expand Down
32 changes: 32 additions & 0 deletions firebase-debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[debug] [2019-04-20T18:42:37.792Z] ----------------------------------------------------------------------
[debug] [2019-04-20T18:42:37.795Z] Command: C:\Program Files\nodejs\node.exe C:\Users\Manjot\AppData\Local\Yarn\Data\global\node_modules\firebase-tools\lib\bin\firebase.js serve --only functions
[debug] [2019-04-20T18:42:37.795Z] CLI Version: 6.0.1
[debug] [2019-04-20T18:42:37.795Z] Platform: win32
[debug] [2019-04-20T18:42:37.795Z] Node Version: v10.13.0
[debug] [2019-04-20T18:42:37.796Z] Time: Sun Apr 21 2019 00:12:37 GMT+0530 (India Standard Time)
[debug] [2019-04-20T18:42:37.796Z] ----------------------------------------------------------------------
[debug]
[debug] [2019-04-20T18:42:37.815Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2019-04-20T18:42:37.815Z] > authorizing via signed-in user
[debug] [2019-04-20T18:42:37.816Z] [iam] checking project portfoliovr-7b79e for permissions ["firebase.projects.get"]
[debug] [2019-04-20T18:42:37.818Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]
[debug] [2019-04-20T18:42:37.818Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token
<request body omitted>
[debug] [2019-04-20T18:42:38.471Z] <<< HTTP RESPONSE 200
[debug] [2019-04-20T18:42:38.486Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/portfoliovr-7b79e:testIamPermissions

[debug] [2019-04-20T18:42:40.503Z] <<< HTTP RESPONSE 200
[debug] [2019-04-20T18:42:40.504Z] >>> HTTP REQUEST GET https://cloudresourcemanager.googleapis.com/v1/projects/portfoliovr-7b79e

[debug] [2019-04-20T18:42:42.588Z] <<< HTTP RESPONSE 200
[info]
[info] === Serving from 'Z:\projects\vrportfolio'...
[info]
[info] i functions: Preparing to emulate functions.
[debug] [2019-04-20T18:42:43.750Z] Fetching environment
[debug] [2019-04-20T18:42:43.753Z] >>> HTTP REQUEST GET https://mobilesdk-pa.googleapis.com/v1/projects/732039606025:getServerAppConfig

[debug] [2019-04-20T18:42:44.694Z] <<< HTTP RESPONSE 200
[debug] [2019-04-20T18:42:44.694Z] Starting @google-cloud/functions-emulator
[debug] [2019-04-20T18:42:47.233Z] Parsing function triggers
[info] + functions: api: http://localhost:5000/portfoliovr-7b79e/us-central1/api
19 changes: 19 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"hosting": {
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
"storage": {
"rules": "storage.rules"
}
}
47 changes: 47 additions & 0 deletions functions/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
var createError = require('http-errors');
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');

var indexRouter = require('./routes/index');
var usersRouter = require('./routes/users');

var app = express();

// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');

app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
// res.header("Access-Control-Allow-Origin", "*");
app.use(function (req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "*");
next();
});

app.use('/', indexRouter);
app.use('/users', usersRouter);

// catch 404 and forward to error handler
app.use(function (req, res, next) {
next(createError(404));
});

// error handler
app.use(function (err, req, res, next) {
// set locals, only providing error in development
res.locals.message = err.message;
res.locals.error = req.app.get('env') === 'development' ? err : {};

// render the error page
res.status(err.status || 500);
res.render('error');
});

module.exports = app;
90 changes: 90 additions & 0 deletions functions/bin/www
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#!/usr/bin/env node

/**
* Module dependencies.
*/

var app = require('../app');
var debug = require('debug')('server:server');
var http = require('http');

/**
* Get port from environment and store in Express.
*/

var port = normalizePort(process.env.PORT || '3000');
app.set('port', port);

/**
* Create HTTP server.
*/

var server = http.createServer(app);

/**
* Listen on provided port, on all network interfaces.
*/

server.listen(port);
server.on('error', onError);
server.on('listening', onListening);

/**
* Normalize a port into a number, string, or false.
*/

function normalizePort(val) {
var port = parseInt(val, 10);

if (isNaN(port)) {
// named pipe
return val;
}

if (port >= 0) {
// port number
return port;
}

return false;
}

/**
* Event listener for HTTP server "error" event.
*/

function onError(error) {
if (error.syscall !== 'listen') {
throw error;
}

var bind = typeof port === 'string'
? 'Pipe ' + port
: 'Port ' + port;

// handle specific listen errors with friendly messages
switch (error.code) {
case 'EACCES':
console.error(bind + ' requires elevated privileges');
process.exit(1);
break;
case 'EADDRINUSE':
console.error(bind + ' is already in use');
process.exit(1);
break;
default:
throw error;
}
}

/**
* Event listener for HTTP server "listening" event.
*/

function onListening() {
var addr = server.address();
var bind = typeof addr === 'string'
? 'pipe ' + addr
: 'port ' + addr.port;
debug('Listening on ' + bind);
}
28 changes: 28 additions & 0 deletions functions/firebase-debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[debug] [2019-04-20T13:44:58.704Z] ----------------------------------------------------------------------
[debug] [2019-04-20T13:44:58.707Z] Command: C:\Program Files\nodejs\node.exe C:\Users\Manjot\AppData\Local\Yarn\Data\global\node_modules\firebase-tools\lib\bin\firebase.js serve --only functions
[debug] [2019-04-20T13:44:58.707Z] CLI Version: 6.0.1
[debug] [2019-04-20T13:44:58.707Z] Platform: win32
[debug] [2019-04-20T13:44:58.707Z] Node Version: v10.13.0
[debug] [2019-04-20T13:44:58.708Z] Time: Sat Apr 20 2019 19:14:58 GMT+0530 (India Standard Time)
[debug] [2019-04-20T13:44:58.708Z] ----------------------------------------------------------------------
[debug]
[debug] [2019-04-20T13:44:58.724Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2019-04-20T13:44:58.725Z] > authorizing via signed-in user
[debug] [2019-04-20T13:44:58.725Z] [iam] checking project portfoliovr-7b79e for permissions ["firebase.projects.get"]
[debug] [2019-04-20T13:44:58.728Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/portfoliovr-7b79e:testIamPermissions

[debug] [2019-04-20T13:45:00.655Z] <<< HTTP RESPONSE 200
[debug] [2019-04-20T13:45:00.656Z] >>> HTTP REQUEST GET https://cloudresourcemanager.googleapis.com/v1/projects/portfoliovr-7b79e

[debug] [2019-04-20T13:45:02.375Z] <<< HTTP RESPONSE 200
[info]
[info] === Serving from 'Z:\projects\vrportfolio'...
[info]
[info] i functions: Preparing to emulate functions.
[debug] [2019-04-20T13:45:03.270Z] Fetching environment
[debug] [2019-04-20T13:45:03.273Z] >>> HTTP REQUEST GET https://mobilesdk-pa.googleapis.com/v1/projects/732039606025:getServerAppConfig

[debug] [2019-04-20T13:45:03.933Z] <<< HTTP RESPONSE 200
[debug] [2019-04-20T13:45:03.933Z] Starting @google-cloud/functions-emulator
[debug] [2019-04-20T13:45:06.474Z] Parsing function triggers
[info] + functions: api: http://localhost:5000/portfoliovr-7b79e/us-central1/api
5 changes: 5 additions & 0 deletions functions/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

var express = require('express');
var app = require('./app')
var functions = require('firebase-functions')
exports.api = functions.https.onRequest(app);
22 changes: 22 additions & 0 deletions functions/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"serve": "firebase serve --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"dependencies": {
"firebase-admin": "~6.0.0",
"firebase-functions": "^2.1.0",
"cookie-parser": "~1.4.3",
"debug": "~2.6.9",
"express": "~4.16.0",
"http-errors": "~1.6.2",
"jade": "~1.11.0",
"morgan": "~1.9.0"
},
"private": true
}
8 changes: 8 additions & 0 deletions functions/public/stylesheets/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
body {
padding: 50px;
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
}

a {
color: #00B7FF;
}
18 changes: 18 additions & 0 deletions functions/routes/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
var express = require('express');
var router = express.Router();
var path = require('path')
/* GET home page. */
router.get('/:filename', function (req, res, next) {
try {
res.sendFile(req.params.filename, { root: './assets/WoodenCabinBlend/' })

} catch (error) {
console.log(error);

}
});
// router.get('/WoodenCabinObj.mtl', function (req, res, next) {
// res.sendFile('WoodenCabinObj.mtl', { root: './assets/WoodenCabinBlend/' })
// });

module.exports = router;
9 changes: 9 additions & 0 deletions functions/routes/users.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var express = require('express');
var router = express.Router();

/* GET users listing. */
router.get('/', function(req, res, next) {
res.send('respond with a resource');
});

module.exports = router;
16 changes: 16 additions & 0 deletions functions/server/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "server",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"dependencies": {
"cookie-parser": "~1.4.3",
"debug": "~2.6.9",
"express": "~4.16.0",
"http-errors": "~1.6.2",
"jade": "~1.11.0",
"morgan": "~1.9.0"
}
}
6 changes: 6 additions & 0 deletions functions/views/error.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extends layout

block content
h1= message
h2= error.status
pre #{error.stack}
5 changes: 5 additions & 0 deletions functions/views/index.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extends layout

block content
h1= title
p Welcome to #{title}
7 changes: 7 additions & 0 deletions functions/views/layout.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
doctype html
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
body
block content
Loading

0 comments on commit 11fe083

Please sign in to comment.