Sever Side Application Zooop
- Requires an internet connection
- Install
MongoDB - Install
NodeandNPM(Node comes bundled with NPM) - Install
GIT - Run
$ npm i -g nodemon gulp-clito install and makegulpandnodemonglobally available - Clone the project
https://github.com/stephenoken/Zooop-Server.git
- Run
sudo mongodormongodto start the mongo server locally - cd into Zooop-Server and run
npm ito download project dependancies - Run
gulpor either the shell/bash scripts.
- Add a new git remote
herokuand assign this urlhttps://git.heroku.com/nameless-escarpment-38075.git - Push the master branch of your local copy to the master of the
herokuremote
- Atom Text Editor
- Sublime Text Editor
- Unix Terminal (with zsh)
- ESLint
The structure of the project:
.
├── Procfile
├── README.md
├── app
│ ├── controllers
│ │ ├── account.js
│ │ ├── adsController.js
│ │ ├── authentication.js
│ │ ├── client.js
│ │ ├── main.js
│ │ ├── product.js
│ │ └── retailer_product.js
│ ├── helpers
│ │ ├── catalogue.js
│ │ ├── cloud_messaging.js
│ │ ├── diggyBot.js
│ │ ├── master_product_helper.js
│ │ ├── password.js
│ │ └── req_body.js
│ ├── middleware
│ │ └── authentication.js
│ ├── models
│ │ ├── advertisment.js
│ │ ├── client.js
│ │ ├── master_product.js
│ │ ├── retailer_product.js
│ │ ├── schema.js
│ │ └── user.js
│ ├── routes
│ │ ├── advertisement.js
│ │ ├── api.js
│ │ ├── authentication.js
│ │ ├── client.js
│ │ ├── index.js
│ │ └── retailer_product.js
│ └── views
│ ├── addProduct.ejs
│ ├── dashboard.ejs
│ ├── index.ejs
│ └── login.ejs
├── config
│ ├── environments
│ │ ├── development.js
│ │ ├── production.js
│ │ └── test.js
│ ├── index.js
│ ├── models.js
│ ├── mongoose.js
│ ├── passport.js
│ ├── routes.js
│ ├── seed
│ │ ├── data
│ │ │ ├── products.js
│ │ │ └── user.js
│ │ └── seed_data.js
│ └── strategies
│ └── local.js
├── dist
│ ├── images
│ │ ├── Zooop-Logo.svg
│ │ ├── favicon.ico
│ │ └── header.jpg
│ ├── partials
│ │ └── components
│ │ ├── app.html
│ │ ├── create-ad.html
│ │ ├── home.html
│ │ ├── my-ads.html
│ │ ├── purch-advert.html
│ │ └── upload-catalogue.html
│ ├── scripts
│ │ ├── build.js
│ │ ├── build.js.map
│ │ └── vendor.js
│ └── stylesheets
│ ├── dashboard-styles.css
│ ├── index-styles.css
│ └── login-styles.css
├── gulp_tasks
│ ├── browserify.js
│ ├── public_tasks.js
│ ├── server.js
│ └── tests.js
├── gulpfile.js
├── package.json
├── public
│ ├── images
│ │ ├── Zooop-Logo.svg
│ │ ├── favicon.ico
│ │ └── header.jpg
│ ├── partials
│ │ └── components
│ │ ├── app.html
│ │ ├── create-ad.html
│ │ ├── home.html
│ │ ├── my-ads.html
│ │ ├── purch-advert.html
│ │ └── upload-catalogue.html
│ ├── scripts
│ │ ├── app.js
│ │ ├── build.js
│ │ ├── build.js.map
│ │ ├── components
│ │ │ ├── advertisement.js
│ │ │ ├── app.js
│ │ │ ├── createAd.js
│ │ │ ├── home.js
│ │ │ ├── index.js
│ │ │ ├── myAds.js
│ │ │ └── uploadCatalogue.js
│ │ └── controllers
│ │ ├── create_ad.js
│ │ ├── index.js
│ │ ├── my_ads.js
│ │ ├── ui
│ │ │ └── navbar_layout.js
│ │ └── upload_catalogue.js
│ ├── scss
│ │ ├── dashboard
│ │ │ └── base_styles.scss
│ │ ├── index
│ │ │ ├── base_styles.scss
│ │ │ └── material_styles.scss
│ │ └── login
│ │ └── base_styles.scss
│ ├── stylesheets
│ │ └── styles.css
│ └── vendor_scripts
│ ├── cbpAnimatedHeader.js
│ ├── classie.js
│ └── creative.js
├── server.js
├── tests
│ └── server
│ ├── fixtures
│ │ ├── advertisements.js
│ │ ├── clients.js
│ │ ├── routes_test_data.js
│ │ ├── sample_catalogue.txt
│ │ └── users.js
│ ├── integration
│ │ ├── advertisements.js
│ │ ├── api_routes.js
│ │ ├── authentication.js
│ │ ├── client.js
│ │ ├── discover_product_api.js
│ │ └── index_routes.js
│ └── unit_tests
│ ├── diggyBotTests.js
│ ├── helpers
│ │ ├── account.js
│ │ ├── catalogue.js
│ │ └── password.js
│ └── models
│ ├── advertisement.js
│ └── client.js
├── unix_deploy.sh
└── windowDeploy.bat
The file structure was created using tree -I 'node_modules'
- Build system for automating tasks
- Any tasks that you want to be run by default can be called here
- Any new tasks should be put into their own file and placed in the
gulp_tasksfolder.
- Contains all the static resources that are available to the client. Including the angular component
- All the processed resources are to be deposited here.
- Contains all the code that runs on the server side
- All routes that are to be made available should be placed here
- Files are are dynamically rendered using EJS before being sent to the client.
- Contains provides the business logic
- Contains the schemas for the mongoDB and the custom queries
- Contains the configuration for the server. Depending on the environment the server will load different configurations eg. connecting to a different mongoDB
- Tests for both the server and client should be placed here.
- The testing libraries being uses are:
- Mocha
- Chai
- Main hook for initialising our application
- This allows you to perform live reloading of the public resources and html files.
- Testing Express
- Ubuntu VM stuff
- Restful Methods
- Product schema is the master collection for every product
- Discover Product is schema is for the products maintained in various collections based on their origin/ethnicity
- If you've got tabs in your browser pointing to localhost:3000, close them when your finished as they keep trying to connect to port 5001