Skip to content

Commit 9bdbf84

Browse files
committed
final
1 parent b5ebc65 commit 9bdbf84

30 files changed

+12563
-95
lines changed

Diff for: .gitignore

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
25+
#amplify
26+
amplify/\#current-cloud-backend
27+
amplify/.config/local-*
28+
amplify/backend/amplify-meta.json
29+
amplify/backend/awscloudformation
30+
build/
31+
dist/
32+
node_modules/
33+
awsconfiguration.json
34+
35+
amplify/team-provider-info.json

Diff for: .graphqlconfig.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
projects:
2+
writewithme:
3+
schemaPath: src/graphql/schema.json
4+
includes:
5+
- src/graphql/**/*.js
6+
excludes:
7+
- ./amplify/**
8+
extensions:
9+
amplify:
10+
codeGenTarget: javascript
11+
generatedFileName: ''
12+
docsFilePath: src/graphql
13+
graphQLApiId: bh2ztsfsjzdpno6ndpbud3bh7e
14+
extensions:
15+
amplify:
16+
version: 3

Diff for: README.md

+39-95
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,62 @@
1-
Contribution: 2021-02-06 20:00
1+
# ✍️ Write with me
22

3-
Contribution: 2021-02-06 20:01
3+
A real-time collaborative blog post editor built with GraphQL, React, React Markdown, & AWS AppSync.
44

5-
Contribution: 2021-02-06 20:02
5+
This repo goes along with the medium post "How to Build a Real-time Collaborative Markdown Editor with React Hooks, GraphQL & AWS AppSync". Click [here](https://medium.com/open-graphql/how-to-build-a-real-time-collaborative-markdown-editor-with-react-hooks-graphql-aws-appsync-dc0c121683f4) to check it out.
66

7-
Contribution: 2021-02-06 20:03
7+
> Try it out at [www.writewithme.dev](https://www.writewithme.dev/#/)
88
9-
Contribution: 2021-02-06 20:04
9+
![](writewithme.gif)
1010

11-
Contribution: 2021-02-06 20:05
11+
### Base schema
1212

13-
Contribution: 2021-02-06 20:06
13+
Here's the base schema:
1414

15-
Contribution: 2021-02-06 20:07
15+
```graphql
16+
type Post @model {
17+
id: ID!
18+
clientId: ID!
19+
markdown: String!
20+
title: String!
21+
createdAt: String
22+
}
23+
```
1624

17-
Contribution: 2021-02-06 20:08
25+
We have a `Post` type that has a few properties. The most important property is the markdown. This is where we are keeping up with the state of the post.
1826

19-
Contribution: 2021-02-06 20:09
27+
We also have a `clientId` to properly handle GraphQL subscriptions on the client.
2028

21-
Contribution: 2021-02-07 20:00
29+
## Launching the app
2230

23-
Contribution: 2021-02-08 20:00
31+
Deploy this fullstack app with a single click to the Amplify Console:
2432

25-
Contribution: 2021-02-08 20:01
33+
[![amplifybutton](https://oneclick.amplifyapp.com/button.svg)](https://console.aws.amazon.com/amplify/home#/deploy?repo=https://github.com/dabit3/write-with-me)
2634

27-
Contribution: 2021-02-08 20:02
2835

29-
Contribution: 2021-02-08 20:03
36+
### Run locally with the Amplify CLI
3037

31-
Contribution: 2021-02-08 20:04
38+
1. Clone the repo
3239

33-
Contribution: 2021-02-09 20:00
40+
```sh
41+
git clone https://github.com/dabit3/write-with-me.git
42+
```
3443

35-
Contribution: 2021-02-09 20:01
44+
2. Change into the directory & install dependencies
3645

37-
Contribution: 2021-02-09 20:02
46+
```sh
47+
cd write-with-me
3848

39-
Contribution: 2021-02-09 20:03
49+
npm install
50+
```
4051

41-
Contribution: 2021-02-09 20:04
52+
3. Initialize the Amplify backend
4253

43-
Contribution: 2021-02-09 20:05
54+
```sh
55+
amplify init
56+
```
4457

45-
Contribution: 2021-02-10 20:00
46-
47-
Contribution: 2021-02-10 20:01
48-
49-
Contribution: 2021-02-11 20:00
50-
51-
Contribution: 2021-02-11 20:01
52-
53-
Contribution: 2021-02-11 20:02
54-
55-
Contribution: 2021-02-11 20:03
56-
57-
Contribution: 2021-02-11 20:04
58-
59-
Contribution: 2021-02-11 20:05
60-
61-
Contribution: 2021-02-11 20:06
62-
63-
Contribution: 2021-02-11 20:07
64-
65-
Contribution: 2021-02-11 20:08
66-
67-
Contribution: 2021-02-12 20:00
68-
69-
Contribution: 2021-02-12 20:01
70-
71-
Contribution: 2021-02-12 20:02
72-
73-
Contribution: 2021-02-13 20:00
74-
75-
Contribution: 2021-02-13 20:01
76-
77-
Contribution: 2021-02-13 20:02
78-
79-
Contribution: 2021-02-13 20:03
80-
81-
Contribution: 2021-02-13 20:04
82-
83-
Contribution: 2021-02-13 20:05
84-
85-
Contribution: 2021-02-13 20:06
86-
87-
Contribution: 2021-02-13 20:07
88-
89-
Contribution: 2021-02-13 20:08
90-
91-
Contribution: 2021-02-13 20:09
92-
93-
Contribution: 2021-02-13 20:10
94-
95-
Contribution: 2021-02-13 20:11
96-
97-
Contribution: 2021-02-13 20:12
98-
99-
Contribution: 2021-02-14 20:00
100-
101-
Contribution: 2021-02-14 20:01
102-
103-
Contribution: 2021-02-14 20:02
104-
105-
Contribution: 2021-02-14 20:03
106-
107-
Contribution: 2021-02-14 20:04
108-
109-
Contribution: 2021-02-14 20:05
110-
111-
Contribution: 2021-02-14 20:06
112-
113-
Contribution: 2021-02-14 20:07
114-
115-
Contribution: 2021-02-15 20:00
116-
117-
Contribution: 2021-02-15 20:01
58+
4. Push the application into your account
11859

60+
```sh
61+
amplify push
62+
```

Diff for: amplify/.config/project-config.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"projectName": "writewithme",
3+
"version": "3.0",
4+
"frontend": "javascript",
5+
"javascript": {
6+
"framework": "react",
7+
"config": {
8+
"SourceDir": "src",
9+
"DistributionDir": "build",
10+
"BuildCommand": "npm run-script build",
11+
"StartCommand": "npm run-script start"
12+
}
13+
},
14+
"providers": [
15+
"awscloudformation"
16+
]
17+
}

Diff for: amplify/backend/api/writewithme/parameters.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"AppSyncApiName": "writewithme",
3+
"DynamoDBBillingMode": "PAY_PER_REQUEST",
4+
"APIKeyExpirationEpoch": 1584032770
5+
}

Diff for: amplify/backend/api/writewithme/schema.graphql

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
type Post @model {
2+
id: ID!
3+
clientId: ID!
4+
markdown: String!
5+
title: String!
6+
createdAt: String
7+
}
8+
9+
type Subscription {
10+
onUpdatePostWithId(id: ID!): Post
11+
@aws_subscribe(mutations: ["updatePost"])
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"AWSTemplateFormatVersion": "2010-09-09",
3+
"Description": "An auto-generated nested stack.",
4+
"Metadata": {},
5+
"Parameters": {
6+
"AppSyncApiId": {
7+
"Type": "String",
8+
"Description": "The id of the AppSync API associated with this project."
9+
},
10+
"AppSyncApiName": {
11+
"Type": "String",
12+
"Description": "The name of the AppSync API",
13+
"Default": "AppSyncSimpleTransform"
14+
},
15+
"env": {
16+
"Type": "String",
17+
"Description": "The environment name. e.g. Dev, Test, or Production",
18+
"Default": "NONE"
19+
},
20+
"S3DeploymentBucket": {
21+
"Type": "String",
22+
"Description": "The S3 bucket containing all deployment assets for the project."
23+
},
24+
"S3DeploymentRootKey": {
25+
"Type": "String",
26+
"Description": "An S3 key relative to the S3DeploymentBucket that points to the root\nof the deployment directory."
27+
}
28+
},
29+
"Resources": {
30+
"EmptyResource": {
31+
"Type": "Custom::EmptyResource",
32+
"Condition": "AlwaysFalse"
33+
}
34+
},
35+
"Conditions": {
36+
"HasEnvironmentParameter": {
37+
"Fn::Not": [
38+
{
39+
"Fn::Equals": [
40+
{
41+
"Ref": "env"
42+
},
43+
"NONE"
44+
]
45+
}
46+
]
47+
},
48+
"AlwaysFalse": {
49+
"Fn::Equals": [
50+
"true",
51+
"false"
52+
]
53+
}
54+
},
55+
"Outputs": {
56+
"EmptyOutput": {
57+
"Description": "An empty output. You may delete this if you have at least one resource above.",
58+
"Value": ""
59+
}
60+
}
61+
}

Diff for: amplify/backend/api/writewithme/transform.conf.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"Version": 4,
3+
"ElasticsearchWarning": true
4+
}

Diff for: amplify/backend/backend-config.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"api": {
3+
"writewithme": {
4+
"service": "AppSync",
5+
"providerPlugin": "awscloudformation",
6+
"output": {
7+
"authConfig": {
8+
"additionalAuthenticationProviders": [],
9+
"defaultAuthentication": {
10+
"authenticationType": "API_KEY",
11+
"apiKeyConfig": {
12+
"description": "",
13+
"apiKeyExpirationDays": "365"
14+
}
15+
}
16+
}
17+
}
18+
}
19+
},
20+
"function": {}
21+
}

Diff for: package.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "rt-react-md",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"aws-amplify": "^1.1.23",
7+
"aws-amplify-react": "^2.3.3",
8+
"debounce": "^1.2.0",
9+
"glamor": "^2.20.40",
10+
"react": "^16.8.6",
11+
"react-dom": "^16.8.6",
12+
"react-markdown": "^4.0.6",
13+
"react-router-dom": "^5.0.0",
14+
"react-scripts": "2.1.8",
15+
"uuid": "^3.3.2"
16+
},
17+
"scripts": {
18+
"start": "react-scripts start",
19+
"build": "react-scripts build",
20+
"test": "react-scripts test",
21+
"eject": "react-scripts eject"
22+
},
23+
"eslintConfig": {
24+
"extends": "react-app"
25+
},
26+
"browserslist": [
27+
">0.2%",
28+
"not dead",
29+
"not ie <= 11",
30+
"not op_mini all"
31+
]
32+
}

Diff for: public/favicon.ico

13.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)