Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO NOT MERGE - PR is for feedback purposes only #28

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions feedback.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Termagotchi

I love this so much - its really just too cute. The ascii art is just :chefs-kiss:. I kind of want to use this as the deliverable for next module's terminal app lesson. Here's some general notes / feedback but overall, great job this week!

- great job researching different terminal libraries
- really impressed with your work with promises in this app -- i know that was all new syntax for you so great job figuring it out during a project week
- Think about refactoring some functions from index.js into separate files just to keep the code a little shorter / cleaner
- You could think about completely removing the express server to be honest, and just connecting directly to your database -- I don't think you really need the API right now -- instead of funneling through the API, you could just call the Model methods directly in your utils
- Code is really clean & easy to read - nice work!
53 changes: 28 additions & 25 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ const {
suitcase,
} = require('./lib/utils/ascii');

const sleep = (ms = 5000) => new Promise((r) => setTimeout(r, ms));
// hope this makes more sense now that you've done a deliverable on promises!
// i generally like to use res as my variable name in promises to make it
// clear its the resovle function
const sleep = (ms = 5000) => new Promise((res) => setTimeout(res, ms));

const asciiMap = {
2: gradient.summer(forest),
Expand Down Expand Up @@ -127,31 +130,31 @@ const setUser = async () => {
return signUp();
}
});
};

const signIn = async () => {
inquirer
.prompt([
{
prefix: '*',
name: 'username',
message: 'Enter your Termagotchi name:',
},
{
prefix: '*',
name: 'password',
type: 'password',
message: 'Enter your password',
},
])
.then((answers) => {
console.log(chalk.bold(`Welcome back to ${answers.username}!`));
console.log(gradient.retro(excited));
return signInUser(answers.username, answers.password);
})
.then(() => {
return storyLine(1);
});
};
const signIn = async () => {
inquirer
.prompt([
{
prefix: '*',
name: 'username',
message: 'Enter your Termagotchi name:',
},
{
prefix: '*',
name: 'password',
type: 'password',
message: 'Enter your password',
},
])
.then((answers) => {
console.log(chalk.bold(`Welcome back to ${answers.username}!`));
console.log(gradient.retro(excited));
return signInUser(answers.username, answers.password);
})
.then(() => {
return storyLine(1);
});
};

const signUp = async () => {
Expand Down