Skip to content
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

Update README.md #27

Merged
merged 4 commits into from
Jul 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Companion App (based on AI Getting Started template)

[Live Demo](TODO)
[Live Demo](https://ai-companion-stack-demo.fly.dev/)

[Join our community Discord: AI Stack Devs](https://discord.gg/PQUmTBTGmT)

Expand Down Expand Up @@ -105,6 +105,10 @@ Fork the repo to your Github account, then run the following command to clone th
git clone [email protected]:[YOUR_GITHUB_ACCOUNT_NAME]/companion-app.git
```

**Alternatively**, you can launch the app quickly through Github Codespaces by clicking on "Code" -> "Codespaces" -> "+"
<img width="1297" alt="Screen Shot 2023-07-02 at 8 17 44 PM" src="https://github.com/a16z-infra/companion-app/assets/3489963/abb9533c-088a-42fa-90ff-7e9dc429529c">
If you choose to use Codespaces, npm dependencies will be installed automatically and you can proceed to step 3.

### 2. Install dependencies

```
Expand All @@ -118,6 +122,7 @@ npm install
cp .env.local.example .env.local
```

Secrets mentioned below will need to be copied to `.env.local`
a. **Clerk Secrets**

Go to https://dashboard.clerk.com/ -> "Add Application" -> Fill in Application name/select how your users should sign in -> Create Application
Expand Down Expand Up @@ -210,8 +215,9 @@ h. Now you can text the Twilio phone number from your phone and get a response f
#### Deploy to fly.io

- Register an account on fly.io and then [install flyctl](https://fly.io/docs/hands-on/install-flyctl/)
- **If you are using Github Codespaces**: You will need to [install flyctl](https://fly.io/docs/hands-on/install-flyctl/) and authenticate from your codespaces cli by running `fly auth login`.
- Run `fly launch` under project root -- this will generate a `fly.toml` that includes all the configurations you will need
- Run `fly deploy -ha=false` to deploy the app -- the -ha flag makes sure fly only spins up one instance, which is included in the free plan. You also want to run `fly scale memory 512` to scale up the fly vm memory for this app.
- Run `fly deploy --ha=false` to deploy the app -- the -ha flag makes sure fly only spins up one instance, which is included in the free plan. You also want to run `fly scale memory 512` to scale up the fly vm memory for this app.
- For any other non-localhost environment, the existing Clerk development instance should continue to work. You can upload the secrets to Fly by running `cat .env.local | fly secrets import`
- If you are ready to deploy to production, you should create a prod environment under the [current Clerk instance](https://dashboard.clerk.com/). For more details on deploying a production app with Clerk, check out their documentation [here](https://clerk.com/docs/deployments/overview). **Note that you will likely need to manage your own domain and do domain verification as part of the process.**
- Create a new file `.env.prod` locally and fill in all the production-environment secrets. Remember to update `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` by copying secrets from Clerk's production instance -`cat .env.prod | fly secrets import` to upload secrets
Expand Down