Skip to content
This repository was archived by the owner on Sep 4, 2020. It is now read-only.

Commit 7fa7905

Browse files
Initial import
0 parents  commit 7fa7905

File tree

138 files changed

+128760
-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.

138 files changed

+128760
-0
lines changed

.gitignore

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### Node template
3+
# Logs
4+
logs
5+
*.log
6+
npm-debug.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
*.pid.lock
13+
14+
# Directory for instrumented libs generated by jscoverage/JSCover
15+
lib-cov
16+
17+
# Coverage directory used by tools like istanbul
18+
coverage
19+
20+
# nyc test coverage
21+
.nyc_output
22+
23+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24+
.grunt
25+
26+
# node-waf configuration
27+
.lock-wscript
28+
29+
# Compiled binary addons (http://nodejs.org/api/addons.html)
30+
build/Release
31+
32+
# Dependency directories
33+
node_modules
34+
jspm_packages
35+
36+
# Optional npm cache directory
37+
.npm
38+
39+
# Optional eslint cache
40+
.eslintcache
41+
42+
# Optional REPL history
43+
.node_repl_history
44+
45+
# Output of 'npm pack'
46+
*.tgz
47+
48+
# Yarn Integrity file
49+
.yarn-integrity
50+
51+
.idea
52+
.DS_Store

COPYING

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Fluster - Roommates next door
2+
Copyright (C) Fluster GmbH, David Dal Busco, Zürich, Switzerland.
3+
4+
This program is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU Affero General Public License as
6+
published by the Free Software Foundation, either version 3 of the
7+
License, or (at your option) any later version.
8+
9+
This program is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU Affero General Public License for more details.
13+
14+
You should have received a copy of the GNU Affero General Public License
15+
along with this program. If not, see <http://www.gnu.org/licenses/>.

GNU-AGPL-3.0

Lines changed: 661 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<h1 align="center">Fluster</h1>
2+
3+
<p align="center">
4+
Roommates next door
5+
</p>
6+
7+
<p align="center">
8+
<a href="https://fluster.io/">
9+
<img alt="Fluster" title="Fluster" src="https://github.com/fluster/fluster-app/blob/master/resources/pwa/assets/icon/android-chrome-512x512.png" width="450">
10+
</a>
11+
</p>
12+
13+
<p align="center">
14+
<a href="https://itunes.apple.com/app/id1187266720">
15+
<img alt="Download on the App Store" title="App Store" src="https://fluster.io/assets/images/store/app-store-badge-en.svg" height="48px">
16+
</a>
17+
18+
<a href="http://play.google.com/store/apps/details?id=io.fluster.fluster">
19+
<img alt="Get it on Google Play" title="Google Play" src="https://fluster.io/assets/images/store/google-play-badge-en.png" height="48px">
20+
</a>
21+
22+
<a href="https://m.fluster.io">
23+
<img alt="Launch now as a PWA" title="PWA" src="https://user-images.githubusercontent.com/9122190/28998409-c5bf7362-7a00-11e7-9b63-db56694522e7.png" height="48px">
24+
</a>
25+
26+
</p>
27+
28+
## Introduction
29+
30+
Fluster is a platform which aims to simplify the search for roommates and flatshares by using smart features 😃🎉
31+
32+
This repo is the Fluster's backend, build with [NodeJs](https://nodejs.org), [ExpressJs](https://expressjs.com) and a [MongoDB](https://www.mongodb.com).
33+
34+
### Features
35+
36+
A few of the things Fluster offers:
37+
38+
* Fluster recommends you flatshares fitting your needs
39+
* With Fluster, you could discover what are the lifestyle and hobbies of your future roommates
40+
* You like a place on Fluster? You could send instant viewing requests
41+
* Fluster take care of the calendar of your viewings
42+
* Fluster is free, open source and even publishing an ad about your room to let is free too
43+
44+
## Feedback
45+
46+
Feel free to send me feedback on [Twitter](https://twitter.com/daviddalbusco) or [file an issue](https://github.com/fluster/fluster-appx/issues/new). Feature requests are always welcome.
47+
48+
## Social
49+
50+
Follow Fluster on [Twitter](https://twitter.com/flusterapp) or [Instagram](http://instagram.com/fluster.io/).
51+
52+
## License
53+
54+
Fluster is released under the GNU Affero General Public License. Copyright Fluster GmbH, Zürich, Switzerland. See COPYING for more details.
55+
56+
Fluster is developed by David Dal Busco.
57+
58+
The Fluster logo is a registered trademark of David Dal Busco, Zürich, Switzerland. Please contact [me](mailto:[email protected]) if you want to use it.

app.js

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
var express = require('express');
2+
var path = require('path');
3+
var logger = require('morgan');
4+
var cookieParser = require('cookie-parser');
5+
6+
// DB
7+
var db = require('./config/db');
8+
9+
// Amazon
10+
var amazon = require('./config/amazon');
11+
12+
// Internationalization
13+
require('./config/i18n');
14+
15+
// Don't include securityTokens
16+
// var securityTokens = require('./model/securityToken');
17+
// var device = require('./model/device');
18+
19+
require('./model/users');
20+
require('./model/subscriptions');
21+
require('./model/items');
22+
require('./model/appointments');
23+
require('./model/notifications');
24+
require('./model/chats');
25+
require('./model/itemUsers');
26+
require('./model/complaints');
27+
require('./model/rewards');
28+
29+
// The Application
30+
var app = express();
31+
32+
app.use(logger('dev'));
33+
app.use(cookieParser());
34+
app.use(require('stylus').middleware(path.join(__dirname, 'public')));
35+
app.use(express.static(path.join(__dirname, 'public')));
36+
37+
require('./config/parser')(app);
38+
39+
// Routes
40+
module.exports.app = app;
41+
42+
// Login routes
43+
var handlers = require('./routes/handlers');
44+
45+
require('./routes/items');
46+
require('./routes/likes');
47+
require('./routes/uploadImages');
48+
require('./routes/yelp');
49+
require('./routes/facebookMutualFriends');
50+
require('./routes/google');
51+
require('./routes/appointments');
52+
require('./routes/itemStars');
53+
require('./routes/itemUsers');
54+
require('./routes/notifications');
55+
require('./routes/chats');
56+
require('./routes/devices');
57+
require('./routes/statistics');
58+
require('./routes/complaints');
59+
require('./routes/profiles');
60+
require('./routes/pushNotifications');
61+
require('./routes/admin');
62+
require('./routes/products');
63+
require('./routes/subscriptions');
64+
require('./routes/candidates');
65+
require('./routes/spotify');
66+
require('./routes/educations');
67+
require('./routes/employers');
68+
require('./routes/rewards');
69+
70+
// Public routes
71+
require('./routes/public');
72+
73+
// Log4js
74+
75+
var log4js = require('log4js');
76+
77+
log4js.configure({
78+
appenders: {
79+
out: { type: 'console' },
80+
default: { type: 'dateFile', filename: '/var/log/node/peterparker-', "pattern":"yyyy-MM-dd.log", alwaysIncludePattern:true}
81+
},
82+
categories: {
83+
default: { appenders: ['out','default'], level: 'info' }
84+
}
85+
});
86+
87+
// Cron
88+
require('./cronjobs/cronjobs');
89+
90+
// catch 404 and forward to error handler
91+
app.use(function(req, res, next) {
92+
var err = new Error('Not Found');
93+
err.status = 404;
94+
next(err);
95+
});
96+
97+
// error handlers
98+
99+
// development error handler
100+
// will print stacktrace
101+
if (app.get('env') === 'development') {
102+
app.use(function(err, req, res, next) {
103+
res.status(err.status || 500).json({
104+
error: "Uncaught exception: " + err
105+
});
106+
});
107+
}
108+
109+
// production error handler
110+
// no stacktraces leaked to user
111+
app.use(function(err, req, res, next) {
112+
res.status(err.status || 500).json({
113+
error: "Uncaught exception: " + err
114+
});
115+
});
116+
117+
118+
module.exports = app;

bin/www

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#!/usr/bin/env node
2+
3+
/**
4+
* Module dependencies.
5+
*/
6+
7+
var app = require('../app');
8+
var debug = require('debug')('peterparker:server');
9+
var http = require('http');
10+
11+
/**
12+
* Get port from environment and store in Express.
13+
*/
14+
15+
var port = normalizePort(process.env.PORT || '3000');
16+
app.set('port', port);
17+
18+
/**
19+
* Create HTTP server.
20+
*/
21+
22+
var server = http.createServer(app);
23+
24+
// Socket.io
25+
require('../realtime/socket-io')(app, server);
26+
27+
/**
28+
* Listen on provided port, on all network interfaces.
29+
*/
30+
31+
server.listen(port);
32+
server.on('error', onError);
33+
server.on('listening', onListening);
34+
35+
/**
36+
* Normalize a port into a number, string, or false.
37+
*/
38+
39+
function normalizePort(val) {
40+
var port = parseInt(val, 10);
41+
42+
if (isNaN(port)) {
43+
// named pipe
44+
return val;
45+
}
46+
47+
if (port >= 0) {
48+
// port number
49+
return port;
50+
}
51+
52+
return false;
53+
}
54+
55+
/**
56+
* Event listener for HTTP server "error" event.
57+
*/
58+
59+
function onError(error) {
60+
if (error.syscall !== 'listen') {
61+
throw error;
62+
}
63+
64+
var bind = typeof port === 'string'
65+
? 'Pipe ' + port
66+
: 'Port ' + port;
67+
68+
// handle specific listen errors with friendly messages
69+
switch (error.code) {
70+
case 'EACCES':
71+
console.error(bind + ' requires elevated privileges');
72+
process.exit(1);
73+
break;
74+
case 'EADDRINUSE':
75+
console.error(bind + ' is already in use');
76+
process.exit(1);
77+
break;
78+
default:
79+
throw error;
80+
}
81+
}
82+
83+
/**
84+
* Event listener for HTTP server "listening" event.
85+
*/
86+
87+
function onListening() {
88+
var addr = server.address();
89+
var bind = typeof addr === 'string'
90+
? 'pipe ' + addr
91+
: 'port ' + addr.port;
92+
debug('Listening on ' + bind);
93+
}
94+

config/amazon.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const AWS = require('aws-sdk');
2+
3+
AWS.config.update({accessKeyId: "", secretAccessKey: ""});
4+
AWS.config.region = "";

0 commit comments

Comments
 (0)