Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

WIP - Feature/web client #6

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
node_modules/
.idea/

.DS_Store

# Logs
*.log
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"tslint-react": "^3.6.0"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"*.{ts,tsx}": [
"prettier --write",
"tslint --fix",
"git add"
Expand All @@ -27,6 +27,9 @@
"pre-commit": "yarn precommit"
}
},
"resolutions": {
"graphql": "14.0.2"
},
"scripts": {
"precommit": "lint-staged",
"server:dev": "yarn workspace @chatify/server dev",
Expand All @@ -39,9 +42,12 @@
"app:android": "yarn workspace @chatify/app android",
"app:start": "yarn workspace @chatify/app start",
"app:xcode": "yarn workspace @chatify/app xcode",
"app:studio": "yarn workspace @chatify/app studio"
"app:studio": "yarn workspace @chatify/app studio",
"web:start": "yarn workspace @chatify/web start",
"web:codegen": "yarn workspace @chatify/web codegen"
},
"dependencies": {
"idx": "^2.5.6",
"rimraf": "^2.6.3",
"tslint-plugin-graphql": "^0.0.6"
}
Expand Down
1 change: 0 additions & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"xcode": "open ios/$npm_package_name.xcodeproj",
"ios": "react-native run-ios",
"update-schema": "cd data && apollo-codegen introspect-schema http://localhost:5000 --output schema.json",
"postinstall": "yarn codegen",
"codegen": "apollo codegen:generate --localSchemaFile=data/schema.json --target=typescript && rm -rf __generated__",
"codegen:watch": "apollo codegen:generate --localSchemaFile=data/schema.json --target=typescript --watch && rm -rf __generated__"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"babel-loader": "^8.0.6",
"bcryptjs": "^2.4.3",
"dotenv": "^8.0.0",
"graphql": "^14.0.2",
"graphql": "14.0.2",
"graphql-tag": "^2.10.0",
"jsonwebtoken": "^8.4.0",
"mongoose": "^5.3.13",
Expand Down
4 changes: 2 additions & 2 deletions packages/server/src/modules/chat/chatType.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { gql } from 'apollo-server'
import { gql } from 'apollo-server';

export default gql`
type Message {
Expand All @@ -22,4 +22,4 @@ export default gql`
count: Int
edges: [Chat]
}
`
`;
4 changes: 4 additions & 0 deletions packages/server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import { MongoError } from 'mongodb';

dotenv.config();

mongoose.Types.ObjectId.prototype.valueOf = function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GraphQL 14.0.2 issues @jgcmarins graphql/graphql-js#1518

return this.toString();
};

const pubsub = new PubSub();

const server = new ApolloServer({
Expand Down
5 changes: 5 additions & 0 deletions packages/web/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Node Modules
node_modules/

# GraphQL Generated Files!
__generated__/
7 changes: 7 additions & 0 deletions packages/web/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parser": "typescript",
"printWidth": 120,
"semi": true,
"singleQuote": true,
"trailingComma": "all"
}
10 changes: 10 additions & 0 deletions packages/web/@types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
declare module 'react-material-snackbar' {
import * as React from 'react';

interface SnackBarProps {
show: boolean;
timer?: number;
}

export default class SnackBar extends React.Component<SnackBarProps, any> {}
}
24 changes: 24 additions & 0 deletions packages/web/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# React Typescript Boilerplate
[![npm version](https://badge.fury.io/js/react.svg)](https://badge.fury.io/js/react)
<img src="https://cdn-images-1.medium.com/max/1200/1*x6EnTlBhjcyu605VPDysZQ.jpeg"/>

Simple React + Typescript + Webpack boilerplate, without CRA, and also No-JS pattern

## Documentation

Here goes some useful links to get started with this boilerplate

- [Read the react docs!](https://reactjs.org/)
- [Read the TypeScript docs!](https://www.typescriptlang.org/)
- [A Very Nice Article](https://levelup.gitconnected.com/react-typescript-with-webpack-2fceebb8faf)

## How to get started with this boilerplate

### Runnig some commands:

#### First Step Clone the Repo
- `git clone https://github.com/LFSCamargo/react-webpack-ts-boilerplate.git`
#### Second Step Install the Dependencies
- `yarn install or npm install`
#### Third Step Run Webpack
- `yarn start`
Loading