Mayank0255/Stackoverflow-Clone-Frontend

[BUG]: How to we actually see the frontend of site ?

vijaykarani333 opened this issue · 8 comments

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Create a .env file and the format should be as given in .env.example.

  2. Run these commands then -
    npm run installDep (To install all the dependencies)
    npm run auditDep (Run this to audit fix all the vulnerabilities)

  3. Run databaseConfig.sql file in the mysql client
    source /data/databaseConfig.sql

  4. Run seed.sql file in the mysql client for seed data
    source /data/seed.sql

  5. Start the servers
    npm run dev

Expected behavior
trying to see the font end as shown in the demo.

Screenshots

image

Additional context
Add any other context about the problem here.

@vijaykarani333 do you have Mysql setup in your local machine?

And can you send a ss of your .env?

image

image

Thank you for the quick response.

Try replacing your host with this - 127.0.0.1

image

How can we see the font end.

"Try replacing your host with this - 127.0.0.1"
Do you mean localhot:5000 to 127.0.0.1:5000?

@vijaykarani333 first of all its FRONTEND not font end

And no I don't mean that, change the host name in your env to that which is localhost right now.

And the port 5000 is for the backend, so you won't see your font end there, port 3000 is for the Frontend

@vijaykarani333 did it work?

Yes, but when I change it to port 3000. there is not thing shown>

@vijaykarani333 did it work?

Since you share we should visit the front end at port 3000, will give it a try when I am on a different computer. will update here.

@vijaykarani333

Listen to me closely,

The project has 2 servers running one for backend which runs on port 5000 and another one for Frontend which runs on port 3000.

You don't have to change any port anywhere.

Now, just change your host field value in your .env file from 'localhost' to '127.0.0.1'.

Kindly don't change anything else.

Try this and let me know.

If it runs, then you can access the backend api on port 5000, and if you want to access the front-end then go on port 3000

Incase you are not able to understand this still, then I am sorry I can't explain this with more detail.