Configure a Fresh Dev environment
If you have followed the instructions in the code base README you will have the following
A mongo database - all defaults and empty
node
vly2 codebase
npm run dev to start the server
see the landing page on http://localhost:3122
However, you won’t be able to do much except sign in as a volunteer. There will be no organisations, other people, activities or opportunities to play with.
So you need to setup your mongo database.
This page covers
Creating the first system administrator
Creating some organisations
Creating some test people
assigning membership.
The Voluntarily Organisation
Every new person added to the database gets added to the Voluntarily
organisation automatically. This confers a couple of abilities without which the person will be a bit hamstrung, so it makes sense to have it in place before you start adding people to your local environment. In particular, the organisation is both an opportunity provider and a volunteer provider. Being a part of it will allow your person to ask for help and offer to help. Otherwise they’ll get permission errors when trying to create opportunities.
The organisation could be created via the Mongo shell like so:
db.organisations.insert({
"imgUrl":"https://s3.ap-southeast-2.amazonaws.com/live.voluntarily.nz.images/1584929770643-vvvv200_full.png",
"role":["vp","op"],
"groups":["business","school","community","personal"],
"name":"Voluntarily"
});
Create a System Administrator
You will need a bunch of people you can give different roles to so you’ll need several email accounts.
We recommend using mailinator.com as a way to validate and check public emails, but you can also use any service you have access to with multiple inboxes. If you use Gmail another way to get multiple emails is to follow your usual email with +name e.g watkinsav+vp1@gmail.com. This might be easier but might also pollute your inbox.
You don’t need a login for mailinator - just enter the email address you’d like an inbox for.
Choose an email for the overall system administrator. e.g alice.admin@mailinator.com
Then goto your local voluntarily and sign in. At the Auth0 box switch to 'Sign Up' and enter the new email and password.
You will be signed in but see this account not verified message
Goto Mailinator and you should see an email in the inbox
Clicking verify leads to a confirmation message.
You can now close this window and return to Voluntarily.
Click the sign out and try again button. Go through the Auth0 Log In page with your new username and password and you will be back signed into Voluntarily.
Make yourself a system admin
Admins have all the powers. They can create new organisations, add people to those orgs, and view all data from API calls.
The one thing you can’t do through the UI is to create the first admin. To do that you’ll need to use a command-line script. make-admin
This script takes an email address and if that matches a person record in the database it will give them the “admin” role.
$ node x/db/make-admin.js jane.admin@mailinator.com
see for more info x/db/make-admin.js (Give a person the "admin" role)
Now sign out and sign in again. If you view your profile http://localhost:3122/home?tab=profile you should see your new person listed as an admin.
You will see under the footer a special Admin menu
Load the Goals into the database
Goals are actions we allocate to volunteers and others as they progress through the system. Each goal card is a database entry describing the activity and how to complete it. As these are database entries they have to be initialised before you create any further people.
Navigate to http://localhost:3122/admin/goals
Click the Load Goals Button
This will load the set of goals in the codebase goal.init.js into the goals collection. If you want you can also allocate some initial goals to your new person by locating the group you want and clicking assign me to this group
Now if you go to your home page you’ll see these initial goals. It's a good idea to now fill in your profile with some more details and a picture so you can easily recognise your Admin person.
Create some more People
Before we go further you’ll need to create a bunch of different logins that you can assign different roles to. Note that as we create these names in Auth0 not your local system they need to be unique emails that you can recognise so prefix them with your own initials e.g avw_vp1@mailinator.com
two or more standard volunteers - vp1, vp2…
one or more teachers - op1, op2…
one activity provider - ap1
a volunteer org administrator - vpadmin1, vpadmin2
a school org administrator - opadmin1
an activity provider administrator - apadmin1
Plus any others you want to fill out the system such as mr_noshow who always refuses invitations.
You don’t need everyone straight away but it's quick to do.
Create some Organisations
As the admin you now need to create at least one organisation of each type
Volunteer provider - i.e. a business like Spark or Xero.
Activity provider - a group that can create new activities e.g. OMGTech or TEC.
Opportunity provider - e.g. a school.
We will do the first two manually and use the school-invite feature for the third.
Manually create the Volunteer Provider organisation
Navigate to the http://localhost:3122/orgs page - click the Organisations menu. Then click the New Organisation button.
Set the Organisation Category to Business.
Give your org a name e.g. Big Business Inc, a logo and fill in some information. Set the contact email to match your vpadmin person.
Don’t waste time finding pictures - use a service like Lorem Picsum that can generate a random picture for you.
https://picsum.photos/seed/picsum/200/300
Save the organisation.
Add members to the organisation
You’ll find it useful here to use incognito (Chrome) or private (Firefox) windows here so that you can login as multiple people separately.
There are two ways to get members into your organisation - by joining or inviting.
Joining - People visit your organisation page and click Join. They appear in the members list and you can approve them.
Inviting - you send out an email that contains a link that automatically makes that person a member when they sign in. - great for circulating around a mailing list.
The ‘invite members’ feature only works for OrgAdmins (not Admins) so we’ll follow the join path to get our first orgAdmin.Sign in using your vpadmin person.
Creating the OrgAdmin
Sign in using your vpadmin person
navigate to your org page
click Staff Signup
fill in any validation code - e.g your email
click Validate.
Switch to your Admin person
refresh the org page members tab.
You should see the join request
Click the Add Button - the person will move to the Members list
Click Make Admin - the person is now an orgAdmin for your business.
An org can have no admins, but once there is one there must always be at least one. This means that an orgAdmin can remove other orgAdmins but not themselves.
You can repeat this joining process with as many accounts as you wish.
Inviting some people
Sign in using your orgAdmin account e.g. jane_vpadmin
Click the Members tab. Fill in a short message and click Member.
You’ll notice there’s no place to enter a target email address. That's because this email will be sent to you to forward onto other people. The thinking here is that it allows the admin to use internal email circulation that Voluntarily doesn’t have access to.
You’ll receive an email containing a button.
Where will I find these emails?
In dev emails are sent to a test account at ethereal.email. https://ethereal.email/login sign in as emma.lockman76@ethereal.email, password: CzBhFBWqHqGkZVvDFH.
If preview is true in person.email.js the email sent will also be opened in your local browser window.
When clicked this takes a new person to sign up and joins them to the organisation.
You can sign out and click this multiple times to join several people.
You’re All Set for volunteers.
You now have a volunteer provider organisation, an admin and a bunch of volunteers. They are going to need something to do so we need to create some schools. But before that sign in as each volunteer and fill out their profile a bit - give them a picture and create some skills and interest tags.
Manually create the Activity Provider organisation
Repeat the above steps using the ap organisation, aporgadmin and apmember persons.
Once you have created an activity provider person, and added them to an activity provider organisation then they will have the power to create new activities. You’ll see the New Template button at the top of your home page. Again fill in some details for your activity provider org and people.
Once you have made a new template your opportunity provider person can use it to create a new opportunity based on that template - so now we need an opportunity provider - we are ready to create some schools.
Create a School (Opportunity Provider) using the school-invite feature
Sign in again as Admin. Navigate to http://localhost:3122/admin/invite-school
This form generates an invitation email to a school representative inviting them to join Voluntarily. It
Fill in your own email address and pick a school from the drop down list. If the list is empty, instructions for populating it can be found here: Setup the schools database .
Submit the form - you should get the email sent to the browser popup or ethereal.email. it won’t be sent to your actual email address as dev is not connected to a real mail server.
Sign out.
Click the button on the email - sign in with your opadmin person and your new school will be automatically created with you as the orgAdmin.
You can now continue as before adding members.
You’re All Set
Once you have created an op person, and added them to an op organisation then they will have the power to create new opportunities. You’ll see the New Request button at the top of your home page. You can either create an opportunity from scratch or base one on an Activity Template.
Create your first opportunity and then use your volunteers to get involved, invited and committed to your test event.