Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justjapann/twitter-clone-relay
Twitter clone with relay/mongodb/typescript
https://github.com/justjapann/twitter-clone-relay
Last synced: 3 months ago
JSON representation
Twitter clone with relay/mongodb/typescript
- Host: GitHub
- URL: https://github.com/justjapann/twitter-clone-relay
- Owner: justjapann
- Created: 2022-07-08T16:03:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-26T23:24:30.000Z (about 2 years ago)
- Last Synced: 2024-06-30T16:52:57.528Z (5 months ago)
- Language: TypeScript
- Homepage:
- Size: 1.19 MB
- Stars: 15
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Twitter clone with relay
### Technologies
- Typescript
- React
- Graphql
- Relay
- MongoDB
- KoaJS### Notes
- Add a new MONGO_URI to your project
### Run in development mode
- ```yarn install``` to install dependencies
- ```yarn dev:server``` run server and go to localhost:3333/graphql
- ```cd packages/web``` and ```yarn start:dev``` to start web server (localhost/3000)### Images
![feed](https://github.com/justjapann/twitter-clone-relay/blob/main/packages/web/assets/front1.png)
![login](https://github.com/justjapann/twitter-clone-relay/blob/main/packages/web/assets/front2.png)
![register](https://github.com/justjapann/twitter-clone-relay/blob/main/packages/web/assets/front3.png)### Queries
- All posts
```
{
posts {
edges {
node {
id
body
}
cursor
}
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
}
}
```### Mutations
- Create Post
```
mutation{
CreatePost(input: {body: "Body title"}) {
postEdge {
node {
id
body
}
}
error
}
}
```- Update Post
```
mutation{
UpdatePost(input: {id: "123456789", body: "Body title two"}) {
postEdge {
node {
body
}
cursor
}
error
}
}
```- Delete Post
```
mutation{
DeletePost(input: {id: "123456789"}) {
error
success
}
}```
- Create User
```
mutation UserRegisterMutation($input: UserRegisterInput!) {
userRegisterMutation(input: $input){
token
me {
displayName
username
id
password
}
clientMutationId
}
}{
"input": {
"displayName":"japa",
"username": "japa",
"email": "[email protected]",
"password": "japinha",
"clientMutationId": ""
}
}
```- Login User
```
mutation UserLoginMutation($input: UserLoginInput!) {
userLoginMutation(input: $input) {
token
me {
username
password
}
clientMutationId
}
}{
"input": {
"username": "japa",
"password": "japinha",
"clientMutationId": ""
}
}
```