02-29-pair-project's Introduction
02-29-pair-project's People
02-29-pair-project's Issues
API
- Figure out how to use APIs
- Extract flight price from API query return
- Date formatting for next-day searches
- Set date and destination equal to variables for search
- Format API queries to work with our data
- Loop through all five destination options and save returns as variables
Users
- Create new users
- View all user page
- View individual users page
- Update info - set name, pass, budget
- Delete user
- Delete user's choices when user is deleted
- Add pre-filled values to edit user page
- Input validation
Clean up
- Re-check tomdocs
- Add error messages after validations
- Welcome page - add some links, ensure functionality.
- Double-check tests
- Log-in before hook
Destinations model reek correction
- [12, 12]:DuplicateMethodCall: Destination#set_errors calls self.airport_code 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
- [9, 9]:DuplicateMethodCall: Destination#set_errors calls self.name 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
- [1]:IrresponsibleModule: Destination has no descriptive comment [https://github.com/troessner/reek/blob/master/docs/Irresponsible-Module.md]
- [9]:NilCheck: Destination#set_errors performs a nil-check [https://github.com/troessner/reek/blob/master/docs/Nil-Check.md]
Log ins
- Login form
- Authenticate valid password
- Links from other pages to login form
- Logout feature
- write tests for CRUD methods
Users model reek correction
- [21, 21]:DuplicateMethodCall: User#set_errors calls self.budget 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
- [15, 15]:DuplicateMethodCall: User#set_errors calls self.email 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
- [9, 9]:DuplicateMethodCall: User#set_errors calls self.name 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
- [18, 18]:DuplicateMethodCall: User#set_errors calls self.password 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
- [12, 12]:DuplicateMethodCall: User#set_errors calls self.username 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
- [1]:IrresponsibleModule: User has no descriptive comment [https://github.com/troessner/reek/blob/master/docs/Irresponsible-Module.md]
- [9]:NilCheck: User#set_errors performs a nil-check [https://github.com/troessner/reek/blob/master/docs/Nil-Check.md]
- [1]:TooManyInstanceVariables: User has at least 11 instance variables [https://github.com/troessner/reek/blob/master/docs/Too-Many-Instance-Variables.md]
- [85]:TooManyStatements: User#get_price_array has approx 13 statements [https://github.com/troessner/reek/blob/master/docs/Too-Many-Statements.md]
Comparison algorithm
- Devise comparison algorithm
- Figure out how to display results
- Write tests
- TomDocs
Choices model reek correction
- [9, 9]:DuplicateMethodCall: Choice#set_errors calls self.destination_id 2 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
- [1]:IrresponsibleModule: Choice has no descriptive comment [https://github.com/troessner/reek/blob/master/docs/Irresponsible-Module.md]
- [9]:NilCheck: Choice#set_errors performs a nil-check [https://github.com/troessner/reek/blob/master/docs/Nil-Check.md]
Set up
- Wireframes - MVC rough
- Database Design - define_schema
Deploy!
Once you're at a reasonable break-point with your work so far. I'd like this done by 5pm at the latest.
Deploying means publishing. You've been hosting locally up until now. Deploying means publishing your code somewhere that is not local, so that the world can access it.
What's not local can be considered remote. So GitHub, for example, is a remote storage of your repo. To push to a remote using Git, you type git push [name of remote] [name of branch
–like git push origin master
(Because GitHub is called "origin", and you're pushing your master branch). Or git push origin 4-my-new-feature
, if you're pushing some feature branch.
To deploy your code, you'll be pushing to a new remote, called Heroku. Like GitHub, Heroku is a remote storage of your repo, but it also publishes that code by running rackup
for you and allocating a URL like http://elegant-bobcat-23483.herokuapp.com for your project alone. Since it does that, it doesn't do other things, like allow for conversations or otherwise facilitate collaboration.
Set Up Heroku
Create the Heroku Remote
One person should do the following:
- On iTerm, from your project folder (any branch), run
heroku create
.
The output will be something like:
Creating app... done, stack is cedar-14
https://sleepy-ocean-52379.herokuapp.com/ | https://git.heroku.com/sleepy-ocean-52379.git
The first URL there is your project's dedicated URL! The second one (ending in .git
is the location of the Heroku remote repo storage).
Setting Up the Heroku "Remote"
Running heroku create
automatically added that repo storage to your computer as a "remote". So now, just like you can do git push origin master
to push to GitHub, you can also do git push heroku master
to push to Heroku. GitHub and Heroku are not connected in any way–you have to push to each manually.
Your computer has the Heroku remote, but your partner's does not. Your partner doesn't need to create a new Heroku app, though. They just need to add a connection to the Heroku remote:
- Have your partner do
git remote add heroku https://git.heroku.com/sleepy-ocean-52379.git
(Replace the URL here with your actual Heroku repo's location.)
Now your partner will be able to git push heroku master
from their computer also.
Permissions
You need to give your partner, Alex, and Sumeet permission to access the Heroku remote. Otherwise, even though we can add the remote to our computers, we'll get rejected if we try to push to it.
The person who created the remote in the first place should do the following:
- Log into Heroku - https://id.heroku.com/login
- From your Heroku dashboard, click on the name of your newly created application.
- For that project, click the 'Access' tab and add the following collaborators:
- Your partner, using their email address (The same email they used to sign up for Heroku back in the day)
- [email protected]
- [email protected]
Now everyone can deploy, if needed.
Database
When you deploy, your code is pushed but not your database. That's a good thing–it means you can add silly information for testing your project that no one else will see. But we do need to create a fresh database on Heroku for our deployed application to use.
One person in the pair should do this in iTerm, from the project folder:
-
heroku addons:create heroku-postgresql
The output should be something like this:
Creating postgresql-opaque-94052... done, (free)
Adding postgresql-opaque-94052 to sleepy-ocean-52379... done
Setting DATABASE_URL and restarting sleepy-ocean-52379... done, v3
Database has been created and is available
! This database is empty. If upgrading, you can transfer
! data from another database with pg:copy
Use `heroku addons:docs heroku-postgresql` to view documentation.
Now everyone can deploy, and the Heroku remote has a database for the application to use.
Before you deploy, there are some things to do.
You will only ever deploy the 'master' branch.
Let's deploy your 'master' branch, as it is currently–it's okay if there's not much/anything on it yet. You can continue working on your feature branch after you've deployed 'master'. (Then when it's ready, you can merge it into 'master' and re-deploy!)
One person should do the following:
- If you're on a feature branch, do
git status
- If that indicates there are any modifications yet to be staged/committed, do a full
git add/commit/push
process to get the current state of the feature branch saved. - Don't move ahead if
git status
continues to show a non-clean status.
- If that indicates there are any modifications yet to be staged/committed, do a full
- Switch to the 'master' branch (
git checkout master
) - On the 'master' branch,
git pull
- just to make sure everything from GitHub that's been merged to 'master' is up to date.
Fix Sumeet's Bug
Now you have to fix a bug that Sumeet accidentally introduced in the project's starter code. 😭
You can make this change directly on the 'master' branch–it's okay this one time.
Open the file in your project called Gemfile and make this change:
-
gem "dotenv", :groups => [:development, :test]
should begem "dotenv"
- After saving that file, run
bundle install
in iTerm. - Run
git status
.- There should only be two files with changes - Gemfile and Gemfile.lock. If that's correct, then:
-
git add .
,git commit -m "Fix Sumeet's bug."
,git push
-
- There should only be two files with changes - Gemfile and Gemfile.lock. If that's correct, then:
Now you're ready to deploy.
Whoever fixed Sumeet's bug should do this from the 'master' branch:
-
git push heroku master
Watch as Heroku detects the Ruby app in your code, does its own bin/setup
stuff, and eventually says "Launched".
Go to the URL of your website to see it in action! (It's okay if you haven't built much functionality yet, but whatever you have built should work.)
Future Deploys
When deploying in the future, just make sure you're on the 'master' branch and git push heroku master
.
You'll never deploy anything but the 'master' branch, and you'll never git pull
from Heroku. You'll only ever push 'master'.
Page flow
define_schema
DB.define_table("users")
DB.define_column("users", "name", "string")
DB.define_column("users", "username", "string")
DB.define_column("users", "password", "string")
DB.define_column("users", "email", "string")
DB.define_column("users", "budget", "integer")
DB.define_table("choices")
DB.define_column("users", "destination_id_1", "integer")
DB.define_column("users", "destination_id_2", "integer")
DB.define_column("users", "destination_id_3", "integer")
DB.define_column("users", "destination_id_4", "integer")
DB.define_column("users", "destination_id_5", "integer")
DB.define_table("destinations")
DB.define_column("destinations", "name", "string")
DB.define_column("destinations", "price", "decimal")
Destinations
- Create destination entry
- List destinations
- Update destinations
- Delete destinations
- Input validations
- Tests for validation methods
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.