Skip to content

Commit

Permalink
Fix Automattic/mongoose#5574 , add nodemon and improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jrichardsz committed Nov 10, 2018
1 parent 4a4ea65 commit 5549440
Show file tree
Hide file tree
Showing 4 changed files with 2,309 additions and 68 deletions.
43 changes: 42 additions & 1 deletion README.md
Expand Up @@ -10,4 +10,45 @@
## Some stuff that I will add later
* Ability for the employees to search for their names
* Some administrative work route. for the manager
* Data visualizations using d3.js (bar, charts, heat maps, nodes) etc. d3.js remains the best in-browser data visualization library.
* Data visualizations using d3.js (bar, charts, heat maps, nodes) etc. d3.js remains the best in-browser data visualization library.


## Requirements

- Node.js
- Mongo (You can follow this guide to get mongo with docker https://gist.github.com/jrichardsz/3f5ab6cffb2a4393fda331315469ad83)

## Getting started

- start a mongo database process

- expose environment variables
```
export DATABASE=localhost
export port=9000
export SECRET=1e1df736
```
- install libraries
```
npm install
```
- start in dev mode
```
npm run dev
```

- You must see this log:

```
Server is up and running
Connection to database was succesful
```

Other logs could be indicate an error.


## Home Page

Point your browser at http://localhost:9000 and you will be see something like:

![demo](https://image.ibb.co/jK6WaA/demo.gif)
14 changes: 8 additions & 6 deletions models/user.js
Expand Up @@ -2,7 +2,7 @@ const mongoose = require('mongoose');
mongoose.Promise = global.Promise;
const userSchema = new mongoose.Schema({
name:{
type:String,
type:String,
required:'You must supply a name',
trim:true
},
Expand All @@ -13,17 +13,19 @@ const userSchema = new mongoose.Schema({
default:Date.now,
},
entry:{type:Date},
exit:{
exit:{
time:{
type:Date
},
// 1 - General
// 2 - Vacation
// 3 - Doctor
reason:Number
}
reason:Number
}

}]
}, {
usePushEach: true
})

module.exports = mongoose.model('User',userSchema);
module.exports = mongoose.model('User',userSchema);

0 comments on commit 5549440

Please sign in to comment.