Main Avalanche Network server application. Built with Ruby on Rails.

James Peret: 17f6e035c2 Mission end_time trigger преди 10 години
app 17f6e035c2 Mission end_time trigger преди 10 години
bin def60a0d18 Initial Commit преди 10 години
config c856e048ff Launch mission buttom преди 10 години
db a6069a5fa3 Lots of layout fixes преди 10 години
features 6d824d5e47 New start page and tests suite fix преди 10 години
lib 21d338e40d Changing rake resque job for Heroku compatibility преди 10 години
public 6265b3ce33 Added font custom, generated avalanche_icons and precompiled assets преди 10 години
script dbf9621e94 Cucumber testing suite ininitialized with first scenario преди 10 години
spec 82f1b72319 Upload Image bg processing with carrierwave_backgrounder and testing преди 10 години
test 572447eb40 Mission validation models scafolding and agent details steps layout преди 10 години
vendor def60a0d18 Initial Commit преди 10 години
.fontcustom-manifest.json 6265b3ce33 Added font custom, generated avalanche_icons and precompiled assets преди 10 години
.gitignore 6265b3ce33 Added font custom, generated avalanche_icons and precompiled assets преди 10 години
Gemfile ed98de1dad Layout improvements and bug fixes преди 10 години
Gemfile.lock ed98de1dad Layout improvements and bug fixes преди 10 години
Procfile d1fe9cab7f spawning another process inside the unicorn server преди 10 години
Rakefile c579b5d55b renamed rails project to Avalanche2 преди 10 години
config.ru def60a0d18 Initial Commit преди 10 години
dump.rdb 8712f6f4f0 Login and Signup page layouts преди 10 години
fontcustom.yml 6265b3ce33 Added font custom, generated avalanche_icons and precompiled assets преди 10 години
readme.md c856e048ff Launch mission buttom преди 10 години

readme.md

Avalanche Network (avalanche2)

Second prototype source code of the avalanche network web app.

Installation and Configurations

  1. Clone the project: https://github.com/jamesperet/rails_website_template.git
  2. Create a postgres databases for development and test enviorments.
  3. Configure the databases in config/database.yml
  4. Run rake db:migrate
  5. Run rake bootstrap:all to configure the website and create a admin user
  6. Create the file config/application.yml with all env variables
  7. Set the Google Analytics Tracking code in the file app/assets/javascript/google_analytics.js.coffe
  8. Start the server: rails server -p 3000
  9. Login as admin@website.com with the password 12345678

Deploy to Heroku

  1. Create a new heroku app: heroku create new-app-name
  2. Run figaro heroku:set -e production to copy env variables from config/application.yml and set them in heroku
  3. Add the heroku postgre addon: heroku addons:add heroku-postgresql to create and configure a postgres database in heroku server
  4. Add the heroku Redis to Go addon: heroku addons:add redistogo
  5. Push to heroku: git push heroku master to deploy the repo
  6. Migrate the database: heroku run rake db:migrate
  7. Create the initial config and admin user: heroku run rake bootstrap:all
  8. Add your website URL to the Mixpanel Partner program to earn 200,000 data points every month plus 25,000 people profiles.

Env Variables

AWS_ACCESS_KEY_ID:
AWS_SECRET_ACCESS_KEY: 
AWS_S3_BUCKET:
AWS_S3_BUCKET_REGION:
HEROKU_APP_URL: 
MANDRILL_USERNAME: 
MANDRILL_KEY: 
DOMAIN_NAME: 
SERVER_EMAIL: 
DEVISE_SECRET_KEY: 
SECRET_KEY_BASE: 
MAILCHIMP_KEY: 
MAILCHIMP_LIST_ID:
REDISTOGO_URL:

Avalanche2 Dev Notes

System Scaffolding


# Mission
rails g scaffold mission mission_agents:references title:string objective:string briefing:text owner:references status:integer launched:boolean 
language:string cover_img:string

# Mission Agents
rails g model mission_agent mission:references agent_steps:references mission_candidates:references objective:string briefing:text role:string 
description:text user:references agent_number:integer debriefing:text

# Mission Agent Steps
rails g model agent_step mission_agent:references step:integer title:string description:text completed:bool completed_date:datetime

# Mission Agent Candidates
rails g model mission_candidate user:reference mission_agent:reference status:integer

# Step Validations
rails g model step_validation agent_step:reference step_verifications:references mode:string description:string

# Step Verifications
rails g model step_verification step_validation:references validated:boolean validated_by:references content:string

# Validation Scaffolding
rails destroy model step_validation
rails destroy model step_verification
rails g migration AddStepSubmissionToAgentStep step_submissions:references

# Step Validation
rails g model step_validation agent_step:references validation_id:integer validation_type

# Text Validation
rails g model validation_text step_validation:references description

# Step Submission
rails g model step_submission agent_step:reference submission_contents:references validated:boolean validated_by:references date_validated:datetime

# Submission content
rails g model submission_content submission_content:references submission_id:integer submission_type

# Text Submission
rails g model submission_text submission_content:references content accepted:boolean validation:references

Undone Commands

# Reward Model
rails g model reward mission:references mission_agents:references title:string description:text img:string

rails g model user_reward reward:references received:boolean date_received:datetime

rails g model 

To dos

  • mission controller
  • agent controller
  • mission_list_controller
  • settings_controller
  • mission_list_index
  • agent_dashboard
  • mission_index
  • mission_show
  • mission_edit/create
  • emails:
    • pending missions (3-5 days pending steps)
    • Mission Acomplished
    • Mission Failed

Notes

Step Validation

Each agent_step has many associated classes for storing validation details, user generated content and verification signing.

  • agent_step
    • step_validations
      • validation_text
      • validation_image
      • validation_agent_position
      • validation_git_hooks
    • step_submissions
      • step_verification
      • submission_content
        • submission_text
        • submission_image
        • submission_agent_position
        • submission_git_hooks

Each step can have multiple step validations that are set by the mission director. Each step_validation can have one validation type like text, image or agent position. Every time an agent submits the information requested by the step_validations, a step_submission object is created with multiple sumission_content objects, one for each step_validation. The submission_content types can bem text, image or agent_position and they will store this information sent by the agent and process it.

The submission_content class is also responsible for triggering the automatic validation that some step_validations might have. If the validation requires an operator decision, than the step_submission will show up on the mission control panel for manual validation. If the step can be automatic validated, than the system will create a step_verification for the current submission.


Enviar imagens com os desenhos Enviar uma imagem para cada tela do app Espere a validação pelo diretor da missão