-
Notifications
You must be signed in to change notification settings - Fork 0
Updating README #49
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
base: main
Are you sure you want to change the base?
Updating README #49
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,61 +14,148 @@ At Pensano Developers, we are committed to giving back to our community and supp | |
| We work in agile environments, test-driven development, object-oriented programming, and quickly adapting to new tech stacks. We aim to deliver software that meets the needs of the customer, is flexible and adaptable to change, and is delivered efficiently and with high quality. | ||
|
|
||
| # Getting started | ||
|
|
||
| 1. Clone the repo | ||
| 2. Install Node.js dependencies for both front and backend directories | ||
|
|
||
| ```bash | ||
| cd backend | ||
| npm install | ||
| cd ../frontend | ||
| npm install | ||
| ``` | ||
| 3. Install the "react-allergens" package using the package manager of your choice, such as npm or yarn. | ||
|
|
||
| To install "react-allergens" using npm: | ||
| ```bash | ||
| npm install react-allergens | ||
| ``` | ||
| ```bash | ||
| cd backend | ||
| npm install | ||
| cd ../frontend | ||
| npm install | ||
| ``` | ||
|
|
||
| 3. Ensure nodemon is installed by running | ||
|
|
||
| ```bash | ||
| npm install nodemon --global | ||
| ``` | ||
|
|
||
| 4. Install the "react-allergens" package using the package manager of your choice, such as npm or yarn. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to nodemon, but why do we need this when it is already a dependency? Is there any known issue here? If there is then we should be expected to have a production issue with it. |
||
| To install "react-allergens" using npm: | ||
|
|
||
| ```bash | ||
| npm install react-allergens | ||
| ``` | ||
|
|
||
| To install "react-allergens" using yarn: | ||
| ```bash | ||
| yarn add react-allergens | ||
| ``` | ||
| 4. Get a ChatGPT API key - you will need it later. If your team does not have one, you will have to sign in to your ChatGPT account, go to the API keys page and click the “Create new secret key” button. This key should not be visible on GitHub, so we will use a .env file to keep it hidden. Publicly exposing your key can result in your account being compromised, which could lead to unexpected charges on your account. | ||
|
|
||
| 5. Confirm that `.env` has been added to your `.gitignore` dir | ||
| ```bash | ||
| yarn add react-allergens | ||
| ``` | ||
|
|
||
| 5. Get a ChatGPT API key - you will need it later. If your team does not have one, you will have to sign in to your ChatGPT account, go to the API keys page and click the “Create new secret key” button. This key should not be visible on GitHub, so we will use a .env file to keep it hidden. Publicly exposing your key can result in your account being compromised, which could lead to unexpected charges on your account. | ||
|
|
||
| 6. Confirm that `.env` has been added to your `.gitignore` dir | ||
|
|
||
| 7. Install dotenv: | ||
|
|
||
| 6. Install dotenv: | ||
| ```bash | ||
| npm install dotenv --save | ||
| ``` | ||
| 7. Create a `.env` file in the backend dir and add `OPENAI_API_KEY=` followed by your ChatGPT API key. It should look like this: | ||
| ``` | ||
| PROJECT_API_KEY=3ebf52c0-3ebf52c0 | ||
| ``` | ||
| ``` | ||
|
|
||
| 8. Create a `.env` file in the backend dir and add `OPENAI_API_KEY=` followed by your ChatGPT API key. It should look like this: | ||
|
|
||
| ``` | ||
| PROJECT_API_KEY=3ebf52c0-3ebf52c0 | ||
| ``` | ||
|
|
||
| ### Running | ||
|
|
||
| 1. To start the frontend and backend servers at the same time: | ||
|
|
||
| ```bash | ||
| cd backend | ||
| npm start | ||
| ``` | ||
| ```bash | ||
| cd backend | ||
| npm start | ||
| ``` | ||
|
|
||
| 2. To start the frontend only: | ||
|
|
||
| ```bash | ||
| cd frontend | ||
| npm start | ||
| ``` | ||
| ```bash | ||
| cd frontend | ||
| npm start | ||
| ``` | ||
|
|
||
| 3. To start the backend only: | ||
|
|
||
| ```bash | ||
| cd backend | ||
| npm run server | ||
| ``` | ||
| ```bash | ||
| cd backend | ||
| npm run server | ||
| ``` | ||
|
|
||
| ### Resources | ||
|
|
||
| - [MERN Stack: A Comprehensive Guide](https://blog.nextideatech.com/how-to-get-started-with-the-mern-stack-a-comprehensive-guide/) | ||
| - [Keeping your API keys secret with dotenv](https://jonathansoma.com/lede/foundations-2019/classes/apis/keeping-api-keys-secret/) | ||
| - [dotenv](https://www.npmjs.com/package/dotenv) | ||
|
|
||
| # Getting Started with Create React App | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm all in favour of ditching the default React App documentation as it feels like unnecessary information for this project. If we are keeping it then line 98, "In the project directory, you can run:" is no longer true and line 100, "###
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. Another thing we added yesterday was to set our ‘OPENAI_API_KEY’ Environment Variable using zsh:
echo "export OPENAI_API_KEY='yourkey'" >> ~/.zshrc
source ~/.zshrc
echo $OPENAI_API_KEY
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will make the changes and let you know. |
||
|
|
||
| This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). | ||
|
|
||
| ## Available Scripts | ||
|
|
||
| In the project directory, you can run: | ||
|
|
||
| ### `npm start` | ||
|
|
||
| Runs the app in the development mode.\ | ||
| Open [http://localhost:3000](http://localhost:3000) to view it in your browser. | ||
|
|
||
| The page will reload when you make changes.\ | ||
| You may also see any lint errors in the console. | ||
|
|
||
| ### `npm test` | ||
|
|
||
| Launches the test runner in the interactive watch mode.\ | ||
| See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. | ||
|
|
||
| ### `npm run build` | ||
|
|
||
| Builds the app for production to the `build` folder.\ | ||
| It correctly bundles React in production mode and optimizes the build for the best performance. | ||
|
|
||
| The build is minified and the filenames include the hashes.\ | ||
| Your app is ready to be deployed! | ||
|
|
||
| See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. | ||
|
|
||
| ### `npm run eject` | ||
|
|
||
| **Note: this is a one-way operation. Once you `eject`, you can't go back!** | ||
|
|
||
| If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. | ||
|
|
||
| Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own. | ||
|
|
||
| You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it. | ||
|
|
||
| ## Learn More | ||
|
|
||
| You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). | ||
|
|
||
| To learn React, check out the [React documentation](https://reactjs.org/). | ||
|
|
||
| ### Code Splitting | ||
|
|
||
| This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) | ||
|
|
||
| ### Analyzing the Bundle Size | ||
|
|
||
| This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) | ||
|
|
||
| ### Making a Progressive Web App | ||
|
|
||
| This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) | ||
|
|
||
| ### Advanced Configuration | ||
|
|
||
| This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) | ||
|
|
||
| ### Deployment | ||
|
|
||
| This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) | ||
|
|
||
| ### `npm run build` fails to minify | ||
|
|
||
| This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a known issue here with nodemon? I did note that nodemon is listed as a dependency where I believe it should be a dev dependency which could potentially be an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, yesterday we noticed nodemon appearing in a few error messages. We might need to update it to be a dev dependency then.