You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40-57Lines changed: 40 additions & 57 deletions
Original file line number
Diff line number
Diff line change
@@ -52,21 +52,18 @@ You can use Async as a self-hosted communication app for your team. You can also
52
52
- Server-side rendering for fast initial load and SEO.
53
53
- User authentication with Passwordless, cookie, and session.
54
54
- 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.
58
57
- Websockets with socket.io v3.
59
58
- Opinionated architecture:
60
59
- keeping babel and webpack configurations under the hood,
61
60
- striving to minimize number of configurations,
62
-
-`withAuth` HOC to pass user prop and control user access to pages,
63
61
- HOC extensions `MyApp` and `MyDocument`
64
62
- server-side rendering with `Material-UI`,
65
63
- model-specific components in addition to common components.
66
64
- Universally-available environmental variables at runtime.
67
65
- 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.
70
67
- Production-ready, scalable architecture:
71
68
-`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.
72
69
-`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
78
75
79
76
#### Running `api` locally:
80
77
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.
82
79
83
80
`api/.env`:
84
81
@@ -88,57 +85,46 @@ You can use Async as a self-hosted communication app for your team. You can also
88
85
MONGO_URL=
89
86
SESSION_NAME=
90
87
SESSION_SECRET=
91
-
COOKIE_DOMAIN=
92
-
93
-
# Used in api/server/google.ts
94
-
GOOGLE_CLIENTID=
95
-
GOOGLE_CLIENTSECRET=
96
88
97
89
# Used in api/server/aws-s3.ts and api/server/aws-ses.ts
98
90
AWS_REGION=
99
91
AWS_ACCESSKEYID=
100
92
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
+
110
98
----------
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
- 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/>
132
120
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.
134
122
135
123
- 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.
136
124
137
125
- 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
+
138
127
- 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.
142
128
143
129
- 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:
144
130
```
@@ -150,33 +136,30 @@ You can use Async as a self-hosted communication app for your team. You can also
150
136
151
137
- Navigate to the `app` folder, run `yarn` to add all packages, then run `yarn dev` and navigate to `http://localhost:3000`:
152
138
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/>
- 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
+
```
173
157
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.
175
159
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.
177
160
- To get `NEXT_PUBLIC_STRIPE_TEST_PUBLISHABLEKEY`, go to your Stripe dashboard, click `Developers`, then click `API keys`.
178
161
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:
180
163
181
164
```
182
165
[
@@ -193,7 +176,7 @@ You can use Async as a self-hosted communication app for your team. You can also
193
176
],
194
177
"AllowedOrigins":[
195
178
"http://localhost:3000",
196
-
"https://saas-app.async-await.com"
179
+
"https://1.async-await.com"
197
180
],
198
181
"ExposeHeaders":[
199
182
"ETag",
@@ -233,7 +216,7 @@ We give detailed instructions inside Chapter 9 and 10 of our SaaS Boilerplate bo
0 commit comments