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: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: node_js
node_js:
- "stable"
before_install:
- cd server

9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# Event Manager https://travis-ci.org/travis-ci/travis-web.svg?branch=daily-cron
[![Build Status](https://travis-ci.org/faksam/EventManager.svg?branch=master)](https://travis-ci.org/faksam/EventManager) [![Maintainability](https://api.codeclimate.com/v1/badges/84ffad4f5752f58f4b45/maintainability)](https://codeclimate.com/github/faksam/EventManager/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/84ffad4f5752f58f4b45/test_coverage)](https://codeclimate.com/github/faksam/EventManager/test_coverage) [![Coverage Status](https://coveralls.io/repos/github/faksam/EventManager/badge.png?branch=master)](https://coveralls.io/github/faksam/EventManager?branch=master)

# Event Manager
Andela Pre-Bootcamp "Developer Challenge"

Given you manage an events center, this app will help you accept applications to use your center / facilities, and will either decline events when the proposed day is already taken, or suggest an available day
Create a Pivotal Tracker Board

# Install dependencies
npm install

# Serve at localhost:8000
npm run start:dev

### The client-side and server-side features are as follows:
- User signup and signin pages.
Expand Down
3 changes: 3 additions & 0 deletions server/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": [ "es2015" ]
}
48 changes: 41 additions & 7 deletions server/app.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@


const express = require('express');
const logger = require('morgan');
var path = require('path');
const bodyParser = require('body-parser');
// Set up the express app
const app = express();
require('babel-register');

//routes
var events = require('./routes/events');
var centers = require('./routes/centers');

// Log requests to the console.

// Set up the express app
const app = express();
//Start server
var port = 3456;
app.listen(port);
console.log("Listening on port : " + port);

// Log requests to the console.
app.use(logger('dev'));

// Parse incoming requests data (https://github.com/expressjs/body-parser)
Expand All @@ -22,7 +28,7 @@ app.use(bodyParser.urlencoded({ extended: false }));
// message: 'Welcome to the beginning of nothingness.',
//}));

app.use(express.static(path.join(__dirname, '../template')));
app.use(express.static(path.join(__dirname, '../template')));//remove ../ pass template ass
// Require static assets from template folder
app.use('../template', express.static(path.join(__dirname + '../template')));

Expand All @@ -34,10 +40,38 @@ app.set('view engine', 'html');
//app.set('view engine', 'ejs');

app.get('/', function (req, res) {
res.render('../template/index.html', { title: 'MyApp' });
res.render('/template/index.html', { title: 'MyApp' });
});

app.use('/centers', centers);
app.use('/events', events);


// catch 404 and forward to error handler
app.use(function (req, res, next) {
var err = new Error('Not Found');
err.status = 404;
next(err);
});

if (app.get('env') === 'development') {
app.use(function (err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: err
});
});
}

// production error handler
// no stacktraces leaked to user
app.use(function (err, req, res, next) {
res.status(err.status || 500);
res.render('error.', {
message: err.message,
error: {}
});
});

module.exports = app;
1 change: 1 addition & 0 deletions server/bin/www
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// This will be our application entry. We'll setup our server here.
const http = require('http');
require('babel-register');
const app = require('../app'); // The express app we just created

const port = parseInt(process.env.PORT, 10) || 8000;
Expand Down
136 changes: 136 additions & 0 deletions server/event-manager/center-events.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
{
"centers": [
{
"id": 1,
"name": "Civic Innovation Lab1",
"address": "II Wuse Road Abuja, Nigeria",
"capacity": 500,
"description": "It is a Civic kinda thingly",
"facilities": [
{
"projector": true,
"no-chairs": 650,
"video-overage": true
}
],
"events": [
{
"bookedBy": "",
"date": "",
"email": "",
"phone": ""
}
]
},
{
"id": 2,
"name": "Civic Innovation Lab2",
"address": "II Wuse Road Abuja, Nigeria",
"capacity": 500,
"description": "It is a Civic kinda thingly",
"facilities": [
{
"projector": true,
"no-chairs": 650,
"video-overage": true
}
],
"events": [
{
"bookedBy": "",
"date": "",
"email": "",
"phone": ""
}
]
},
{
"id": 3,
"name": "Civic Innovation Lab3",
"address": "II Wuse Road Abuja, Nigeria",
"capacity": 500,
"description": "It is a Civic kinda thingly",
"facilities": [
{
"projector": true,
"no-chairs": 650,
"video-overage": true
}
],
"events": [
{
"bookedBy": "",
"date": "",
"email": "",
"phone": ""
}
]
},
{
"id": 4,
"name": "Civic Innovation Lab4",
"address": "II Wuse Road Abuja, Nigeria",
"capacity": 500,
"description": "It is a Civic kinda thingly",
"facilities": [
{
"projector": true,
"no-chairs": 650,
"video-overage": true
}
],
"events": [
{
"bookedBy": "",
"date": "",
"email": "",
"phone": ""
}
]
},
{
"id": 5,
"name": "Civic Innovation Lab5",
"address": "II Wuse Road Abuja, Nigeria",
"capacity": 500,
"description": "It is a Civic kinda thingly",
"facilities": [
{
"projector": true,
"no-chairs": 650,
"video-overage": true
}
],
"events": [
{
"bookedBy": "",
"date": "",
"email": "",
"phone": ""
}
]
},
{
"id": 6,
"name": "Civic Innovation Lab6",
"address": "II Wuse Road Abuja, Nigeria",
"capacity": 500,
"description": "It is a Civic kinda thingly",
"facilities": [
{
"projector": true,
"no-chairs": 650,
"video-overage": true
}
],
"events": [
{
"bookedBy": "",
"date": "",
"email": "",
"phone": ""
}
]
}
]
}
110 changes: 109 additions & 1 deletion server/event-manager/centers.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,114 @@
"first_name": "John",
"last_name": "Smith",
"phone": "219-839-2819"
},
{
"id": 2,
"name": "Civic Innovation Lab2",
"address": "II Wuse Road Abuja, Nigeria",
"capacity": 500,
"description": "It is a Civic kinda thingly",
"facilities": [
{
"projector": true,
"no-chairs": 650,
"video-overage": true
}
],
"first_name": "John",
"last_name": "Smith",
"phone": "219-839-2819"
},
{
"id": 3,
"name": "Civic Innovation Lab3",
"address": "II Wuse Road Abuja, Nigeria",
"capacity": 500,
"description": "It is a Civic kinda thingly",
"facilities": [
{
"projector": true,
"no-chairs": 650,
"video-overage": true
}
],
"first_name": "John",
"last_name": "Smith",
"phone": "219-839-2819"
},
{
"id": 4,
"name": "Civic Innovation Lab4",
"address": "II Wuse Road Abuja, Nigeria",
"capacity": 500,
"description": "It is a Civic kinda thingly",
"facilities": [
{
"projector": true,
"no-chairs": 650,
"video-overage": true
}
],
"first_name": "John",
"last_name": "Smith",
"phone": "219-839-2819"
},
{
"id": 5,
"name": "Civic Innovation Lab5",
"address": "II Wuse Road Abuja, Nigeria",
"capacity": 500,
"description": "It is a Civic kinda thingly",
"facilities": [
{
"projector": true,
"no-chairs": 650,
"video-overage": true
}
],
"first_name": "John",
"last_name": "Smith",
"phone": "219-839-2819",
"events": {
"bookedBy": "fakunle samuel",
"date": "11/12/17",
"email": "[email protected]",
"phone": "0703924853"
}
},
{
"id": 6,
"name": "Civic Innovation Lab6",
"address": "II Wuse Road Abuja, Nigeria",
"capacity": 500,
"description": "It is a Civic kinda thingly",
"facilities": [
{
"projector": true,
"no-chairs": 650,
"video-overage": true
}
],
"first_name": "John",
"last_name": "Smith",
"phone": "219-839-2819"
},
{
"id": 7,
"name": "Civic Innovation Lab7",
"address": "II Wuse Road Abuja, Nigeria",
"capacity": 500,
"description": "It is a Civic kinda thingly",
"facilities": [
{
"projector": true,
"no-chairs": 650,
"video-overage": true
}
],
"first_name": "John",
"last_name": "Smith",
"phone": "219-839-2819"
}
]
}
}
Loading