Link to Deployed Website: Allo Health Assigment
Steps to Run the Deployed Webiste
The Website is Deployed on Render both frontend and backend of the website
For Login, You Can use the Credentials
- email : testing@gmail.com- password: @Test123
Also there is an option to signup, So You can signup from any other email id and then can login with the same credentials you have set
Note: One Logged In, you get into the meals page and if you refresh that page, you may get an error displaying cannot get /meal
Actually here the routes are not handled properly as authentication and private routing is something that I am a newbie to. So you need to move back to login page and then login again with the credentials.
If you want to run the Website locally on your machine then the detailed steps are as follow:
- Firsty you need to clone or fork this repository, to get the folders into your local machines from where you can run the application.
- Now, once you have both the folders ready in your code editor (Preferrably VSCode), get into the server folder, Command that can we
used to get into server folder
cd server
- Now Once you are into the server folder, download the node modules of the app using the command
npm install
This Command will download all the node-modules required for this project to run
- Now we need to include a .env file in the server folder, which will contain all the environment variables, created by right clicking the
server folder and choosing create file option. Name is .env and its created
Data that needs to be included in .env file:
PORT: 3001;
DATABASE_URL: mongodb://localhost:27017/mealsDatabase
- For the above mentioned URL, you need to have mongodb installed in your local machines along with mongodb compass where you can look for data that is added into database
- Also another sort of string can be used that can be fetched from the mongodb atlas cloud creating cluster and database deployment there
JWT_SECRET: //RandomString ;
- Example: testingApplication
- Now once the .env file is created, we are all set to start the server. For starting the server use the command
npm run dev
- In terminal, you will get the message that Server is started at port and database connected!! which resembles database is correctly connected to the server.
- Now, once you have started the server, get into the client folder, Command that can we
used to get into client folder
cd ..
cd client
- Now Once you are into the client folder, download the node modules of the app using the command
npm install
- Once, Node Modules are installed, For starting the client use the command
npm run dev
- After a few seconds a localhost link will be generated that will run the client side of the application which you can paste on any browser and browse.
- If you are running the file locally, you need to sign up first with your credentials and then log in into the website with same credentials.
Note: There are very less Validations applied to the Signup and Login page as I have applied very basic authentication to the application.