Skip to content

Commit

Permalink
feat: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
erguotou520 committed Feb 21, 2024
1 parent e5501b1 commit edd11c4
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 56 deletions.
57 changes: 36 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,44 @@
# fake-sms

Mock SMS server for testing SMS-based applications. Compatible for `Casdoor` [go-sms-sender](https://github.com/casdoor/go-sms-sender) by default.
Mock SMS server for testing SMS-based applications. It can be used to reduce enterprise costs in the test environment.

## Usage
`fake-sms` is compatible for `Casdoor` [go-sms-sender](https://github.com/casdoor/go-sms-sender) by default.

1. Login to fake-sms to get a token
Try it out at [https://fake-sms.erguotou.me](https://fake-sms.erguotou.me)

```bash
curl -X POST http://localhost:7878/login -d '{"username": "admin", "password": "Pa$$wo2d"}'
# copy the token from the response
```
## ✨ Features

2. Create a new Application
- Easy to use: Just create an application on our platform and configure the appId and appSecret in the `Casdoor` compatible SMS provider.
- ⏱️ Real-time: SMS content is pushed through websocket in real time.
- Cost-saving: No need to send real SMS messages in the test environment.

```bash
curl -X POST http://localhost:7878/apps -H "Authorization: Bearer $TOKEN" -d '{"name": "TestApp"}'
# copy the app id and app secret from the response
```
## How to Use

3. Save the app id and app secret in your SMS provider's database, like below:
1. Login/Register on [https://fake-sms.erguotou.me](https://fake-sms.erguotou.me)

2. Create a new Application

3. Click the `Setting` icon on the bottom of your application, and save the `appId` and `appSecret` into your SMS provider's database, like below:

| Provider Name | App ID | App Secret | Template |
|--------------|---------|------------| ---------|
| Infobip SMS | jOFwCWm0aYV21brgWnqbQ3lALXmoPAkX | HgD7lCijmU68Nf6BDL3TNSwA27FQdf1JTxR40K0Gz07OmfuaxlcwZTX4R5PDJOzz | Hello, your code is {code} |

> Note: The `Provider Name` must be `Infobip SMS` for now.
4. Use [casdoor/go-sms-sender](https://github.com/casdoor/go-sms-sender) based server to send SMS messages

5. Check the SMS messages sent by the server in the fake-sms's shared message dashboard or App client
5. Click the `Chat` icon on the bottom of your application which will show a shared message dashboard. Check the SMS messages sent by the server in the shared message dashboard.

## Clients

- [Chrome extension]()
- [Shared message dashboard]()
- [Android app]()
- [iOS app]()
- [Chrome extension](https://ext.fake-sms.erguotou.me/chrome-mv3-prod). Download the zip file and extract it, then go to `chrome://extensions/` in your browser, enable developer mode, and load the extracted folder as an unpacked extension.
- [Microsoft Edge extension](https://ext.fake-sms.erguotou.me/edge-mv3-prod). Download the zip file and extract it, then go to `edge://extensions/` in your browser, enable developer mode, and load the extracted folder as an unpacked extension.
- [Shared message dashboard](https://fake-sms.erguotou.me/#/messages). If you just want to listen to your own phone messages, use the link [https://fake-sms.erguotou.me/#/messages?type=phones&topics=13800138000](https://fake-sms.erguotou.me/#/messages?type=phones&topics=13800138000)

## Development

We use `bun` to develop the server, so you need to install it first:
We use `bun` to develop this project, so you need to install it first:

```bash
curl -fsSL https://bun.sh/install | bash
Expand All @@ -53,9 +54,23 @@ bun install

```bash
cd packages/server
bun start
bun dev
```

### Run the web

```bash
cd packages/web
bun dev
```

### Run the extension

```bash
cd packages/chrome-ext
bun dev
```

## License

[MIT](https://github.com/erguotou/fake-sms/blob/main/LICENSE)
[MIT](./LICENSE)
10 changes: 4 additions & 6 deletions packages/chrome-ext/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# fake-sms Chrome Extension

This is a [Plasmo extension](https://docs.plasmo.com/) project bootstrapped with [`plasmo init`](https://www.npmjs.com/package/plasmo).

## Getting Started

First, run the development server:

```bash
pnpm dev
# or
npm run dev
bun dev
```

Open your browser and load the appropriate development build. For example, if you are developing for the chrome browser, using manifest v3, use: `build/chrome-mv3-dev`.
Expand All @@ -21,9 +21,7 @@ For further guidance, [visit our Documentation](https://docs.plasmo.com/)
Run the following:

```bash
pnpm build
# or
npm run build
bun run build
```

This should create a production bundle for your extension, ready to be zipped and published to the stores.
Expand Down
28 changes: 28 additions & 0 deletions packages/server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# fake-sms server

Powered by [Bun](https://bun.sh) as runtime & [elysia](https://elysiajs.com/essential/scope) as framework & [drizzle orm](https://orm.drizzle.team/docs/rqb) as orm framework.

## Development

### Database Migrations

```bash
bun run schema
bun run migrate
# if you need seed data
bun run seed
```

### Develop

```bash
bun run dev
```

### Build

```bash
bun run build
# if you want a single-file executable binary
bun run build:exec
```
31 changes: 2 additions & 29 deletions packages/web/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
# React + TypeScript + Vite
# fake-sms console webpage

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
}
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
This is the console webpage for fake-sms. Built with React and Ant Design.

0 comments on commit edd11c4

Please sign in to comment.