Code Monkey home page Code Monkey logo

fairmanager's Introduction

fair-manager

Build Status Dependency Status

Welcome to FairManager, an administrative service to handle and manage companies, events, user and much more for your event!

To add new views

See the example folder: https://github.com/apals/FairManager/tree/master/client/app/edit-partner

In order to add a new view in the front-end, do the following

  1. Create a folder with the view-name in client/app/

  2. In this folder, create 3 files: the .html-file, the .controller.js (with the naming convention) file, and a .js file

  3. The .js file should contain the route logic, see for example https://github.com/apals/FairManager/blob/master/client/app/edit-partner/edit-partner.js authenticate: admin also restricts the routes to users with administrator-access. See possible roles in client/app/app.constant.js

  4. If you want to add this to the navbar in the top, find navbar.controller.js in client/components/navbar and add it to the menu-list. If you want to add to the right-hand side of the navbar, add it in the navbar.html file.

what the generator did and what it didn't

An example project generated with the generator can be found here: https://github.com/DaftMonk/fullstack-demo

  • The generator generated an example project for us, with some functionality.

  • We did not implement authentication logic ourselves, seeing as that's pretty frowned upon generally. Chances are we'd implement security badly and/or incorrectly.

  • The navbar came with the generator.

  • The view that was generated for us was only a list of strings. These strings were synced between clients through sockets, so we used that example code to help us create our own client synchronization.

  • Everything else was built by us. That means every edit-view, every view where you add new entries, every detail view, etc.

Addressing critique

  • A LOT OF FILES, we have many files in the root of the project for many different reasons, including

    • .jscrc, .editorconfig - for maintaining consistent coding styles in the project
    • karma.conf.js, mocha.conf.js, protractor.conf.js - for configuring test environments
    • .travis.yml - for continous integration and automatic deploy
    • Procfile - declaring how Heroku should start our application from the project root
    • Gruntfile - configuration file for building the project
    • e2e folder - contains end-to-end tests
    • iOS - contains iOS application
    • website - contains code for http://alsing.me/fairmanager
  • In client/app folder we have one folder for every view, and a folder for angular services.

  • The overview-directive (https://github.com/apals/FairManager/tree/master/client/app/overview) eliminates code-duplication from the lists (e.g. in /companies, /events etc). However, when adding new items eg. events, exhibitors, we need similar code in different places because they have different inputs. E.g. an event has date-input fields, whereas an exhibitor has multiple image-upload fields etc.

Clarification is required. Files are not structured well, however, code are divided well but a lot of code repetition exist, hence request of clarification.

Screenshots

Splash screen

Launcher screenshot

Events

Events screenshot     Armada event screenshot Armada event chat screen screenshot "Global" map for maps

Exhibitors

Exhibitors Exhibitor search Spotify exhibitor

Personnel

Personnel

Partners

Partners

Chat

Chat

Generating tool

The projects folder structure, the client-side testing suite and the authentication process was generated with the Angular Full-Stack Generator, version 3.3.0.

Getting Started

Prerequisites

  • Git
  • Node.js and npm (Node v4.2.3 or higher and npm v2.14.7 or higher)
  • Bower (npm install --global bower)
  • Ruby (Ruby v2.2.2 or higher)
  • Sass (gem install sass)
  • Grunt (npm install --global grunt-cli)
  • MongoDB - In case you want to test integrations, keep a running daemon with mongod

Developing

  1. Clone the repository using git clone [email protected]:apals/FairManager.git and enter the directory where it was cloned.

  2. Run npm install to install server dependencies.

  3. Run bower install to install front-end dependencies.

  4. Run mongod in a separate shell to keep an instance of the MongoDB Daemon running

  5. Run grunt serve to start the development server. It should automatically open the client in your browser when ready.

Build & development

Run grunt build for building and grunt serve for preview.

Testing

  • Running npm test will run the unit tests with karma.
  • Running grunt mochaTest will run the remaining integration and unit tests with karma.

fairmanager's People

Contributors

apals avatar oalsing avatar mheine avatar

Stargazers

 avatar  avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

fairmanager's Issues

Validate input in Admin panel

Currently possible to create undefined admins - if any of the the three fields are empty, creating of the account should not be allowed

fix if only upload logo OR banner, not both.

`
if ($scope.companyLogo && $scope.companyBanner) {

..do upload
} else if($scope.companyLogo) {
... do upload of that
} else if ($scope.companyBanenr) {
... upload that
} else {
... do companyservice.$save(..)
}
`

font-awesome broken on deploy

try grunt serve:dist for reproducing. font-awesome gets shredded by grunt wait maybe this does not wokr. it does not work on grunt buildcontrol:heroku

Make detailview look pretty

Right now it says

endTime:
startTime
websiteUrl
etc as the keys. does not look very good. we could just do like split on capital letter and make space??? if we wanna like do it that way. for this to work everything needs camelcase in backend (as of right now this is what it looks like)

that way endTIme -> End Time = right???

routes defined many times

`

'use strict';

angular.module('fairManagerApp')
.config(function ($routeProvider) {
$routeProvider
.when('/companies/new', {
templateUrl: 'app/new-company/new-company.html',
controller: 'NewCompanyCtrl',
controllerAs: 'newCompany'
})
.when('/companies/:id', {
templateUrl: 'app/company-detail/company-detail.html',
controller: 'CompanyDetailCtrl'
});
});

Make detailview look pretty

Right now it says

endTime:
startTime
websiteUrl
etc as the keys. does not look very good. we could just do like split on capital letter and make space??? if we wanna like do it that way. for this to work everything needs camelcase in backend (as of right now this is what it looks like).

that way endTIme -> End Time = right???

or like a helt annat sätt. om ni har nå najs ideer kör ba

Create owner roler -> Admin

Owner can create admins
Admins can add users without admin access
Admins can remove other admins
Admins can not remove Owner

Karma tests

Vill vi ha tester i den slutgiltiga versionen?

Fix form for user creation

make look nicer. Also, local should be the only possible provider. vet ej varför det ens finns alternativ.

borde bara vara name email pw

create folders

instead of having
/app/events
/app/new-event
/app/edit-event
/app/companies
/app/new-company

etc

do

/app/events/
/app/companies/

Secure API

Secure POST-requests to all endpoints. do like this:


'use strict';

import {Router} from 'express';
import * as controller from './user.controller';
import * as auth from '../../auth/auth.service';

var router = new Router();

router.get('/', auth.hasRole('admin'), controller.index);
router.delete('/:id', auth.hasRole('admin'), controller.destroy);
router.get('/me', auth.isAuthenticated(), controller.me);
router.put('/:id/password', auth.isAuthenticated(), controller.changePassword);
router.get('/:id', auth.isAuthenticated(), controller.show);
router.post('/', controller.create);

export default router;

`

Optimize deploy

  • set git clone depth 1
  • cache node_modules and bower_components

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.