Code Monkey home page Code Monkey logo

se's Introduction

Guide to setting up your work environment for the website

Go to git and create a fork of the main repository
Copy your fork's url
Clone fork locally, wherever you want
Go to main repository and copy url
run 'git remote add upstream [paste url]'
run 'git remote -v' and check your urls are correct
follow [Site Setup] instructions to get the website running with node

Commit process

'git fetch upstream'
'git merge upstream/master'
you may have merge conflicts - resolve them as git instructs
'git add .'
'git commit -m "add whatever commit message is relevent you your additions here"'
'git push origin master'
go the the github repository online
create new pull request
select your fork
create pull request
type in the chat that you have created a pull request so someone else can check it for conficts and then merge it into the main branch

[Site Setup]

Install dependencies with npm install.

How to authenticate google api stuff:

Login to the group gmail account and find the service account created for the gmail account in the api dashboard. Make a new key for the service account, click save as json and store it in a new folder 'tokens' as 'private-key.json'.
Add the service account email to any calendars you want to use. (go to settings for the individual calendar)

How to authenticate paypal stuff:

Inside the tokens folder, make a file called paypalId.json with the following structure:

{ "clientId":"clientId_on_discord" }

And when testing the paypal transaction you can use the sandbox account login on discord

How to authenticate email: Add the file emailCredentials.json to tokens with structure: { "username":"ourgroupemail", "password":"ourgrouppassword" }

Using the form:

Enter a start and end time in the format specified, as well as a name for the event: If the time slot is valid, the paypal button will pop up. Pay using the sandbox account (it will transfer £0.01 of fake money) The page should refresh and the event should be visible with your name.

MONGO SETUP

TODO: check security on this if they actually use it because this was done quickly
  1. generate ssh keypair

  2. get someone to add your public key to the mongo server

  3. Bind the dig ocean server locally

ssh -L 4321:localhost:27017 [email protected] -f -N

if it stops working (hangs on npm start), restart the ssh -L (ps aux | grep 4321, kill the pids, run ^ again)

If it's really broken check that mongod is running on 206.18.... , if not mongod --fork --logpath ~/log/mongodb.log

For bash users: run ./start-tunnel to automatically connect to the database.

Keystone Facility Data Entry

  1. Go to images and upload images for the facility

How to add an automated facility:

  1. Go to facility and add the facility, make sure automated checkbox is ticked
  2. If there are any special options, go to facility options and add them.
  3. Go to facility prices and add entries, either with options or without. Make sure all posibilities are covered (e.g there is a 1hr price for every option at least)
  4. Go back to facility entry and scroll to the bottom, see if all the prices and options are shown. If not,you've messed up up

Manual Bookings

If the facility pricing structure is too complicated to automate

  1. Go to facility and add the facility, make sure the automated checkbox is not ticked.

se's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

se's Issues

Availability calendar doesn't update on weekends

On Astro Turf (I know the rest don't have availability data yet), if I switch my booking date on the form to the weekend, the availability calendar should change to the Saturday/Sunday availability. Currently it is static.
Related - #77

Block bookings

The client requested that they would like to be able to block book out certain facilities e.g. sports hall for exams. The system will require this functionality.

Pricing display bug

If I request a price to display on the frontend where the timespan is 5/6/(not sure if 7) hours, the pricing calculation should be capped at the up to 7 hours bracket, however the price just keeps on rising

Credentials in repo

SE/update has creds by accident. They need removing and the admin creds need changing.

Consider availability refactor

Consider putting availability data in a separate model.
Things to bare in mind:

  • Good database relationships vs usability.
  • A separate model will produce facility_number * days (~70) entries, though it can be sorted/searched.
  • 7 entries in each facility could also cluttering
  • Backend code would need changing

Whats On refactor

If an activity is deleted, the whats on pages (child/adult) have to activity link removed but not the times. This will cause a lot of problems in the future if PVCC choose to delete an activity.

Fix proposal:
Refactor the Activities model. Each activity will have the fields:

  • name
  • description
  • url
  • images
    updating consistency as mentioned in #69
  • times
    list where user can enter when it is on - day(s) of the week and corresponding time.

Orange colouring on site

The orange headings, horizontal rules etc should be changed to be more in line with pvcc.co.uk.

The orange was put on the prototype 1 WordPress but shouldn't have been.

Deployment

Need to ask Sarah?
Currently the website is on localhost, we "may" need to deploy to an actual domain.

Inconsistent image loading system

The facility image loading has been changed to use new keystone models etc, while events pages are not on this system.

There are images being stored in /public/uploads/img and /public/uploads

Edit/Delete Bookings

Currently there is no way to edit/delete a booking.

Proposed Fix
Convert bookings to be added to keystone db, where we can allow PVCC to use the admin UI to change these bookings.

Deletion of an event leaves times on the whats on calendar

When deleting an event from keystone, any references on the whats on calendar are left regarding the times. We need to either tell PVCC to remove times manually or catch the event in the keystone backend and remove them ourselves.

Twitter/Facebook IFrame Styling

The iframes on the homepages are currently not the same width and don't adapt well to different device sizes. They need to be styled appropriately.

Featured list

Featured list currently shows 3 fffa. Should be selectable by client/random

Nav bar font

Nav bar options are not aesthetic, see original site for comparison.

Perhaps smaller, un-emboldened upper case may look better, and a lighter shade.

Duplicate facility data

Currently there are two sections for facility price data, and 2 for availability as well.
These should be combined (get rid of user friendly/markdown one and pass the simple one on the front end).

System doesn't cover for non automated bookings

The client needs an interface to add a manual booking to the database, if they only use google calendar there is no easy way to check for a clash. This is due to the same calendar being used for multiple facilities.

Dealing with automated and bespoke bookings

Implementation for simple bookings (ie, the user books the whole facility with no bespoke options for a set time) works. However, the bespoke style bookings (ie with options, half/fractions of a facility) would be difficult to add to the database functionality given our limited time.

We could get around this by making the facilities with options fully non-automated.
The issue arises with how PVCC would interact with these non automated and automated bookings at the same time, as the automated bookings currently go onto a read only calendar which we don't want to mess around with. Furthermore, PVCC has to add all their bookings for automated facilities through our form, so they go into the DB and can be checked for clashes

Cookie secret

Keystone cookie secret is weak and stored in app.js
I'm not sure what it should be or where it should go.
Also please confirm that any other secrets are secure

Whats on styling

The whats on table needs to be styled, currently the entries can look squished (might only be on smaller devices).

Automated booking prices

Currently any transaction for a booking has the price of £0.01. The system needs to correctly calculate and charge the correct amount for a booking.

Availability Calander Function

The calandar availability function at the moment takes a facility name and a number of days and returns a list of event start and end times from the events calander from today to today + number of days.

It needs to

  • Fetch this data from the locks collection also.
  • Take a start date and end date (Date objects) as opposed to a number of days and return info in the same format between these dates.

Deletion of activities on whats on

If an activity is deleted, the whats on pages (child/adult) have to activity link removed but not the times. This will cause a lot of problems in the future if PVCC choose to delete an activity.

Fix proposal (to be done AFTER PROTOTYPE 2 PRESENTATION):
Refactor the models for Child Whats Ons, Adults Whats Ons and Activites into a single Activities model. Each activity will have the fields:

  • name
  • description
  • url
  • images
    updating consistency as mentioned in #69
  • type
    child/adult
  • times
    list where user can enter when it is on - day(s) of the week and corresponding time. If day is too hard to implement, we can split the activity model into 7 - one for each day of the week

App.js refactor

App.js is out of control (>450 lines so far)
Need to move stuff to different files, e.g. general routes, payment, db, keystone idk
I'm not sure what can be moved where though.

Non-dynamic events image loading

Unlike facilities images which are loaded dynamically, if the events carousel has < 3 images, it displays blank ones to make up the 3.

Hard to do a full fix because of inconsistent image loading: #69

Favicon Issues

Favicon does not display, and the following is printed in server console.

Error thrown for request: /favicon.ico
Error: Cannot find module 'ico'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.Module._load (internal/modules/cjs/loader.js:529:25)
at Module.require (internal/modules/cjs/loader.js:657:17)
at require (internal/modules/cjs/helpers.js:20:18)
at new View (/home/greg/SE/node_modules/express/lib/view.js:81:14)
at Function.render (/home/greg/SE/node_modules/express/lib/application.js:570:12)
at ServerResponse.render (/home/greg/SE/node_modules/express/lib/response.js:1008:7)
at module.exports (/home/greg/SE/routes/views/base.js:2:6)
at Layer.handle [as handle_request] (/home/greg/SE/node_modules/express/lib/router/layer.js:95:5)
at next (/home/greg/SE/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/greg/SE/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/greg/SE/node_modules/express/lib/router/layer.js:95:5)
at /home/greg/SE/node_modules/express/lib/router/index.js:281:22
at param (/home/greg/SE/node_modules/express/lib/router/index.js:354:14)
at param (/home/greg/SE/node_modules/express/lib/router/index.js:365:14)
at Function.process_params (/home/greg/SE/node_modules/express/lib/router/index.js:410:3)
GET /favicon.ico 500 8.089 ms

Equipment prices model error

Upon viewing any 'Equipment Price' in keystone, you get the following (non fatal) error:
Error: Related List Facilities has no field equipment

This is (likely) a problem with line 14 in /models/EquipmentPrice

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.