Skip to content

Commit 5f7fe23

Browse files
authored
chore: Add latest TypeScript feathers chat from the guide (#231)
1 parent 6304937 commit 5f7fe23

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+936
-30920
lines changed

.github/workflows/nodejs.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@ name: CI
33
on: [push, pull_request]
44

55
jobs:
6-
build:
7-
6+
feathers-chat-ts:
87
runs-on: ubuntu-latest
98

109
strategy:
1110
matrix:
12-
node-version: [13.x]
11+
node-version: [18.x]
1312

1413
steps:
1514
- uses: actions/checkout@v2
1615
- name: Use Node.js ${{ matrix.node-version }}
1716
uses: actions/setup-node@v1
1817
with:
1918
node-version: ${{ matrix.node-version }}
20-
- run: npm install
21-
- run: npm test
22-
env:
23-
CI: true
19+
- name: Install and run tests
20+
working-directory: ./feathers-chat-ts
21+
run: |
22+
npm install
23+
npm test

README.md

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@
66
77
## About
88

9-
This repository includes the TypeScript and JavaScript API server from the [official Feathers chat guide](https://dove.feathersjs.com/guides/basics/generator.html) as well as chat frontend examples for different frameworks.
9+
This repository includes the server application from the [official Feathers chat guide](https://dove.feathersjs.com/guides/basics/generator.html) as well as chat frontend examples for different frameworks.
1010

1111
## API server
1212

1313
### TypeScript
1414

15-
The TypeScript version of the chat API server can be found in the [typescript folder](./typescript/). To start it install the dependencies like this:
15+
The TypeScript version of the chat API server can be found in the [feathers-chat-ts](./feathers-chat-ts/). To start it install the dependencies like this:
1616

1717
```
18-
cd typescript
18+
cd feathers-chat-ts
1919
npm install
2020
```
2121

22-
Then compile the source code and run the database migration which will initialize an SQLite datbase in the `feathers-chat.sqlite` file.
22+
Then compile the source code and run the database migration which will initialize an SQLite database in the `feathers-chat.sqlite` file.
2323

2424
```
2525
npm run compile
@@ -38,44 +38,17 @@ Or in development mode with
3838
npm run dev
3939
```
4040

41-
### JavaScript
42-
43-
The JavaScript version of the chat API server can be found in the [javascript folder](./javascript/). To start it install the dependencies like this:
44-
45-
```
46-
cd javascript
47-
npm install
48-
```
49-
50-
Then run the database migration which will initialize an SQLite datbase in the `feathers-chat.sqlite` file.
51-
52-
```
53-
npm run migrate
54-
```
55-
56-
It can now be started with:
57-
58-
```
59-
npm start
60-
```
61-
62-
Or in development mode with
63-
64-
```
65-
npm run dev
66-
```
41+
Now go to [http://localhost:30303](http://localhost:30303) to start chatting 🕊️
6742

6843
## Frontend
6944

7045
### Plain JavaScript
7146

72-
A plain JavaScript frontend can be found in the [public](./public/) folder which is hosted statically by both, the TypeScript and JavaScript [api server](#api-server).
47+
A plain JavaScript frontend can be found in the [public](./public/) folder which is hosted statically by the [api server examples](#api-server).
7348

7449
### React
7550

76-
The React chat frontend example in the [react](./react/) folder uses create-react-app, TypeScript and the typed client available in the [TypeScript API server](#typescript).
77-
78-
The TypeScript API server needs to be compiled and then running in order for this example to work.
51+
TBD
7952

8053
### VueJS
8154

typescript/config/custom-environment-variables.json renamed to feathers-chat-ts/config/custom-environment-variables.json

File renamed without changes.
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
},
1212
"sqlite": {
1313
"client": "sqlite3",
14-
"connection": "../feathers-chat.sqlite",
14+
"connection": "./feathers-chat.sqlite",
1515
"useNullAsDefault": true
1616
},
1717
"authentication": {
1818
"entity": "user",
1919
"service": "users",
20-
"secret": "YhX43+qw8bxlXRS5VljWrS80Z71kW5ZF",
20+
"secret": "l5GBmnEYr9TsQbUXXtkyMJTwW6Yu2wJV",
2121
"authStrategies": [
2222
"jwt",
2323
"local"
@@ -33,6 +33,12 @@
3333
"local": {
3434
"usernameField": "email",
3535
"passwordField": "password"
36+
},
37+
"oauth": {
38+
"github": {
39+
"key": "<Client ID>",
40+
"secret": "<Client secret>"
41+
}
3642
}
3743
}
3844
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// For more information about this file see https://dove.feathersjs.com/guides/cli/databases.html
12
import { app } from './src/app'
23

34
// Load our database connection info from the app configuration

typescript/migrations/20221026195707_user.ts renamed to feathers-chat-ts/migrations/20230104220356_user.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// For more information about this file see https://dove.feathersjs.com/guides/cli/knexfile.html
12
import type { Knex } from 'knex'
23

34
export async function up(knex: Knex): Promise<void> {

typescript/migrations/20221026195709_authentication.ts renamed to feathers-chat-ts/migrations/20230104220406_authentication.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ export async function up(knex: Knex): Promise<void> {
55
table.dropColumn('text')
66
table.string('email').unique()
77
table.string('password')
8+
9+
table.string('githubId')
810
})
911
}
1012

@@ -13,5 +15,7 @@ export async function down(knex: Knex): Promise<void> {
1315
table.string('text')
1416
table.dropColumn('email')
1517
table.dropColumn('password')
18+
19+
table.dropColumn('githubId')
1620
})
1721
}

0 commit comments

Comments
 (0)