https://github.com/sphericalkat/chatwork-web-client
https://github.com/sphericalkat/chatwork-web-client
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sphericalkat/chatwork-web-client
- Owner: SphericalKat
- Created: 2024-11-18T09:36:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-14T16:00:26.000Z (over 1 year ago)
- Last Synced: 2026-01-25T23:40:10.886Z (5 months ago)
- Language: TypeScript
- Size: 443 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chatwork Web Client
### Getting started
#### Running the project
* Install dependencies with `pnpm install`
* Run migrations with `pnpm run db:migrate`
* Put the following in `.env`
```bash
DATABASE_URL=local.db
NEXT_CHATWORK_OAUTH_API_URL='https://oauth.chatwork.com'
NEXT_CHATWORK_API_URL='https://api.chatwork.com/v2'
NEXT_CHATWORK_OAUTH_URL="https://www.chatwork.com/packages/oauth2/login.php"
# Values for these 3 are in the next step of this README
NEXT_APP_BASE_URL=''
NEXT_CHATWORK_CLIENT_ID=''
NEXT_CHATWORK_CLIENT_SECRET=''
```
* Run the project with `pnpm run dev`
#### Proxying
Chatwork requires you to be developing on an `https://` url, so localhost will not work.
The easiest way to do this is to install [Tailscale](https://tailscale.com), and run `tailscale funnel 3000`.
This will give you a url that it proxied `localhost:3000` to, which will look something like `https://abc.def.ts.net`.
Now, you can set `NEXT_APP_BASE_URL` in your `.env`:
```bash
NEXT_APP_BASE_URL="https://abc.def.ts.net"
```
#### Creating the Chatwork OAuth app
* Go to Chatwork > Integrations
* Go to API > OAuth
* Click 'Create New'
* Choose any _Client Name_ and _Client Type_, and check all checkboxes in _Scope_. You don't need to choose an _Icon_.
* For _Redirect URI_, append `/login/chatwork/callback` to the value you set to `NEXT_APP_BASE_URL`, which will look something like `https://abc.def.ts.net/login/chatwork/callback`. Just this one will do for now.
* Press _Create_ at the bottom of the screen, and you'll get redirected to a screen that will have your Client ID and Client Secret. Set them in your `.env`.
* Now visit `https://abc.def.ts.net` in your browser, and you should be able to grant access and proceed to the web app with all your chats visible!