Skip to content

Conversation

@shakalee14
Copy link
Contributor

  • create add_user table via migrations

@shakalee14
Copy link
Contributor Author

hey @jrob8577 - looking for feedback. wrote instructions in migrations.md

Copy link
Contributor

@jrobcodes jrobcodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shakalee14 @Moniarchy @jamestewartjr @pllearns Changes requested. Also, could we get a PR for just the infrastructure so that I do not need to look through files that are not changing from PR to PR?

.gitignore Outdated
node_modules
yarn-error.log
npm-debug.log
yarn.lock
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yarn.lock should not be in the gitignore file...

migrations.md Outdated
@@ -0,0 +1,11 @@
If a contributor wants to change the schema, they must create a migration. Current migrations have been created with the following commands:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a lot of instruction in this file that is not specifically concerned with migrations. I would prefer to make this more concise, and place it in the CONTRIBUTING.md file, similar to the floworky approach.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this comment addressed? Is this file still needed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We deleted it but it must have come back during a rebase without our realizing it. When we push up again it'll be gone.

@shakalee14
Copy link
Contributor Author

@jrob8577 we addressed your changes! thanks.

Copy link
Contributor

@jrobcodes jrobcodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README.md Outdated
## Setting up Development Environment

A mongodb database named lizardboard must be created prior to starting the application for the first time.
- Brew install mongodb
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brew should be lower case

README.md Outdated

A mongodb database named lizardboard must be created prior to starting the application for the first time.
- Brew install mongodb
- Yarn install
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yarn should be lower case. We should probably also insert a command to install yarn globally (before brew install mongodb maybe?).

README.md Outdated
- Brew install mongodb
- Yarn install
- Run `mongod` command on one tab to open up the database server
- Run `mongo` command on another tab to open up the MongoDB shell
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line; running the mongo shell is not a necessary step to setting up the dev environment.

README.md Outdated
A mongodb database named lizardboard must be created prior to starting the application for the first time.
- Brew install mongodb
- Yarn install
- Run `mongod` command on one tab to open up the database server
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove this command as well - installing the DB implies that is is running for the project to work, IMHO. If you disagree, I think I'd rather see this as Ensure mongo is running, maybe after the brew command?

README.md Outdated

### Database
- [Mongodb](https://docs.mongodb.com/)
-[Mongoose](http://mongoosejs.com/docs/guide.html)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we officially decided on Mongoose? Would love to here why we decided to use this lib.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the most popular and supported ORM for Mongo, based on our research.

@@ -0,0 +1,9 @@
const express = require('express');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get rid of unused routes in the initial submission

server/index.js Outdated
// Use connect method to connect to the Server
MongoClient.connect(url, function(err, db) {
assert.equal(null, err);
console.log("Connected correctly to server");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is less interesting than if an error occurs - I would remove this and only output something if a failure occurs. As well, the server probably shouldn't start up unless we manage to connect to the database, so this is probably the wrong place for this code.

server/index.js Outdated
const url = 'mongodb://127.0.0.1:27017/lizardboard';
// Use connect method to connect to the Server
MongoClient.connect(url, function(err, db) {
assert.equal(null, err);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why assert.equal?

server/index.js Outdated
, assert = require('assert');

// Connection URL
const url = 'mongodb://127.0.0.1:27017/lizardboard';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should move this const and db connection logic into its own module.

server/index.js Outdated
assert.equal(null, err);
console.log("Connected correctly to server");

db.close();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we closing the db?

@Moniarchy Moniarchy mentioned this pull request Nov 1, 2016
shakalee14 and others added 2 commits November 2, 2016 08:10
- create add_user table via migrations
- addressed jrobs comments, created contributing md and added info to readme
Copy link
Contributor

@jrobcodes jrobcodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shakalee14 @Moniarchy change requests in line

README.md Outdated

## Testing
TBD
<<<<<<< HEAD
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a merge conflict in here.

database.js Outdated
@@ -0,0 +1,9 @@
const db = 'mongodb://localhost/lizardboard'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this const used for?

database.js Outdated
@@ -0,0 +1,9 @@
const db = 'mongodb://localhost/lizardboard'
const url = 'mongodb://127.0.0.1:27017/lizardboard';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make this upper case URL, and maybe name it to be more specific (DATABASE_URL perhaps?)

database.js Outdated
const url = 'mongodb://127.0.0.1:27017/lizardboard';
const MongoClient = require('mongodb').MongoClient, assert = require('assert');

MongoClient.connect(url, (err, res, db) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to make this a promise and export the creation of the promise as a function - otherwise we can't guarantee that we have successfully connected to the database when the server starts...

"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon ./bin/www"
"start": "nodemon ./bin/www",
"migration:create": "node_modules/.bin/migrate -d mongodb://localhost:27017/lizardboard create",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does create take parameters? If it does, does this work?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it does. Are there any specific changes you would like to see? We haven't had trouble with running this script. In CONTRIBUTING.md there are further instructions for using this script.

error: {}
});
});

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra new line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants