You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create your bot and put it's key in BOT_KEY in /src/back/config.js
You can't use env vars attached to code. You should provide a .env.sample file with the required env vars for your project.
Env vars are secret and should be user-based.
Try: dotenv
No need to init MongoDB, since its schema-less this will be (should be) inited automatically.
MongoDB connection settings: /back/config.js
Again... env file...
Lack of build instructions
There is no instructions on how to build the project. If i run the defaults: npm install && npm start an error will occour: Error: Cannot find module '/Users/rafa/Dev/Tests/telebot/bin/www'
Same for tests...
package.json
very incomplete and weak package.json. There is no engine reference (is node 4 or 6?). There is no author. There are dev dependencies declared in regular dependencies and is lacking declarations (eg.: istanbul)
tests
Tests crash (SyntaxError: Invalid regular expression: /^function)
when npm test...
All specs should be stored apart from the source code. You must provide a separated folder in the root of your project containing yours tests, not mixed with the actual source code. This is very messy! (Eg.: ./specs/controllers/.../tests/models/...)
back
How to build this??? Had to assume: node back/index.js
Where are all the code comments? Am I supposed to read the whole code to understand what's going on?
export default socket => {
prepareConnection(socket); #actually, this should NOT exist at all!
return {
sendMessage: sendNewMessage(socket), # why this?
sendChat: sendNewChat(socket) # why so this?
}
}
This websocket module should not be that modularized, so confusing!
This websocket would easily be converted into a single Class, no need at all to separate the code into chunks.
At: ./back/config.js no usage of .env file... What if in production there is a secret key that only the CTO and Lead Dev can have access to it? All the other programmers would be able to see this secret, not being a secret anymore...
At: ./back/models
100% wrong usage of mongo. And you SHOULD be using mongoose.
Models should be a declarative representation of an entity and its relationships/functions. There is no usage for separated files by folders corresponding to its actions.
./back/models/message.js: contains message schema and functions (or a mongoose model)
./back/models/user.js: contains user schema and functions (or a mongoose model)
...
At ./back/bot/
these should be your controllers, and should not be that "chunked"...
front
why server side render for react? twice the trouble, twice the cost.
why server routes? react has an already built routing system.
are you sure that you know how React and plain frontend apps works?
not even able to build this, there is no instructions at all
tl;dr;
I see that you are making progress, but this still far to be acceptable...
I know you had just a few days to do this, and you did great taking in consideration the time you had to learn and build.
Keep up with the hard work!
Feedback for this
README.md
You can't use env vars attached to code. You should provide a
.env.sample
file with the required env vars for your project.Env vars are secret and should be user-based.
Try: dotenv
No need to init MongoDB, since its schema-less this will be (should be) inited automatically.
Again... env file...
There is no instructions on how to build the project. If i run the defaults:
npm install && npm start
an error will occour:Error: Cannot find module '/Users/rafa/Dev/Tests/telebot/bin/www'
Same for tests...
package.json
very incomplete and weak package.json. There is no engine reference (is node 4 or 6?). There is no author. There are dev dependencies declared in regular dependencies and is lacking declarations (eg.: istanbul)
tests
Tests crash (
SyntaxError: Invalid regular expression: /^function
)when
npm test
...All specs should be stored apart from the source code. You must provide a separated folder in the root of your project containing yours tests, not mixed with the actual source code. This is very messy! (Eg.:
./specs/controllers/..
./tests/models/...
)back
How to build this??? Had to assume:
node back/index.js
Where are all the code comments? Am I supposed to read the whole code to understand what's going on?
Out of lint and without a proper style as requested: Airbnb's Styleguide
At:
./back/websocket
Why no ES6 usage? Why so many code chunks?
Your code:
Expectation:
This websocket module should not be that modularized, so confusing!
This websocket would easily be converted into a single Class, no need at all to separate the code into chunks.
At:
./back/config.js
no usage of .env file... What if in production there is a secret key that only the CTO and Lead Dev can have access to it? All the other programmers would be able to see this secret, not being a secret anymore...At:
./back/models
100% wrong usage of mongo. And you SHOULD be using mongoose.
Models should be a declarative representation of an entity and its relationships/functions. There is no usage for separated files by folders corresponding to its actions.
Your code:
Expectations:
./back/bot/
these should be your controllers, and should not be that "chunked"...
front
tl;dr;
I see that you are making progress, but this still far to be acceptable...
I know you had just a few days to do this, and you did great taking in consideration the time you had to learn and build.
Keep up with the hard work!
You should try:
The text was updated successfully, but these errors were encountered: