project-reports
v1.8.2
Published
project reports | reports at a glance
Downloads
15
Readme
PReports
project reports - create and manage weekly IT project reports
Try it! (development branch)
PReports project is based on MEAN stack: MongoDB, ExpressJS, AngularJS, NodeJS
##About
PReports (short for project reports) lets you write project reports (tailored for IT) in your browser on the fly. More information on the official homepage.
##Setup
###Dev ####Prerequisites Install
- NodeJS > 4.2.3
npm install -g bower grunt-cli
- Compass for SASS, needs Ruby
- MongoDB
Optional
npm install -g supervisor
####Run it
Check out development (or master for last stable) branch.
Make sure a mongo daemon is running on your local machine (or a remote machine)
CD into project root folder
Set up environment variables (see below)
RUN
npm install
RUN
supervisor app.js
(or node if you didn't install supervisor). This will fire up the backend and you should see something like this.Starting child process with 'node app.js' Watching directory '/Users/fred/Dev/preports/service' for changes. connect.multipart() will be removed in connect 3.0 visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives connect.limit() will be removed in connect 3.0 Initialize passport Authentication disabled Using MONGODB_DB_CONNECTION Connecting to mongo db: mongodb://localhost:27017/preports directory for upload: undefined Wed Jan 13 2016 20:36:00 GMT+0100 (CET): Node server started on undefined:3000 ... Connected to 'project report' database createIndexes: created index searchIndex_1
CD into client folder
RUN
npm install && bower install
(this will install the frontend dependencies)RUN
grunt serve
(This will fire up a webserver on port 9000 an show the UI.)... Running "connect:livereload" (connect) task Started connect web server on 0.0.0.0:9000. Running "watch" task Waiting...
Go and code... All changes should be picked up immediately.
visit http://localhost:9000
####Test it Backend
To run tests RUN npm test
in root folder. Make sure mongo is running. ATTENTION Will wipe your database!!!
Frontend
Protractor end to end tests.
- MongoDB and node backend must be up and running.
- Install webdriver-manager and protractor.
- RUN webdriver-manager start
- RUN grunt e2e-test
####Build it
To have a production build CD into client folder and execute grunt build --force
.
This creates a new minified UI build in /dist folder that gets served by the backend.
You can access the dist build via http://localhost:3000
Commit and push the "build" to your repository. Thats it.
###Production
####Standalone Install
- NodeJS > 4.2.3
npm install -g forever
(To run your script continously)- MongoDB preferably on another server
####Docker Install
- Docker obviously and docker-compose
- Tune env variables in docker-compose.yml to suite your needs
####Run it...
- Checkout the source with the latest UI dist build on your prod host
- CD into src root
- Adjust config and env variables
- RUN
npm install
- RUN
forever app.js
- or RUN
docker-compose up -d
when using docker
This may not be the best approach. One might want to check out Strongloop as a tool for node app building and deployment. Check out their post regarding best practices.
###Environment variables List of env variables needed to configure PReports.
| Variable | Values | Default | Required | | ------------- | :-------------: | :-------------: | -------------: | | NODE_ENV | e.g. development, production | development | no | | CONFIG_PATH | /path/to/external/config | none | no | | UPLOAD_DIR | /path/to/file/upload | USER_HOME/.preports | no |
###Configuration Config files reside under ./config/environment. Depending on the value of NODE_ENV the corresponding config is loaded.
###Directories
/auth - Authorization logic
/backup - Scripts for backups (experimental)
/client - UI src code
/components - Misc stuff
/config - configurations
/database - DB helper
/dist - Minified UI build
/preports-icon - icons
/routes - Backend core logic.
/specs - Backend tests
/views - Views rendered by express.js (not used currently)
##Release Notes > Release Notes
###License
MIT License (MIT)
Copyright (c) 2016 Frederik Reifschneider
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.