Updated tutorial setup (markdown)
+11
-8
@@ -21,13 +21,13 @@ Familiarity with at least some of these technologies is a great advantage when u
|
||||
|
||||
You'll also need an email address (if you use google, you'll need to enable "[less secure apps](https://support.google.com/accounts/answer/6010255?hl=en#zippy=%2Cif-less-secure-app-access-is-off-for-your-account%2Cif-less-secure-app-access-is-on-for-your-account)" so external apps can access it). I've only used this site with google so far, but feel free to experiment with other mail hosts. What's important is that you have their SMTP's web address.
|
||||
|
||||
For deployment you'll also need a server (such as those provided by [linode](https://www.linode.com/)), and a domain name pointing at that server. Add some "A records" to your domain's DNS records such as "news" and "auth" which point to the same server as the main record. You'll need to add a TXT record to your DNS as well, for the domain "auth":
|
||||
For deployment you'll also need a server (such as those provided by [linode](https://www.linode.com/)), and a domain name pointing at that server. Add some "A records" to your domain's DNS records such as "news", "auth" and "chat" which point to the same server as the main record. You'll need to add a TXT record to your DNS as well, for the domain "auth":
|
||||
|
||||
```
|
||||
"v=spf1 a ~all"
|
||||
```
|
||||
|
||||
This is primarily so the auth server can send emails to validate user email addresses (if you use linode as I suggested, you'll have to open a support ticket to allow your user account to send emails via the email ports. This is linode's restriction against spammers).
|
||||
This is primarily so the auth-server can send emails to validate user email addresses (if you use linode as I suggested, you'll have to open a support ticket to allow your user account to send emails via the email ports. This is linode's restriction against spammers).
|
||||
|
||||
Depending on your jurisdiction, you'll also need a physical mailing address (blame America's [CAN-SPAM](https://en.wikipedia.org/wiki/CAN-SPAM_Act_of_2003) act).
|
||||
|
||||
@@ -70,6 +70,10 @@ Email SMTP (smtp.example.com):
|
||||
Email Address (foobar@example.com):
|
||||
Email Password (foobar):
|
||||
Physical Mailing Address:
|
||||
Chat Name (chat):
|
||||
Chat Web Address (chat.example.com):
|
||||
Chat DB Username (chat):
|
||||
Chat DB Password (blastoise):
|
||||
Database Root Password (password):
|
||||
Database Timezone (Australia/Sydney):
|
||||
Access Token Secret (<random>):
|
||||
@@ -90,6 +94,7 @@ Auth Web Address (auth.example.com):
|
||||
Email SMTP (smtp.example.com):
|
||||
Email Address (foobar@example.com):
|
||||
Email Password (foobar):
|
||||
Chat Web Address (chat.example.com):
|
||||
Default Admin User:
|
||||
Default Admin Pass:
|
||||
```
|
||||
@@ -112,13 +117,13 @@ For development, you'll need Nodejs and MariaDB installed and working on your ma
|
||||
|
||||
First, run `sql/create_database.sql` on your mariaDB instance - this will create a database called `template` and a user called `template`@`%`.
|
||||
|
||||
Next, copy `.envdev` into a new file called `.env`.
|
||||
Next, copy `.envdev` into a new file called `.env` (`SECRET_ACCESS` should have the value `access`, this is the key for the dev-servers that you're about to connect to).
|
||||
|
||||
Finally, it's time to run `npm run dev` in the console. This will begin the server in dev mode - it'll use the `concurrently` library to run both client and server in the same window, so you don't need two monitor terminals. If all goes well, the server should start pretty quickly, though the client will take a moment to compile.
|
||||
|
||||
When they're both ready, you can access `http://localhost:3001/` in a browser (NOT 3000) and the template site should load.
|
||||
|
||||
At this stage, your brand new website will call out to the `dev-news` server for news postings, so you'll probably get some lorem ipsum, and possibly other content (it's a publicly available server - don't blame me!). You will also be able to signup and log into the `dev-auth` server, but you won't have administration privileges.
|
||||
At this stage, your brand new website will call out to the `dev-news` server for news postings, so you'll probably get some lorem ipsum, and possibly other content (it's a publicly available server - don't blame me!). You will also be able to signup and log into the `dev-auth` server, but you won't have administration privileges. Once you sign up and log into `dev-auth`, you'll have access to `dev-chat` which will appear as a small window in the bottom right of the screen.
|
||||
|
||||
## Setting Up Locally
|
||||
|
||||
@@ -128,8 +133,6 @@ To set up the microservices locally, you'll first need to download them (probabl
|
||||
* News Server: https://github.com/krgamestudios/news-server
|
||||
* Chat Server: https://github.com/krgamestudios/chat-server
|
||||
|
||||
*chat-server is not currently working at the time of writing, but included for completeness.*
|
||||
|
||||
Each one has it's own `configure-script.js` for independent deployment, but in this case copy the `.envdev` file to a new file called `.env` and fill out each field, ensuring that the line `SECRET_ACCESS` matches between every program (including the MERN-template).
|
||||
|
||||
Next, you'll need to open the MERN-template's `webpack.config.js` file, and replace this:
|
||||
@@ -145,7 +148,7 @@ new DefinePlugin({
|
||||
}),
|
||||
```
|
||||
|
||||
With the following (this point the client at the correct localhost ports, notice the change in HTTP protocol):
|
||||
With the following (this point the client at the correct localhost ports; notice the change in HTTP protocol):
|
||||
|
||||
```
|
||||
new DefinePlugin({
|
||||
@@ -158,7 +161,7 @@ new DefinePlugin({
|
||||
}),
|
||||
```
|
||||
|
||||
Finally, open a terminal for each project, point it to the project's directory and run `npm run dev`. Once each one reports that they're listening on a specific port (or when the MERN-template says it's finished compiling), then you can visit the development server at `http://localhost:3001/`.
|
||||
Finally, open a terminal for each project, point it to the project's directory and run `npm run dev`. Once each one reports that they're listening on a specific port (or when the MERN-template says it's finished compiling), then you can visit the local servers at `http://localhost:3001/`.
|
||||
|
||||
From here, you can log into the default admin account if you chose to create one, create local accounts and post local news, etc.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user