Skip to content

Commit

Permalink
chore(web): replaces setup script with README instructions
Browse files Browse the repository at this point in the history
[`yarn global` is deprecated in Yarn 2.x](https://yarnpkg.com/migration/guide#use-yarn-dlx-instead-of-yarn-global), instead `yarn dlx` is recommended for temporary installs.
  • Loading branch information
arthurgousset committed Jan 18, 2024
1 parent 989ea0a commit 873f5a3
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 3 deletions.
1 change: 0 additions & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.1.0",
"private": true,
"scripts": {
"setup": "vercel env pull",
"dev": "next dev",
"build": "next build",
"start": "next start",
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"scripts": {
"dev": "yarn --cwd apps/web dev",
"lint": "yarn --cwd apps/web lint --fix && yarn --cwd apps/firebase lint --fix",
"setup": "yarn global add vercel@latest",
"prepare": "husky install",
"prettify": "yarn prettier --write \"apps/**/*.{ts,tsx}\" --ignore-path=./.gitignore"
},
Expand Down
56 changes: 55 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,61 @@ This Repo contains the code for the alfajores faucet. This is contained in 2 app

The web app deploys automatically to vercel.

To setup the web app to run locally set the vercel project to clabs/faucet and the env variables from vercel with `vercel env pull` then run `yarn dev`
## Setup

### Wep app

To set up the web app to run locally:

1. navigate to the `apps/web` folder
```sh
$ cd apps/web
```

1. link your local repository to the `faucet` project on Vercel

```sh
$ yarn dlx vercel@latest link
```

You'll be asked to authenticate with your Vercel account. Once you've done that, you'll be
guided through a series of prompts to link your local project to the `faucet` Vercel project.
```
? Set up “~/Documents/celo-org/faucet/apps/web”? [Y/n] y
? Which scope should contain your project? Celo Ecosystem Project Hosting
? Link to existing project? [y/N] y
? What’s the name of your existing project? faucet
✅ Linked to c-labs/faucet (created .vercel)
```
1. fetch environment variables from Vercel
```sh
$ yarn dlx vercel@latest env pull
```
If you get an error like `Error! No project found`, you may need to run `vercel link` again.
If everything worked, you should see a message like this:
```sh
> Downloading `development` Environment Variables for Project faucet
✅ Created .env.local file [249ms]
```
1. run the app locally
```sh
$ yarn dev
```
You should see a message like this:
```sh
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - Loaded env from /Users/arthur/Documents/celo-org/faucet/apps/web/.env.local
```
You can now view the app in your browser at http://localhost:3000.
## Adding chains
Expand Down

0 comments on commit 873f5a3

Please sign in to comment.