-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] Move to dedicated documentation site (#155)
* npx docusaurus-init * Add .gitignore * Move docker-compose.yml inside website * Run on port 4000 * Add .prettierrc * Edit naming config * Add doc files * More content * Update config * Remove blog posts * Reword * Add favicon * Add API Usage * Add travis integration * Add api usage link to footer * Reference website from readme * Improve link contrast with body text * Content updates * Improve homepage features * Switch to master as default
- Loading branch information
Showing
46 changed files
with
1,612 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*/node_modules | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"trailingComma": "es5", | ||
"semi": true, | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Oops, something went wrong.