Skip to content
Permalink
Browse files

Create new project

  • Loading branch information...
nlaz committed Feb 25, 2019
0 parents commit 2203eaaba86179ef1293dadc2e704699a716e6d4
Showing with 167 additions and 0 deletions.
  1. +19 −0 .gitignore
  2. +19 −0 LICENSE
  3. +15 −0 README.md
  4. +17 −0 app/controllers/auth.js
  5. +9 −0 app/controllers/guides.js
  6. +9 −0 app/controllers/home.js
  7. +5 −0 app/controllers/index.js
  8. +18 −0 app/index.js
  9. +18 −0 app/routes.js
  10. +4 −0 config/index.js
  11. +18 −0 docs/CONDUCT.md
  12. +16 −0 package.json
@@ -0,0 +1,19 @@
node_modules
npm-debug.log
package-lock.json
yarn.lock

test
temp*

.env

.DS_Store
.AppleDouble
.LSOverride

### IDE Settings (EditorConfig/Sublime)
.editorconfig

### IDE Settings (VSCode)
.vscode
19 LICENSE
@@ -0,0 +1,19 @@
Copyright (c) 2019 Major League Hacking, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
@@ -0,0 +1,15 @@
# Introduction

This is a hackathon boilerplate for new Nodejs applications created by [Major League Hacking][mlh-github]. It is for hackers looking to get started quickly on a new hackathon project using the Nodejs environment.

# Code of Conduct

We enforce a Code of Conduct for all maintainers and contributors of this Guide. Read more in [CONDUCT.md][mlh-conduct].

# License

The Hackathon Starter Kit is open source software [licensed as MIT][mlh-license].

[mlh-github]: https://github.com/jekyll/jekyll/blob/master/CONDUCT.markdown
[mlh-conduct]: https://github.com/MLH/mlh-hackathon-nodejs-starter/blob/master/docs/CONDUCT.md
[mlh-license]: https://github.com/MLH/mlh-hackathon-nodejs-starter/blob/master/LICENSE.md
@@ -0,0 +1,17 @@
const express = require("express");

const router = express.Router();

router.get("/logout", function(req, res) {
// TODO
});

router.get("/login/github", function(req, res) {
// TODO
});

router.get("/callback/github", function(req, res) {
// TODO
});

module.exports = router;
@@ -0,0 +1,9 @@
const express = require("express");

const router = express.Router();

router.get("/requesting", function(req, res) {
// TODO
});

module.exports = router;
@@ -0,0 +1,9 @@
const express = require("express");

const router = express.Router();

router.get("/", function(req, res) {
// TODO
});

module.exports = router;
@@ -0,0 +1,5 @@
const auth = require("./auth");
const guides = require("./guides");
const home = require("./home");

module.exports = { auth, guides, home };
@@ -0,0 +1,18 @@
const express = require("express");
const bodyParser = require("body-parser");
const compression = require("compression");

const config = require("../config");
const { registerRoutes, registerErrorHandlers } = require("./routes");

const app = express();

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

registerRoutes(app);
registerErrorHandlers(app);

app.listen(config.port, () => {
console.log(`🚀 Server started on port ${config.port}.`);
});
@@ -0,0 +1,18 @@
const controllers = require("./controllers");
const config = require("../config");

module.exports.registerRoutes = app => {
app.use("/", controllers.home);
app.use("/auth", controllers.auth);
app.use("/guides", controllers.guide);
};

module.exports.registerErrorHandlers = app => {
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.render("error", {
message: err.message,
error: config.env === "development" ? err : {}
});
});
};
@@ -0,0 +1,4 @@
module.exports = {
port: process.env.PORT || 5000,
env: process.env.NODE_ENV || "development"
};
@@ -0,0 +1,18 @@
# Code of Conduct

All contributors and maintainers of this guide, in the interest of fostering an open and welcoming community, are required to adhere to the [Major League Hacking Code of Conduct][mlh-coc].

### Addendum for Open Source Projects

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to the [Major League Hacking Code of Conduct][mlh-coc], or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the [Code of Conduct][mlh-coc] may be permanently removed from the project team.

The [Major League Hacking Code of Conduct][mlh-coc] applies both within project spaces and in public spaces when an individual is representing the project or its community.

### Credits

Inspired by [Jekyll's Code of Conduct][jekyll-coc].

[mlh-coc]: https://github.com/MLH/mlh-policies/blob/master/code-of-conduct.md
[jekyll-coc]: https://github.com/jekyll/jekyll/blob/master/CONDUCT.markdown
@@ -0,0 +1,16 @@
{
"name": "mlh-hackathon-nodejs-starter",
"version": "0.1.0",
"description": "A hackathon starting point for new Nodejs applications",
"scripts": {
"start": "node app/index.js",
"deploy": "NODE_ENV=production node app/index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"body-parser": "^1.18.3",
"compression": "^1.7.3",
"dotenv": "^6.2.0",
"express": "^4.16.4"
}
}

0 comments on commit 2203eaa

Please sign in to comment.
You can’t perform that action at this time.