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

Project Ponz #17

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
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
37 changes: 37 additions & 0 deletions .app.js.~undo-tree~
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"76b3ec33e748f46bf56db15f03b3442ab860073c"
[cl-struct-undo-tree [nil ([nil ([nil ([nil (#1=[nil nil ((3119 . 3120) (t 23090 44111 41748 945000)) nil (23090 44322 492315 176000) 0 nil]) ((4267 . 4323) (" res.status(500).render('errors/500', { error: err });
" . 4267) (undo-tree-id0 . -56) (3806 . 3887) ("process.env.NODE_ENV === 'production' ? (args = [port]) : (args = [port, host]);
" . 3806) (undo-tree-id1 . -81) (3769 . 3795) ("const host = 'localhost';
" . 3769) (undo-tree-id2 . -26) (3536 . 3612) (#("app.engine('handlebars', hbs.engine);
app.set('view engine', 'handlebars');
" 0 10 (fontified t) 10 11 (fontified t face (rainbow-delimiters-depth-1-face)) 11 23 (fontified t face font-lock-string-face) 23 35 (fontified t) 35 36 (fontified t face (rainbow-delimiters-depth-1-face)) 36 45 (fontified t) 45 46 (fontified t face (rainbow-delimiters-depth-1-face)) 46 59 (fontified t face font-lock-string-face) 59 61 (fontified t) 61 73 (fontified t face font-lock-string-face) 73 74 (fontified t face (rainbow-delimiters-depth-1-face)) 74 76 (fontified t)) . 3536) (undo-tree-id3 . -76) (3475 . 3531) (#(" partialsDir: 'views/',
defaultLayout: 'application'
" 0 15 (fontified t) 15 23 (fontified t face font-lock-string-face) 23 42 (fontified t) 42 55 (fontified t face font-lock-string-face) 55 56 (fontified t)) . 3475) (undo-tree-id4 . -25) (undo-tree-id5 . -25) (undo-tree-id6 . -56) (undo-tree-id7 . -56) (undo-tree-id8 . -56) (3320 . 3415) (#("const expressHandlebars = require('express-handlebars');
const helpers = require('./helpers');
" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 23 (fontified t face font-lock-variable-name-face) 23 33 (fontified t) 33 34 (fontified t face (rainbow-delimiters-depth-1-face)) 34 54 (fontified t face font-lock-string-face) 54 55 (fontified t face (rainbow-delimiters-depth-1-face)) 55 57 (fontified t) 57 62 (fontified t face font-lock-keyword-face) 62 63 (fontified t) 63 70 (fontified t face font-lock-variable-name-face) 70 80 (fontified t) 80 81 (fontified t face (rainbow-delimiters-depth-1-face)) 81 92 (fontified t face font-lock-string-face) 92 93 (fontified t face (rainbow-delimiters-depth-1-face)) 93 95 (fontified t)) . 3320) (undo-tree-id9 . -57) (undo-tree-id10 . -57) (undo-tree-id11 . -95) (undo-tree-id12 . -95) (undo-tree-id13 . -95) (3009 . 3212) (#("const home = require('./routers/home');
const ponzvert = require('./routers/ponzvert');
const shop = require('/routers/shop');
app.use('/', home);
app.use('/ponzvert', ponzvert);
app.use('/shop', shop);
" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 10 (fontified t face font-lock-variable-name-face) 10 20 (fontified t) 20 21 (fontified t face (rainbow-delimiters-depth-1-face)) 21 37 (fontified t face font-lock-string-face) 37 38 (fontified t face (rainbow-delimiters-depth-1-face)) 38 40 (fontified t) 40 45 (fontified t face font-lock-keyword-face) 45 46 (fontified t) 46 54 (fontified t face font-lock-variable-name-face) 54 60 (fontified t) 60 64 (fontified t) 64 65 (fontified t face (rainbow-delimiters-depth-1-face)) 65 85 (fontified t face font-lock-string-face) 85 86 (fontified t face (rainbow-delimiters-depth-1-face)) 86 87 (fontified t) 87 88 (fontified t) 88 93 (fontified t face font-lock-keyword-face) 93 94 (fontified t) 94 98 (fontified t face font-lock-variable-name-face) 98 108 (fontified t) 108 109 (fontified t face (rainbow-delimiters-depth-1-face)) 109 123 (fontified t face font-lock-string-face) 123 124 (fontified t face font-lock-string-face) 124 125 (fontified t face (rainbow-delimiters-depth-1-face)) 125 126 (fontified t) 126 127 (fontified t) 127 134 (fontified t) 134 135 (fontified t face (rainbow-delimiters-depth-1-face)) 135 138 (fontified t face font-lock-string-face) 138 144 (fontified t) 144 145 (fontified t face (rainbow-delimiters-depth-1-face)) 145 147 (fontified t) 147 154 (fontified t) 154 155 (fontified t face (rainbow-delimiters-depth-1-face)) 155 166 (fontified t face font-lock-string-face) 166 176 (fontified t) 176 177 (fontified t face (rainbow-delimiters-depth-1-face)) 177 178 (fontified t) 178 179 (fontified t) 179 186 (fontified t) 186 187 (fontified t face (rainbow-delimiters-depth-1-face)) 187 194 (fontified t face font-lock-string-face) 194 200 (fontified t) 200 201 (fontified t face (rainbow-delimiters-depth-1-face)) 201 202 (fontified t) 202 203 (fontified t)) . 3009) (undo-tree-id14 . -203) (undo-tree-id15 . -203) (undo-tree-id16 . -179) (undo-tree-id17 . -179) (undo-tree-id18 . -147) (undo-tree-id19 . -147) (undo-tree-id20 . -127) (undo-tree-id21 . -127) (undo-tree-id22 . -88) (undo-tree-id23 . -88) (undo-tree-id24 . -40) (undo-tree-id25 . -40) (undo-tree-id26 . 77) (undo-tree-id27 . 78) (undo-tree-id28 . 78) (undo-tree-id29 . -125) (undo-tree-id30 . -125) (undo-tree-id31 . -125) (undo-tree-id32 . -203) (2679 . 2755) (#(" return done(null, false, { message: 'Invalid username/password' });
" 0 8 (fontified t) 8 14 (fontified t face font-lock-keyword-face) 14 19 (fontified t) 19 20 (fontified t face (rainbow-delimiters-depth-7-face)) 20 24 (fontified t face font-lock-constant-face) 24 26 (fontified t) 26 31 (fontified t face font-lock-constant-face) 31 33 (fontified t) 33 34 (fontified t face (rainbow-delimiters-depth-8-face)) 34 44 (fontified t) 44 71 (fontified t face font-lock-string-face) 71 72 (fontified t) 72 73 (fontified t face (rainbow-delimiters-depth-8-face)) 73 74 (fontified t face (rainbow-delimiters-depth-7-face)) 74 76 (fontified t)) . 2679) (undo-tree-id33 . -76) (2381 . 2439) (#("const LocalStrategy = require('passport-local').Strategy;
" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 19 (fontified t face font-lock-variable-name-face) 19 29 (fontified t) 29 30 (fontified t face (rainbow-delimiters-depth-1-face)) 30 46 (fontified t face font-lock-string-face) 46 47 (fontified t face (rainbow-delimiters-depth-1-face)) 47 58 (fontified t)) . 2381) (undo-tree-id34 . -58) (undo-tree-id35 . -58) (undo-tree-id36 . -58) (2252 . 2375) (#("const User = require('./models/User');
const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/test');
" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 10 (fontified t face font-lock-variable-name-face) 10 20 (fontified t) 20 21 (fontified t face (rainbow-delimiters-depth-1-face)) 21 36 (fontified t face font-lock-string-face) 36 37 (fontified t face (rainbow-delimiters-depth-1-face)) 37 39 (fontified t) 39 44 (fontified t face font-lock-keyword-face) 44 45 (fontified t) 45 53 (fontified t face font-lock-variable-name-face) 53 63 (fontified t) 63 64 (fontified t face (rainbow-delimiters-depth-1-face)) 64 74 (fontified t face font-lock-string-face) 74 75 (fontified t face (rainbow-delimiters-depth-1-face)) 75 93 (fontified t) 93 94 (fontified t face (rainbow-delimiters-depth-1-face)) 94 120 (fontified t face font-lock-string-face) 120 121 (fontified t face (rainbow-delimiters-depth-1-face)) 121 123 (fontified t)) . 2252) (undo-tree-id37 . -123) (undo-tree-id38 . -123) (undo-tree-id39 . -123) (2152 . 2190) (#("const passport = require('passport');
" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 14 (fontified t face font-lock-variable-name-face) 14 24 (fontified t) 24 25 (fontified t face (rainbow-delimiters-depth-1-face)) 25 35 (fontified t face font-lock-string-face) 35 36 (fontified t face (rainbow-delimiters-depth-1-face)) 36 38 (fontified t)) . 2152) (undo-tree-id40 . -38) (1892 . 1983) (#("const morgan = require('morgan');
const morganToolkit = require('morgan-toolkit')(morgan);
" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 12 (fontified t face font-lock-variable-name-face) 12 22 (fontified t) 22 23 (fontified t face (rainbow-delimiters-depth-1-face)) 23 31 (fontified t face font-lock-string-face) 31 32 (fontified t face (rainbow-delimiters-depth-1-face)) 32 34 (fontified t) 34 39 (fontified t face font-lock-keyword-face) 39 40 (fontified t) 40 53 (fontified t face font-lock-variable-name-face) 53 63 (fontified t) 63 64 (fontified t face (rainbow-delimiters-depth-1-face)) 64 80 (fontified t face font-lock-string-face) 80 81 (fontified t face (rainbow-delimiters-depth-1-face)) 81 82 (fontified t face (rainbow-delimiters-depth-1-face)) 82 88 (fontified t) 88 89 (fontified t face (rainbow-delimiters-depth-1-face)) 89 91 (fontified t)) . 1892) (undo-tree-id41 . -91) (undo-tree-id42 . -91) (undo-tree-id43 . -91) (1577 . 1631) (#(" req.session.backUrl = req.header('Referer') || '/';
" 0 34 (fontified t) 34 35 (fontified t face (rainbow-delimiters-depth-3-face)) 35 44 (fontified t face font-lock-string-face) 44 45 (fontified t face (rainbow-delimiters-depth-3-face)) 45 49 (fontified t) 49 52 (fontified t face font-lock-string-face) 52 54 (fontified t)) . 1577) (undo-tree-id44 . -54) (1196 . 1323) (#("const methodOverride = require('method-override');
const getPostSupport = require('express-method-override-get-post-support');
" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 20 (fontified t face font-lock-variable-name-face) 20 30 (fontified t) 30 31 (fontified t face (rainbow-delimiters-depth-1-face)) 31 48 (fontified t face font-lock-string-face) 48 49 (fontified t face (rainbow-delimiters-depth-1-face)) 49 51 (fontified t) 51 56 (fontified t face font-lock-keyword-face) 56 57 (fontified t) 57 71 (fontified t face font-lock-variable-name-face) 71 81 (fontified t) 81 82 (fontified t face (rainbow-delimiters-depth-1-face)) 82 124 (fontified t face font-lock-string-face) 124 125 (fontified t face (rainbow-delimiters-depth-1-face)) 125 127 (fontified t)) . 1196) (undo-tree-id45 . -127) (undo-tree-id46 . -127) (undo-tree-id47 . -127) (1021 . 1070) (#("const flash = require('express-flash-messages');
" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 11 (fontified t face font-lock-variable-name-face) 11 21 (fontified t) 21 22 (fontified t face (rainbow-delimiters-depth-1-face)) 22 46 (fontified t face font-lock-string-face) 46 47 (fontified t face (rainbow-delimiters-depth-1-face)) 47 49 (fontified t)) . 1021) (undo-tree-id48 . -49) (753 . 825) (#(" name: 'session',
keys: [process.env.SESSION_SECRET || 'secret']
" 0 10 (fontified t) 10 19 (fontified t face font-lock-string-face) 19 31 (fontified t) 31 32 (fontified t face (rainbow-delimiters-depth-4-face)) 32 62 (fontified t) 62 70 (fontified t face font-lock-string-face) 70 71 (fontified t face (rainbow-delimiters-depth-4-face)) 71 72 (fontified t)) . 753) (undo-tree-id49 . -72) (676 . 725) (#("const cookieSession = require('cookie-session');
" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 19 (fontified t face font-lock-variable-name-face) 19 29 (fontified t) 29 30 (fontified t face (rainbow-delimiters-depth-1-face)) 30 46 (fontified t face font-lock-string-face) 46 47 (fontified t face (rainbow-delimiters-depth-1-face)) 47 49 (fontified t)) . 676) (undo-tree-id50 . -49) (undo-tree-id51 . -49) (undo-tree-id52 . -49) (472 . 515) (#("const bodyParser = require('body-parser');
" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 16 (fontified t face font-lock-variable-name-face) 16 26 (fontified t) 26 27 (fontified t face (rainbow-delimiters-depth-1-face)) 27 29 (fontified t face font-lock-string-face) 29 40 (fontified t face font-lock-string-face) 40 41 (fontified t face (rainbow-delimiters-depth-1-face)) 41 43 (fontified t)) . 472) (undo-tree-id53 . -43) (291 . 366) (#("if (process.env.NODE_ENV !== 'production') {
require('dotenv').config();
" 0 2 (fontified t face font-lock-keyword-face) 2 3 (fontified t) 3 4 (fontified t face (rainbow-delimiters-depth-1-face)) 4 29 (fontified t) 29 41 (fontified t face font-lock-string-face) 41 42 (fontified t face (rainbow-delimiters-depth-1-face)) 42 43 (fontified t) 43 44 (fontified t face (rainbow-delimiters-depth-1-face)) 44 54 (fontified t) 54 55 (fontified t face (rainbow-delimiters-depth-2-face)) 55 63 (fontified t face font-lock-string-face) 63 64 (fontified t face (rainbow-delimiters-depth-2-face)) 64 71 (fontified t) 71 72 (fontified t face (rainbow-delimiters-depth-2-face)) 72 73 (fontified t face (rainbow-delimiters-depth-2-face)) 73 75 (fontified t)) . 291) (undo-tree-id54 . -75) (166 . 195) (#("app.locals.appName = 'Ponz';
" 0 21 (fontified t) 21 27 (fontified t face font-lock-string-face) 27 29 (fontified t)) . 166) (undo-tree-id55 . -29) (undo-tree-id56 . -29) (1 . 37) (#("const express = require('express');
" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 13 (fontified t face font-lock-variable-name-face) 13 23 (fontified t) 23 24 (fontified t face (rainbow-delimiters-depth-1-face)) 24 33 (fontified t face font-lock-string-face) 33 34 (fontified t face (rainbow-delimiters-depth-1-face)) 34 36 (fontified t)) . 1) (undo-tree-id57 . -36)) nil (23090 44111 3437 582000) 0 nil]) ((3134 . 3135) (#(")" 0 1 (fontified nil face (rainbow-delimiters-depth-1-face))) . 3134) (3133 . 3134) (#(" " 0 1 (fontified nil)) . -3133) (3133 . 3134) (#(")" 0 1 (fontified nil face font-lock-string-face)) . -3133) (3133 . 3134) (#("'" 0 1 (fontified nil face font-lock-string-face)) . 3133) (3132 . 3133) (#(" " 0 1 (fontified nil)) . -3132) (3132 . 3133) (#("'" 0 1 (fontified nil face font-lock-string-face)) . -3132) (3129 . 3133) (3120 . 3129) (#("s" 0 1 (fontified t face font-lock-string-face)) . -3120) (undo-tree-id58 . -1) (#("h" 0 1 (fontified t face font-lock-string-face)) . -3121) (undo-tree-id59 . -1) 3122 (3119 . 3122) (3118 . 3120) (#("'" 0 1 (fontified nil face (rainbow-delimiters-depth-1-face))) . -3118) (3118 . 3119) (3117 . 3119) (#("(" 0 1 (fontified nil)) . -3117) (3097 . 3118) (3096 . 3097) 3071) nil (23090 44111 3451 790000) 0 nil]) ((3171 . 3172) (#(")" 0 1 (fontified nil face (rainbow-delimiters-depth-1-face))) . 3171) (3170 . 3171) (3164 . 3170) (#("'" 0 1 (fontified nil face font-lock-string-face)) . 3164) (3158 . 3164) (3157 . 3159) (#("'" 0 1 (fontified nil face (rainbow-delimiters-depth-1-face))) . -3157) (3157 . 3158) (3156 . 3158) (#("(" 0 1 (fontified nil)) . -3156) (3149 . 3157) (3148 . 3149) (t 23089 29287 190301 357000) 3117) nil (23090 44111 3457 521000) 0 nil]) nil nil (23090 44111 3459 105000) 0 nil] #1# 2687 4 nil]
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
.*.*\~
53 changes: 52 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,53 @@
# Ponz.io
Building Ponz.io, with its endearingly upside-down-triangle-shaped business model.

Ponz.io is a sample social networking app, and totally not a ponzi scheme, which lets users track how many other people they have signed up or "ponzverted".

1. Clone this repo. Running the following command from the terminal should accomplish this:

git clone https://github.com/GeneTinderholm/project_ponz

2. Install modules. This can be done by running the following command from the terminal inside the main project folder:

npm i

3. Install mongodb.

Optional step: If you wish to use the store functionality, you must create a database of objects to buy with your "Ponz Pointz". I have included an initial package of cereal images to help you get started.

4. Run the app. This can be done by running the following command from the terminal inside the main project folder:

node app.js

5. Navigate to [http://localhost:3000](http://localhost:3000) in your browser.

If you are not logged in, you will be greeted with a log in page. Input your name and password and click the "Log In" button. If you do not have an account, click the "Or Sign Up" link. Then input the desired name and password and click the "Sign Up" button. Then log in as normal.

You should be greeted with a page that looks like the following:

![Main](https://github.com/GeneTinderholm/project_ponz/blob/master/images/main.png?raw=true)

On top is your referal link. Anyone who signs up with this link will be credited to your account.

Below that is a tree of your "Ponzverts" as well as those that your Ponzverts have Ponzverted.

It should look something like:

![Tree](https://github.com/GeneTinderholm/project_ponz/blob/master/images/ponzTree.png?raw=true)

Beside the name of each person is a green badge representing how many Ponz Pointz were credited to your account when they signed up.

Below the tree is the "Pyramid of Opportunity". The top level represents you. The second level represents those you have directly ponzverted. The third level represents those that your Ponzverts have ponzverted and so on. It will continue to grow as new members join your network.

It should look something like:

![Pyramid](https://github.com/GeneTinderholm/project_ponz/blob/master/images/pyramid.png?raw=true)

#####Optional Content

If you set up a database of items to purchase, you can use your Ponz Points to buy items from the integrated store. There is no way to return items, spent Ponz Pointz are gone forever so be careful.

If it is set up, it will look something like this:

![Shop](https://github.com/GeneTinderholm/project_ponz/blob/master/images/cereal.png?raw=true)

Clicking the blue "Buy" button will, if you have enough points, spend your points and display a humorous message.
Loading