-
Notifications
You must be signed in to change notification settings - Fork 5
Developers Manual
#Code access You can find and download in the code page or by doing Fork
#Project code The code is managed on 'github' ,involving The MEAN Stack
#License
This code is open-source, under the copy rights of The MIT License (MIT) And "Azrieli - Jerusalem Collage of Engineering".
#Directory structure and files in the project
contains the functions that were built to provide certain functionality against the server and the DB
Files Included:
- mongo.js - Provides functions to do CRUD against the DB
- email.js - Provides functions to send emails
- auth.js - Provides functions to Authenticate the user and set his Roles
- acl.js - Access Control List - assign action id according to request route
- drive.js - managing files on the server's drive account, add/delete photos etc
- excel.js - import/export excel files
- middleware.js - server wide middlewares such as ensure user is authenticated, ensure user's permission etc.
- validation.js - validate routes params
contains the routing that links the Urls to the utils
Files Included:
- auth.js - Provides the routes to sign-up, login, account activation, forgot/change password, change email.
- chat.js - Provides the routes to get chat history according to chat id
- dataexchange.js - import and exporting data from database from/to excel files
- home.js - upload/delete ads from the home page
- photos.js - upload/delete photos from user profile, renovation page or home page image slider
- renovation.js - create/edit renovation, assign team, tasks/pinned messages/tools management
- statistics.js - get statistics on database data, such as volunteer hours, renovation costs etc.
- status.js - Get/Update the organization referrals status and message
- team.js - team management routes - create, edit, delete, assign manager, assign to renovation, add/remove members
- user.js - user management routes - delete user, approve sign-up, edit user, get all users/sign-ups
- brute.js - configures server protection from brute force attacks using
express-brute
- passport.js - configures server's user authentication using
PassportJS
- socketio.js - configures socketio to be using in chat
Access using process.env.[variable name]
- PORT - used by server host to determine the port the server will run on.
- EMAIL_ADDR - server's email account to be used to send email for sign-ups and password/email changes
- EMAIL_PASS - server's email account password
- MONGODB_URL - MongoDB url including account name and password, format:
mongodb://[account name]:[password]@[server address and port]/[database name]
- SESSION_SECRET - secret used to encrypt sessions
- GOOGLE_CLIENT_ID - client id from Google's API management
- GOOGLE_CLIENT_SECRET - client secret from Google's API management
- GOOGLE_CALLBACK - redirect to this route after Google OAuth authentication
- FACEBOOK_APP_ID - app id from Facebook's APP management
- FACEBOOK_APP_SECRET - app secret from Facebook's APP management
- FACEBOOK_CALLBACK - redirect to this route after Facebook OAuth authentication
- HOME
- HOMEPATH
- USERPROFILE
- guest
- volunteer
- team leader
- manager
- admin
Where 1. is the lowest in the hierarchy and 5 is the highest
contains the unit testing for the utils
Files Included:
- database.test.js : Provides the tests to the mongo.js , auth.js utils
- server.test.js : Provides the tests for the basic server functionality such loading express and vendor libraries
-
The first time you run the server, it will prompt you to authorize access:
a. Browse to the provided URL in your web browser. If you are not already logged into your Google account, you will be prompted to log in. If you are logged into multiple Google accounts, you will be asked to select one account to use for the authorization.
b. Click the Accept button.
c. Copy the code you're given, paste it into the command-line prompt, and press Enter.
You need to specify the album you want to add photos to
<photos album="[email protected]"></photos>
You need to specify the role "teamLead" can upload and delete photos
<photos-renovation album="[email protected]" role="teamLead"></photos-renovation>
- Make sure MongoDB server is running
- Setup your server environment variables as listed above
- Upload your Drive API files (
client_secret.json
&drive-nodejs-creds.json
) to your server - for more info click here - use
npm start
to start the server
-
npm run debug
run server with debug messages
For bugs you can open an issue through Issues board
Copyright (c) 2016 Netanel Draiman, Dan Draiman, Ihab Zhaika, Ruby Lichtenstien.