MongoDB, Express, Vue.js & Node.js
WIP
- i18N: fix tests
- Nginx proxy, https
- Perfs
- Security
- JWT: token storage
- JWT: refresh token
- Update browserslist
- Write doc
MongoDB deployment on mLab
-
Create an account and a database
-
Connect to the remote DB then create indexes (because Mongoose autoIndex = false in production):
# within the api container (docker-compose exec api sh) mongo dsxxxxxx.mlab.com:xxxxx/DB_NAME -u DB_USER -p DB_PWD db.foos.createIndex( { "name": 1 }, { unique: true }, { background: true } ) db.users.createIndex( { "sub": 1 }, { unique: true }, { background: true } )
Deploy API on Now.sh
-
Create an account then install
nowglobally -
Add secrets:
now secrets add mevn-stack-node-env "production" now secrets add mevn-stack-host "0.0.0.0" now secrets add mevn-stack-port "3000" now secrets add mevn-stack-mongodb-uri "mongodb://DB_USER:DB_PWD@dsxxxxxx.mlab.com:xxxxx/DB_NAME" now secrets add mevn-stack-google-oauth-client-id "CLIENT_ID.apps.googleusercontent.com" now secrets add mevn-stack-access-token-secret-key "!ChangeMe!" now secrets add mevn-stack-access-token-expires-in "15m" now secrets add mevn-stack-refresh-token-secret-key "!ChangeMe!" now secrets add mevn-stack-refresh-token-expires-in "24h" now secrets add mevn-stack-jwt-issuer "accounts.google.com"
-
Deploy the API:
make deploy-api-now type=[npm|docker] # default value = npm
-
Optional: add a new alias
# alias value is configured in now-npm.js or now-docker.js file make now-alias type=[npm|docker] # default value = npm