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

[BUG] Fix the dashboard route #85

Open
gbowne1 opened this issue Jul 19, 2023 · 12 comments
Open

[BUG] Fix the dashboard route #85

gbowne1 opened this issue Jul 19, 2023 · 12 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed
Milestone

Comments

@gbowne1
Copy link
Owner

gbowne1 commented Jul 19, 2023

The route & path where the dashboard is currently displaying is http://localhost:3000/dashboard/dashboard.html but http://localhost:3000/dashboard/ does not display the dashboard.

@gbowne1 gbowne1 added bug Something isn't working help wanted Extra attention is needed labels Jul 19, 2023
@gbowne1 gbowne1 added this to the Backend milestone Jul 19, 2023
@jzunigarce
Copy link
Collaborator

You pull the changes?. I work perfect with http://localhost:3000/dashboard/. In my local I am working with port 3001, we should put a configuration at the frontend level to manage env variables to work with the port that everyone wants. Could you try the login?

@gbowne1
Copy link
Owner Author

gbowne1 commented Jul 19, 2023

yes I tried the changes.

  • It does not redirect for me when I use one of the users I have in my saved list.

  • I also still get the cors error and unable to load the network resource.

  • I tried registering a new user in http://localhost:3000/ and clicking submit on the register form. I no longer get the key values // json in the console like I did before.

  • I tried using a user that I have used before to login and its password, in fact several of them. Same deal and no redirect.

  • Login and Register appear to render the same. Register, http://localhost:3000/register/ still says "Login" at the top of the card.

  • Both Login and Register need some more CSS and UI work, including more fields (gonna make an issue for this so I can track it.

    Including includes the following fields:

    Username or Email: This field allows the user to enter their username or email address associated with their account.

    Password: This field is used for entering the password associated with the username or email.

    Remember Me: This checkbox allows the user to choose whether they want the system to remember their login credentials for future visits.

    Forgot Password: This link provides a way for users to reset their password if they have forgotten it.
    Sign In/Log In Button: This button triggers the authentication process and logs the user into the system.

    Resgiter will have these fields: First Name: This field captures the user's first name.

    Last Name: This field captures the user's last name.

    Email Address: This field captures the user's email address, which is often used as a unique identifier for the account.

    Password: This field captures the user's chosen password for account authentication.

    Confirm Password: This field asks the user to re-enter the password to ensure accuracy.

    Username: This field captures the user's desired username, which may be used for account identification.

@gbowne1
Copy link
Owner Author

gbowne1 commented Jul 19, 2023

I think some of the issues is that the api now requires 3001 and the follow, user and profile controllers still use 3000.

we could do

PORT=3000
API_PORT=3001

in .env

we could do something like this

const apiUrl = `http://localhost:${apiPort}/api`;

and the same with the app.

@gbowne1
Copy link
Owner Author

gbowne1 commented Jul 19, 2023

we should have a .env.example for new users too.

@jzunigarce
Copy link
Collaborator

The registration form has not yet uploaded the changes

@jzunigarce
Copy link
Collaborator

The web and api work in same port, remenber that both routes listening for the port of app node.

@jzunigarce
Copy link
Collaborator

I put port 3001 because that's how I have my local, you can change it to 3000, so you can test what I upload a fix for .env variables in the front

@gbowne1
Copy link
Owner Author

gbowne1 commented Jul 19, 2023

so I am seeing a bunch of changes that need to be made.

  • ship a .env.example that people can rename to .env when they've cloned/forked the app.

  • the port thing is a bit disambiguous. It really needs a fix so that it can be used on any port in the 3000 - 3999 range that node likes.

  • the nodemon.json file in the /server folder/directory needs some work then.

there a couple other .env variables I see that I don't have or get, I searched for the _ in the entire codebase.

MONGODB_URI=mongodb://username:password@host:port/database
PORT=3000
SESSION_SECRET=TinHttuZPx
MONGO_PORT=27017
MONGO_HOST=localhost
API_SECRET= <==
NODE_ENV=development
JWT_SECRET= <==
JWT_KEY= <==
NODE_ENV= <==

We could possibly use something like http://localhost:${apiPort}/api and http://localhost:${port}/ I just wanted to reduce having to switch when I am running like a react dev sever that totally picks 3000 as its first choice.

@jzunigarce
Copy link
Collaborator

assign it to me

@gbowne1
Copy link
Owner Author

gbowne1 commented Jul 19, 2023

oh and @jzunigarce the login.schema.js in /schemas needs to be username and password, not email and password

@jzunigarce
Copy link
Collaborator

@gbowne1 we just need a schema for the model. We do not require login, registration scheme, because we do not have such models. We can add the Joi module to validate schema that are submitted by users. The user schema we currently have is for the user collection

@gbowne1
Copy link
Owner Author

gbowne1 commented Jul 20, 2023

Ok. Good to know that.

this reminds me I added these collections for future use:

sessions
authlog
sessionhistory
usersession

For:

  • users: This collection stores user account information, such as usernames, passwords, and email addresses.
  • sessions: This collection stores session information, such as session IDs and expiration times (for auth)
  • authlogs: This collection stores authentication log information, such as login attempts and IP addresses.
  • sessionhistory: This collection stores session history information, such as previous session IDs and login times.
  • usersession: This collection stores user session information, such as the user ID and the session ID (for auth)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
Development

No branches or pull requests

2 participants