trystant / drywall Goto Github PK
View Code? Open in Web Editor NEWThis project forked from jedireza/drywall
A website and user system (Express/Backbone/Sequelize/Postgres)
Home Page: http://jedireza.github.io/drywall/
License: MIT License
This project forked from jedireza/drywall
A website and user system (Express/Backbone/Sequelize/Postgres)
Home Page: http://jedireza.github.io/drywall/
License: MIT License
The current install process includes creating an admin user in the database and then going through the "forgot password" section in order to create the first user. There should be an easier way to start things up. One piece of that includes creating a fixture file(s) in order to handle that request. The following code
db.admingroups.insert({ _id: 'root', name: 'Root' });
db.admins.insert({ name: {first: 'Root', last: 'Admin', full: 'Root Admin'}, groups: ['root'] });
var rootAdmin = db.admins.findOne();
db.users.save({ username: 'root', isActive: 'yes', email: '[email protected]', roles: {admin: rootAdmin._id} });
var rootUser = db.users.findOne();
rootAdmin.user = { id: rootUser._id, name: rootUser.username };
db.admins.save(rootAdmin);
needs to be turned into a JSON fixture used by sequelize-fixtures
The following methods within /views/admin/search/index.js
are still using Mongoosejs queries to accomplish their goals, which means that search won't work with this implementation. The following methods need to be changed to use SequelizeJS equivalents:
It also looks like drywall uses the async methods for asynchronous JavaScript. Those should be converted to using Bluebird promises.
When using Drywall, the database needs to be created manually. Starting the app server with npm start
without the created database results in the following error:
Server is running on port 3000
Unhandled rejection SequelizeConnectionError: database "drywall-development" does not exist
at /Users/mnyon/code/drywall/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:73:20
at null.<anonymous> (/Users/mnyon/code/drywall/node_modules/pg/lib/client.js:171:5)
at emit (events.js:107:17)
at Socket.<anonymous> (/Users/mnyon/code/drywall/node_modules/pg/lib/connection.js:109:12)
at Socket.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at TCP.onread (net.js:538:20)
A potential fix to this would be to create a SequelizeJS migration that can create databases as well.
The test suite currently runs, but the build fails on Travis and the following error appears:
The goal is to have Travis run green.
Code Climate needs to be part of this codebase in order to make improvements to the codebase as well as remove unneeded code.
When running tests on Travis, the following errors are occurring:
Unhandled rejection SequelizeConnectionRefusedError: connect ECONNREFUSED 127.0.0.1:5432
at /home/travis/build/trystant/drywall/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:89:20
at null.<anonymous> (/home/travis/build/trystant/drywall/node_modules/pg/lib/client.js:176:5)
at emitOne (events.js:77:13)
at emit (events.js:169:7)
at Socket.<anonymous> (/home/travis/build/trystant/drywall/node_modules/pg/lib/connection.js:59:10)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at emitErrorNT (net.js:1256:8)
at nextTickCallbackWith2Args (node.js:441:9)
at process._tickCallback (node.js:355:17)
While this does not make the tests fail, this is worthy of note.
Hi,
'rollbar' required in app.js but it's not add to the package.json file
The config.json file shouldn't be checked into the system. This should be replaced with a template file that can be copied to someone's individual environment.
The sequelize-fixtures module can be integrated into grunt
with grunt-sequelize-features. This will help integrate the fixture creation into an npm fixtures
command, which will call the grunt fixtures
command.
This current app does not handle roles as a result of switching over from Mongoose to Sequelize. This logic needs to be reinstated. Some resources to consider:
Another thing to consider; should role be a model?
Thanks for the great work on getting Drywall to work with PostgreSQL! It's really valuable. But I'm having problems with logging in. I've debugged and seem to loose track of what's going on when views/login/index.js
does:
workflow.emit('response');
and then util/workflow/index.js
does:
res.send(workflow.outcome);
What's supposed to happen here? The outcome
being sent is { success: true, errors: [], errfor: {} }
, but when it is handled by public/views/login/index.js
, it is just setting location.href
back to the /login/
URL. Why?
login: function() {
// ...
success: function(model, response) {
if (response.success) {
location.href = '/login/';
}
// ...
}
}
I was expecting a session cookie to be created, but no cookies besides _csrf
and _csrfToken
are being created by the Drywall application. It seems like Passport's authenticate('local')
with req.login(user, function(err) {})
somehow doesn't work, but I get no exceptions.
Is the cookie supposed to be created by Backbone? By the login
function running in the browser? What am I missing here? Do you know? :)
config.js is an example of a config file which should be removed & replaced with a *.tmpl file. Also, all the Mongo environment variables should be removed from the config.js file.
This Drywall repo should have a Code of Conduct document attached.
In addition to other issues, the installation instructions need to be updated.
I'm adding Rollbar to the project to track exceptions.
While some parts of the app functionality have been ported over to using Promises with Sequelize models, other queries are still using Mongoose to return results through async. There needs to be a way to outline how to go about that path.
This file adds information about style guides & best practices to use when developing, explains the motivation behind development decisions and HOWTOs for specific development tasks.
I plan on using the testing strategy I used on the Red Cross project; mocha and Supertest to do "Unit" Testing. I'm familiar with it as end-to-end testing, but having that suite will be helpful. The second stage will be to have that testing suite up and running on Travis or another Continuous Integration server.
Right now, the README directs the user to the main drywall demo, which uses MongoDB as a backend.
A demo site for this fork would be good to have.
A heroku instance would suffice.
The README.md needs to be updated to properly describe the project & the state of the project. This includes replacing any reference to Mongo and Mongoose with Sequelize and Postgres.
There is still code in this repo which uses Mongo & Mongoose. Since they're not being used, we should remove them
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.