Skip to content

Commit f9dff5c

Browse files
committed
update README
1 parent 2de859e commit f9dff5c

File tree

2 files changed

+40
-72
lines changed

2 files changed

+40
-72
lines changed

README.md

Lines changed: 40 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,18 @@ You can use Async as a self-hosted communication app for your team. You can also
5252
- Server-side rendering for fast initial load and SEO.
5353
- User authentication with Passwordless, cookie, and session.
5454
- Production-ready Express server with compression, parser, and helmet.
55-
- Transactional emails (`AWS SES`): welcome, team invitation, and payment.
56-
- Adding email addresses to newsletter lists (`Mailchimp`): new users, paying users.
57-
- File upload, load, and deletion (`AWS S3`) with pre-signed request for: Posts, Team Profile, and User Profile.
55+
- Transactional emails (`AWS SES`): welcome, login, and team invitation.
56+
- File upload, load, and deletion (`AWS S3`) with pre-signed request for: Comment, Message, Team Profile, and User Profile.
5857
- Websockets with socket.io v3.
5958
- Opinionated architecture:
6059
- keeping babel and webpack configurations under the hood,
6160
- striving to minimize number of configurations,
62-
- `withAuth` HOC to pass user prop and control user access to pages,
6361
- HOC extensions `MyApp` and `MyDocument`
6462
- server-side rendering with `Material-UI`,
6563
- model-specific components in addition to common components.
6664
- Universally-available environmental variables at runtime.
6765
- Custom logger (configure what _not_ to print in production).
68-
- Useful components for any web app: `ActiveLink`, `Confirm`, `Notifier`, `MenuWithLinks`, and more.
69-
- Analytics with `Google Analytics`.
66+
- Useful components for any web app: `Confirmer`, `Notifier`, `Loading`, `MenuWithLinks`, and more.
7067
- Production-ready, scalable architecture:
7168
- `app` - user-facing web app with Next/Express server, responsible for rendering pages (either client-side or server-side rendered). `app` sends requests via API methods to `api` Express server.
7269
- `api` - server-only code, Express server, responsible for processing requests for internal and external API infrastructures.
@@ -78,7 +75,7 @@ You can use Async as a self-hosted communication app for your team. You can also
7875

7976
#### Running `api` locally:
8077

81-
- Before running, create a `.env` file inside the `api` folder with the environmental variables as shown below. These variables are also listed in [`.env.example`](https://github.com/async-labs/saas/blob/master/saas/api/.env.example), which you can use as a template to create your own `.env` file inside the `api` foler.
78+
- Before running, create a `.env` file inside the `api` folder with the environmental variables as shown below.
8279

8380
`api/.env`:
8481

@@ -88,57 +85,46 @@ You can use Async as a self-hosted communication app for your team. You can also
8885
MONGO_URL=
8986
SESSION_NAME=
9087
SESSION_SECRET=
91-
COOKIE_DOMAIN=
92-
93-
# Used in api/server/google.ts
94-
GOOGLE_CLIENTID=
95-
GOOGLE_CLIENTSECRET=
9688
9789
# Used in api/server/aws-s3.ts and api/server/aws-ses.ts
9890
AWS_REGION=
9991
AWS_ACCESSKEYID=
10092
AWS_SECRETACCESSKEY=
101-
102-
# Used in api/server/models/Invitation.ts and api/server/models/User.ts
103-
EMAIL_SUPPORT_FROM_ADDRESS=
104-
105-
# Used in api/server/mailchimp.ts
106-
MAILCHIMP_API_KEY=
107-
MAILCHIMP_REGION=
108-
MAILCHIMP_SAAS_ALL_LIST_ID=
109-
93+
BUCKET_FOR_FILES=
94+
95+
# Used in api/server/passwordless.tx and api/server/models/User.ts
96+
FROM_EMAIL_ADDRESS=
97+
11098
----------
111-
# All env variables above this line are needed for successful user signup
99+
# All env variables above this line are required for successful user signup
112100
113101
# Used in api/server/stripe.ts
114-
STRIPE_TEST_SECRETKEY=sk_test_xxxxxx
115-
STRIPE_LIVE_SECRETKEY=sk_live_xxxxxx
116-
117-
STRIPE_TEST_PLANID=plan_xxxxxx
118-
STRIPE_LIVE_PLANID=plan_xxxxxx
119-
120-
STRIPE_LIVE_ENDPOINTSECRET=whsec_xxxxxx
102+
STRIPE_TEST_SECRET_KEY=
103+
STRIPE_LIVE_SECRET_KEY=
104+
STRIPE_TEST_PRICE_ID=
105+
STRIPE_LIVE_PRICE_ID=
106+
STRIPE_LIVE_ENDPOINT_SECRET=
121107
122108
# Optionally determine the URL
123-
URL_APP="http://localhost:3000"
124-
URL_API="http://localhost:8000"
125-
PRODUCTION_URL_APP="https://saas-app.async-await.com"
126-
PRODUCTION_URL_API="https://saas-api.async-await.com"
109+
URL_APP="https://localhost:3000"
110+
PRODUCTION_URL_APP="https://1.async-await.com"
111+
API_SERVER_ENDPOINT="http://localhost:8000"
112+
PRODUCTION_API_SERVER_ENDPOINT="https://api-xphxggip.async-await.com"
113+
114+
# Used in api/server/api/index.ts
115+
ENCRYPTION_KEY=
116+
127117
```
128118

129119
- Your `.env` file file _must_ have values for the `required` variables. To use all features and third-party integrations, also add the `optional` variables.
130-
131-
- IMPORTANT: do not publish your actual values for environmentable variables in `.env.example`; this file is public and only meant to show you how your `.env` should look.<br/>
132120

133-
- IMPORTANT: use your values for `PRODUCTION_URL_APP` and `PRODUCTION_URL_API`. These are values for domain name that you own.
121+
- IMPORTANT: use your values for `PRODUCTION_URL_APP` and `PRODUCTION_API_SERVER_ENDPOINT`. These are values for domain name that you own.
134122

135123
- IMPORTANT: The above environmental variables are available on the server only. You should add your `.env` file to `.gitignore` inside the `api` folder so that your secret keys are not stored on a remote Github repo.
136124

137125
- To get value for `MONGO_URL_TEST`, we recommend you use a [free MongoDB at MongoDB Atlas](https://docs.atlas.mongodb.com/) or [$15/month MongoDB at Digital Ocean](https://www.digitalocean.com/products/managed-databases-mongodb/)
126+
138127
- Specify your own name and secret keys for Express session: [SESSION_NAME](https://github.com/expressjs/session#name) and [SESSION_SECRET](https://github.com/expressjs/session#express)
139-
- Get `GOOGLE_CLIENTID` and `GOOGLE_CLIENTSECRET` by following the [official OAuth tutorial](https://developers.google.com/identity/sign-in/web/sign-in#before_you_begin). <br/>
140-
Important: For Google OAuth app, callback URL is: http://localhost:8000/oauth2callback <br/>
141-
Important: You have to enable Google+ API in your Google Cloud Platform account.
142128

143129
- Once `.env` is created, you can run the `api` app. Navigate to the `api` folder, run `yarn install` to add all packages, then run the command below:
144130
```
@@ -150,33 +136,30 @@ You can use Async as a self-hosted communication app for your team. You can also
150136

151137
- Navigate to the `app` folder, run `yarn` to add all packages, then run `yarn dev` and navigate to `http://localhost:3000`:
152138

153-
- A `.env` file in the `app` folder is not required to run, but you can create one to override the default variables. The environmental variables for `.env` in the `app` folder are shown below. You can also refer [`.env.example`](https://github.com/async-labs/saas/blob/master/saas/app/.env.example) for creating your own `.env` file in the `app` folder.<br/>
139+
- A `.env` file in the `app` folder is not required to run, but you can create one to override the default variables. The environmental variables for `.env` in the `app` folder are shown below.<br/>
154140

155141
```
142+
NEXT_PUBLIC_URL_APP="http://localhost:3000"
143+
NEXT_PUBLIC_PRODUCTION_URL_APP="https://1.async-await.com"
144+
145+
NEXT_PUBLIC_API_SERVER_ENDPOINT="http://localhost:8000"
146+
NEXT_PUBLIC_PRODUCTION_API_SERVER_ENDPOINT="https://api-xphxggip.async-await.com"
147+
156148
NEXT_PUBLIC_STRIPE_TEST_PUBLISHABLEKEY="pk_test_xxxxxxxxxxxxxxx"
157149
NEXT_PUBLIC_STRIPE_LIVE_PUBLISHABLEKEY="pk_live_xxxxxxxxxxxxxxx"
158150
159-
NEXT_PUBLIC_BUCKET_FOR_POSTS=
160-
NEXT_PUBLIC_BUCKET_FOR_TEAM_AVATARS=
161-
NEXT_PUBLIC_BUCKET_FOR_TEAM_LOGOS=
162-
163-
NEXT_PUBLIC_URL_APP="http://localhost:3000"
164-
NEXT_PUBLIC_URL_API="http://localhost:8000"
165-
NEXT_PUBLIC_PRODUCTION_URL_APP=
166-
NEXT_PUBLIC_PRODUCTION_URL_API=
167-
168151
NEXT_PUBLIC_API_GATEWAY_ENDPOINT=
169-
NEXT_PUBLIC_GA_MEASUREMENT_ID=
170-
```
152+
NEXT_PUBLIC_ENCRYPTION_KEY_FOR_EXTERNAL_SERVICES=
171153
172-
- IMPORTANT: do not publish your actual values for environmentable variables in `.env.example`; this file is public and only meant to show you how your `.env` should look.<br/>
154+
NEXT_TELEMETRY_DISABLED=1
155+
156+
```
173157

174-
- IMPORTANT: use your values for `PRODUCTION_URL_APP` and `PRODUCTION_URL_API`. These are values for domain name that you own.
158+
- IMPORTANT: use your values for `NEXT_PUBLIC_PRODUCTION_URL_APP` and `NEXT_PUBLIC_PRODUCTION_API_SERVER_ENDPOINT`. These are values for domain name that you own.
175159

176-
- To get `NEXT_PUBLIC_GA_MEASUREMENT_ID`, set up Google Analytics and follow [these instructions](https://support.google.com/analytics/answer/1008080?hl=en) to find your tracking ID.
177160
- To get `NEXT_PUBLIC_STRIPE_TEST_PUBLISHABLEKEY`, go to your Stripe dashboard, click `Developers`, then click `API keys`.
178161

179-
- For successful file uploading, make sure your buckets have proper CORS configuration. Go to your AWS account, find your bucket, go to `Permissions > CORS configuration`, add:
162+
- For successful file uploading, make sure your AWS bucket has the proper CORS configuration. Go to your AWS account, find your bucket, go to `Permissions > CORS configuration`, add:
180163

181164
```
182165
[
@@ -193,7 +176,7 @@ You can use Async as a self-hosted communication app for your team. You can also
193176
],
194177
"AllowedOrigins":[
195178
"http://localhost:3000",
196-
"https://saas-app.async-await.com"
179+
"https://1.async-await.com"
197180
],
198181
"ExposeHeaders":[
199182
"ETag",
@@ -233,7 +216,7 @@ We give detailed instructions inside Chapter 9 and 10 of our SaaS Boilerplate bo
233216
- [MongoDB](https://github.com/mongodb/mongo)
234217
- [Typescript](https://github.com/Microsoft/TypeScript)
235218

236-
For more detail, check `package.json` files in both `app` and `api` folders and project's root.
219+
For more detail, check `package.json` files in both `app` and `api` folders.
237220

238221
To customize styles, check [this guide](https://github.com/async-labs/builderbook#add-your-own-styles).
239222

api/README.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)