Skip to content
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
secrets.js
public
TODO.txt
prodServer
TODO.txt
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ This codebase has two criteria:
* DB Setup

I am sadly a WSL user (Yes, Windows, Subsystem, (for) Linux), so I can't run post-install pg-init scripts. So step 1 is make a new psql database named `meme-magic`. Thats it.
If you wanted a DB named whatever you want it to be named go to `server/db/db` and modify line 7's `const memeDB = WhateverYouWant`.

If you wanted a DB named whatever you want it to be named go to `serverES6/server/db/db` and modify line 7's `const memeDB = WhateverYouWant`.

* Secrets

Make a `secrets.js` file in the root directory. It should contain:
Make a `secrets.js` file in the `serverES6` directory. It should contain:

`export default {
SessionKey: 'WhateverYouWant'
Expand All @@ -34,24 +34,28 @@ That's it. Enjoy.
## Some Known Confusion

I have had some annoying experiences with socket leakage and Node. Until I get around to having Redis be a part of the backend to deal with enabling more than 25 sockets per Node instance - I have a mechanism set up to ensure each user (being a person) only gets 1 socket per IP. *This means that if you try to open two tabs of your project on the same machine - you get Rick Rolled away from my site.* To disable such beautiful functionality simply go to `./browser/sockets/index.js`. You will see some well commented code about a certain socket event named `KickTroll` - just change its behavior to anything else or remove it.

The only other one I can remember at present is the requirement to enter `y` or `n` on intialization of the DB to decide whether to force sync the DB. This too can easily be removed in the root directory `./app.js`:

```
const syncTruth = getYesNo(chalk.cyan('Rick, do you wanna get savage on this database? (Force Sync)'));

// If you want to disable this - change syncTruth to:
// If you want to disable this - change syncTruth to:
// const syncTruth = false : wont ever forceSync.
// or
// or
// const syncTruth = true : will always forceSync.

startDB(syncTruth)
.then(() => server.on('request', myServer))
.then(() => ioInit(server))
.catch(err => console.error(err))
.finally(() => server.listen(_Port, () => console.log(chalk.magenta(`Meme magic has begun on Port ${_Port}`))));
```

## Dev and Production Scripts

Use ```npm run dev``` while in development, which will run Webpack and Nodemon watchers. For production, use ```npm run build``` to build once with Webpack and Babel, then ```npm start``` to serve the built files.

## Tests

Tests are incoming.
Expand Down
3 changes: 0 additions & 3 deletions babelify.js

This file was deleted.

50 changes: 39 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
{
"name": "meme-magic",
"version": "0.0.1",
"description": "A medium sized back-end boiler plate, with very little done on the front.",
"main": "app.js",
"description": "An A-Frame, React, Redux front-end with Sessions, Websockets, SQL, and Authentication built into the backend.",
"main": "serverES6/index.js",
"scripts": {
"start": "webpack -w & nodemon --watch server -e js,html babelify.js"
"build": "webpack && babel serverES6 -d prodServer --presets es2015",
"start": "node prodServer",
"dev": "webpack -w & nodemon serverES6 --exec babel-node --presets es2015"
"postinstall": "node ./post-install.js"
},
"engines": {
"node": ">=7.0.0"
},
"author": "Eliot Szwajkowski",
"license": "ISC",
"email": "eliotpszw@gmail.com",
"license": "Apache-2.0",
"dependencies": {
"aframe": "^0.5.0",
"axios": "^0.15.3",
"babel": "^6.5.2",
"babel-core": "^6.18.2",
"babel-loader": "^6.2.8",
"babel": "^6.23.0",
"babel-cli": "^6.23.0",
"babel-core": "^6.23.1",
"babel-loader": "^6.3.2",
"babel-plugin-transform-object-rest-spread": "^6.20.2",
"babel-preset-es2015": "^6.18.0",
"babel-preset-react": "^6.16.0",
"babel-register": "^6.18.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-react": "^6.23.0",
"babel-register": "^6.23.0",
"bluebird": "^3.4.6",
"body-parser": "^1.15.2",
"chalk": "^1.1.3",
Expand Down Expand Up @@ -58,5 +66,25 @@
"standard": "^8.5.0",
"volleyball": "^1.4.1",
"webpack": "^1.13.3"
}
},
"devDependencies": {},
"repository": {
"type": "git",
"url": "git+https://github.com/leafoflegend/MemeMagic.git"
},
"keywords": [
"AFrame",
"React",
"Redux",
"Postgres",
"Sockets",
"Boiler",
"Plate",
"Sessions",
"Authentication"
],
"bugs": {
"url": "https://github.com/leafoflegend/MemeMagic/issues"
},
"homepage": "https://github.com/leafoflegend/MemeMagic#readme"
}
1 change: 1 addition & 0 deletions post-install.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.