React front end for interacting with gifts-api.bitcoin.com
Must set api URL and price corresponding to API price before deployment
Set giftsBackendBase
in:
src/views/Home/GiftsPortal.js
Gatsby starter project for static web pages. Many of Bitcoin.com's web properties are built with this starter.
Before installing the project, you will need to make sure you have the following tools installed:
This starter has GitHub Packages for private dependencies so before starting, make sure you have access to the following repositories
- Molten components - bitcoincom-pkg-components
- Molten themes - bitcoincom-pkg-theme
Generate a GitHub Personal access token with the following scopes
Run the following commands replacing <github-auth-token>
with a Personal access token generated from https://github.com/settings/tokens. All commands should be run by developers, deployment configuration doesn't require all commands to be run (especially npm login).
# deploy config and developers
npm config set //npm.pkg.github.com/:_authToken <github-auth-token>
npm config set @bitcoin-portal:registry https://npm.pkg.github.com
# developers only
npm config set always-auth true
npm login --registry=https://npm.pkg.github.com
# First clone the repository
git clone [email protected]:bitcoin-portal/bitcoincom-boilerplate.git
# Then install the dependencies using Yarn:
yarn install
To start working on the project, simply run one of the following:
Start with common settings
Start the Gatsby local developement server.
yarn start
# Local: http://localhost:3000/
# On Your Network: http://192.168.1.16:3000/
Start with default Gatsby settings
Starts server with default gatsby settings. Use this if first command doesn't work (you're probably using Windows) or don't want to expose a port on the network your connected to.
yarn start:local
# Local: http://localhost:8000/
Documentation with examples and more details for development can be found here Create a new page (with examples)
Let's try to keep our code clean and have consistent formatting. To do so, the boilerplate includes ESLint
and Prettier
, we recommend installing extensions for both these libraries in your IDE.
If you're using Visual Studio Code, there are some plugins we recommend:
And the workspace config:
{
"files.autoSave": "onFocusChange",
"editor.tabSize": 2,
"editor.formatOnSave": true,
"files.eol": "\n",
"eslint.packageManager": "yarn",
"eslint.alwaysShowStatus": true,
"eslint.autoFixOnSave": true
}
To build the static website, use the following command:
yarn build
After running the command, the static built site can be found in /public
.