Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Bitcoin.com Gifts

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.

Boilerplate info

Requirements

Tools

Before installing the project, you will need to make sure you have the following tools installed:

Required access

This starter has GitHub Packages for private dependencies so before starting, make sure you have access to the following repositories

Configure npm/yarn for GitHub Packages

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

Development

Clone and install

# First clone the repository
git clone git@github.com:bitcoin-portal/bitcoincom-boilerplate.git

# Then install the dependencies using Yarn:
yarn install

Develop

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/

Creating pages

Documentation with examples and more details for development can be found here Create a new page (with examples)

Linting and code formatting

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.

VS Code

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
}

Building and Deployment

To build the static website, use the following command:

yarn build

After running the command, the static built site can be found in /public.

Useful links

About

An open-source, non-custodial webapp for generating gifts that automatically refund if unclaimed

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published