Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Move to dedicated documentation site #155

Merged
merged 20 commits into from
May 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*/node_modules
*.log
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"trailingComma": "es5",
"semi": true,
"singleQuote": true
}
9 changes: 8 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
language: ruby
cache: bundler
cache:
bundler: true
yarn: true
sudo: false
bundler_args: --path vendor --local --without development
env:
Expand All @@ -15,3 +17,8 @@ script:
addons:
code_climate:
repo_token: 702251f0d6eb1f569078a27c4ae3366b1e48c4c6d7e4dd3ae0ca3583fd2bc8db
deploy:
provider: script
script: bash website/travis-deploy.sh
on:
branch: master
10 changes: 10 additions & 0 deletions Dockerfile-website
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:8.11.4

WORKDIR /app/website

EXPOSE 4000 35729
COPY ./docs /app/docs
COPY ./website /app/website
RUN yarn install

CMD ["yarn", "start"]
28 changes: 6 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

An all-in-one platform for managing hackathon registration & logistics, originally developed for [BrickHack](https://github.com/codeRIT/brickhack.io).

Read more at **[coderit.org/hackathon-manager/](https://coderit.org/hackathon-manager/)**

- **Hacker applications:** Enable hackers to apply to your hackathon while providing all relevant information (contact info, school, demographics, etc)
- **MyMLH support:** Streamline the application process when users log in with [MyMLH](https://my.mlh.io/), a common platform for applying to any MLH hackathon. Basic info is pre-filled based on a common application, so hackers don't have to re-type it every time.
- **Admissions & RSVPs**: Facilitate accepting hackers to your hackathon & enable them to RSVP
Expand Down Expand Up @@ -35,34 +37,16 @@ HackathonManager makes use of a few different third-party services & Ruby gems:
- [Blazer](https://github.com/ankane/blazer) (custom SQL queries, analytics, and charts)
- [Doorkeeper](https://github.com/doorkeeper-gem/doorkeeper) (authentication via OAuth for API usage)

See [Deployment](#Deployment) for instructions to deploy.

### Customization

Be sure to review all of these before going live!

- **Content**: Various settings are available at http://your-site/manage/configs
- **Emails**: Default automated emails are loaded into http://your-site/manage/messages
- **Styling**: Custom styling is not yet supported, but should be available starting Summer 2019.

## Deployment
## Get Started

HackathonManager supports two platforms out of the box:

- [Heroku](https://www.heroku.com) — Easiest & quickest way that requires little server knowledge, however isn't cheap (free tier not recommended)
- [Dokku](http://dokku.viewdocs.io/dokku/) — A free alternative to Heroku, runs on your own virtual machine
- [OKD/OpenShift](https://www.okd.io) — "Enterprise Kubernetes for Developers" packaged with a useful management UI + tooling

See the platform-specific guides [on the Wiki](https://github.com/codeRIT/hackathon_manager/wiki) to get started!

HackathonManager can also be deployed the same as any other Rails app, however this is **not** natively supported and will require you to fork this repo to integrate code changes.

[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
**[Deploy HackathonManager for your hackathon »](https://coderit.org/hackathon-manager/docs/deployment)**

## Contributing

GitHub issues and pull requests welcome!

If there's a new feature you're looking to implement, **please** file an issue to open discussion on the feature before starting work or opening a pull request.

## Development

Pre-requisite: Have a functioning, local Ruby + MySQL development environment. [See this guide for pointers.](https://gorails.com/setup)
Expand Down
89 changes: 89 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
id: api
title: API Usage
---

Almost all of the functionality exposed to users can also be accessed as an API with OAuth credentials. This includes both public- and management-facing functionality.

**Please note:** HackathonManager's primary audience is the web interface.

While functionality may co-exist for both browser and API usage, API-style support might be a little rough around some edges. If you stumble upon something that works a little different than usual (e.g. returns HTML instead of JSON), open an issue and we can figure it out.

## Endpoints

Endpoints are shared with regular page controllers for browser-style functionality. This leverages Ruby on Rails routing (for a deep dive, see [Rails Routing from the Outside In](https://guides.rubyonrails.org/routing.html)).

For example, listing bus lists:

- User-facing page: https://apply.brickhack.io/manage/bus_lists
- API endpoint: https://apply.brickhack.io/manage/bus_lists.json

Because Rails follows a standard CRUD-format, these endpoints become very REST-like.

For example:

- List all tags: `GET https://apply.brickhack.io/manage/trackable_tags.json`
- View specific tag: `GET https://apply.brickhack.io/manage/trackable_tags/1.json`
- Create tag: `POST https://apply.brickhack.io/manage/trackable_tags.json` (with a JSON body of parameters)
- Update tag: `PATCH https://apply.brickhack.io/manage/trackable_tags/1.json` (with a JSON body of parameters)
- Delete tag: `DELETE https://apply.brickhack.io/manage/trackable_tags/1.json`

For a full list of endpoints, run `bin/rails routes` locally. This utility, provided by Ruby on Rails, lists all possible paths you can route too (along with their respective HTTP method).

**Note: datatable endpoints** are highly coupled to [Datatables](https://datatables.net) functionality and are not easy to use.

Example for questionnaire management endpoints:

```
...
Prefix Verb URI Pattern Controller#Action
datatable_manage_questionnaires POST /manage/questionnaires/datatable(.:format) manage/questionnaires#datatable
check_in_manage_questionnaire PATCH /manage/questionnaires/:id/check_in(.:format) manage/questionnaires#check_in
convert_to_admin_manage_questionnaire PATCH /manage/questionnaires/:id/convert_to_admin(.:format) manage/questionnaires#convert_to_admin
update_acc_status_manage_questionnaire PATCH /manage/questionnaires/:id/update_acc_status(.:format) manage/questionnaires#update_acc_status
bulk_apply_manage_questionnaires PATCH /manage/questionnaires/bulk_apply(.:format) manage/questionnaires#bulk_apply
message_events_manage_questionnaire GET /manage/questionnaires/:id/message_events(.:format) manage/questionnaires#message_events
manage_questionnaires GET /manage/questionnaires(.:format) manage/questionnaires#index
POST /manage/questionnaires(.:format) manage/questionnaires#create
new_manage_questionnaire GET /manage/questionnaires/new(.:format) manage/questionnaires#new
edit_manage_questionnaire GET /manage/questionnaires/:id/edit(.:format) manage/questionnaires#edit
manage_questionnaire GET /manage/questionnaires/:id(.:format) manage/questionnaires#show
PATCH /manage/questionnaires/:id(.:format) manage/questionnaires#update
PUT /manage/questionnaires/:id(.:format) manage/questionnaires#update
DELETE /manage/questionnaires/:id(.:format) manage/questionnaires#destroy
datatable_manage_checkins POST /manage/checkins/datatable(.:format)
...
```

## Request & response

Most endpoints can operate with JSON requests & responses. Simply provide `.json` at the end of the URL to be returned JSON, and provide `Content-Type: application/json` when using POST or PATCH with a JSON body.

Note that while most endpoints support JSON responses, some do not have this support. Redirect responses are common for some actions, for which you'll receive a 302 redirect response and no JSON body.

The best way to see what's expected is to look at the controller source code, located at [`app/controllers/`](https://github.com/codeRIT/hackathon_manager/tree/master/app/controllers). Here, you'll see how each endpoint is configured; this maps to the routes listed by `bin/rails routes`. For example:

```ruby
def show
respond_with(:manage, @questionnaire)
end
```

- This "show" endpoint is the natural mapping for something like `GET /manage/questionnaires/1.json`
- Because `respond_with` is used, it will return JSON when `.json` is used in the URL

# Authentication

Authentication is implemented with OAauth 2, provided by the [Doorkeeper](https://github.com/doorkeeper-gem/doorkeeper) gem.

An OAuth app should be created by an admin at https://apply.your-hackathon.com/oauth/applications. From there, you can implement a standard OAuth 2 flow.

For Doorkeeper endpoints + docs, see https://github.com/doorkeeper-gem/doorkeeper/wiki/API-endpoint-descriptions-and-examples

Once appropriate authentication credentials are retrieved, they should be provided on all API requests.

### Security note

For a mobile- or front-end app, or any app that has API calls running on the client, you should **not** use an authorization flow involving the application secret; otherwise, you would be distributing the secret to the public, compromising the whitelist nature of controlling which apps may pose as your users.

For most use cases, the **authorization code grant** or **implicit grant** flows should be used. Check out [this guide by Auth0](https://auth0.com/docs/api-auth/which-oauth-flow-to-use) for more info.
Binary file added docs/assets/bus-sign-up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/promote-bus-captain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/questionnaire.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions docs/busses.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
id: busses
title: Busses
sidebar_label: Busses
---

HackathonManager enables you to facilitate bus sign-ups for attendees during the RSVP process.

## Attendee sign-ups

**Attendees can sign up for any available bus list.** This is presented to them during the RSVP process.

By signing up, they reserve one spot on the bus. If a bus fills up, no more attendees will be able to sign up for that bus.

![Screenshot from attendee perspective for signing up for a bus](assets/bus-sign-up.png)

## Bus Captains

Passengers can volunteer to be a captain when signing up for a bus.

Bus captains:

- Have their name, email, and phone number shared with bus passengers
- Can see the full passenger list for their bus
- Can mark passengers as boarded during boarding (mobile-friendly)

### Promoting a passenger to captain status

Any passenger can be promoted to a captain, even if they didn't volunteer (e.g, you've reached out to them directly).

You'll see the option to promote a passenger to being a bus captain, as well as a separate section specifically for people that have volunteered to be captains.

**Upon making someone a captain:**

- Their name, email, and phone number will be visible to passengers
- The new captain will receive an email notification ([this is the default template](https://github.com/codeRIT/hackathon_manager/blob/master/app/views/mailer/bus_captain_confirmation_email.html.erb))

![Screenshot of list of users with link to promote to bus captain status](assets/promote-bus-captain.png)

### Boarding flow for bus captains

The day of your hackathon, bus captains will need to know who is allowed on the bus, and mark those that have boarded.

Bus captains should open https://your-hackathon.com/bus_list and sign in. From there, they can view the entire list of passengers.

Tapping/clicking on the checkbox next to each name will mark that passenger as boarded/not boarded.

Example email to a bus captain:

```
Hey [name],

Thanks again for volunteering to be a bus captain! [HackFoo]'s bus to [location] would not be possible without your help, and we greatly appreciate it.

As a bus captain, you are in charge of who does and does not board the bus. It's incredibly important that **only people who are on the registered passenger list may board.** Not only could an extra person take someone else's seat, but they may not have been accepted to the hackathon and/or have not signed proper liability waivers.

To help with this, open https://your-hackathon.com/bus_list on your phone. From there, your bus's full passenger list is shown.

As people board, **tap on the checkbox next to their name** (including yourself). This will mark them as boarded, and will update your "boarded" count for an easy head-count. Once everyone has boarded, do a quick head-count on the bus to make sure these numbers match up.

If you have any questions day-of, don't hesitate to call or text me at [your cell phone number].

Hope to see you soon!

- [your name]
[your email]
[your cell phone number]
```
18 changes: 18 additions & 0 deletions docs/customization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
id: customization
title: Customization
---

Be sure to review all of these before going live!

## Content

Various settings are available at http://your-site/manage/configs

## Emails

Default automated emails are loaded into http://your-site/manage/messages

## Styling

Custom styling is not yet supported, but should be available starting Summer 2019.
Loading