A personal diary web application with sentiment analysis.
backend/
- Handles getting and sending data to the MongoDB database. Also sends data to the models to preform sentiment analysis.
frontend/
- Provides AAA using Auth0. Allows user to view, add, and update diary entries.
models/
- Does sentiment analysis.
proxy/
- Does a reverse proxy and provides tls
using NGINX.
-
Setup MongoDB:
- Create a MongoDB account here: https://www.mongodb.com/.
- Create a collection called
diary_entries
and a database called:diary_entries_db
.
-
Setup Auth0:
- Create an Auth0 account here: https://auth0.com/.
- Create a new Single Page Web Application.
-
Set config files:
- Create
backend/config.json
:
{ "mongodb": { "username": "USERNAME", "password": "PASSWORD", "collection": "diary_entries", "url": "MONGO_ENDPOINT.mongodb.net" } }
- Create
frontend/src/assets/config.json
:
{ "auth0": { "domain": "AUTH0_ENDPOINT.auth0.com", "client_id": "CLIENT_ID" } }
- Create
models/config.json
{ "mongodb": { "username": "USERNAME", "password": "PASSWORD", "collection": "diary_entries", "url": "MONGO_ENDPOINT.mongodb.net" } }
- Create
-
Create a certificate authority:
- CA with OpenSSL, add this to your browser or OS.
openssl req -now -nodes -out DOMAIN_NAME.csr -newkey rsa:4096 -keyout DOMAIN_NAME.key -subj 'CN=COMMON_NAME/C=COUNTRY/ST=STATE/L=LOCATION/O=ORGANIZATION'
openssl x509 -req -in DOMAIN_NAME.csr -CA /PATH/TO/CA/ca.pem -CAkey /PATH/TO/CA/ca.key -CAcreateserial -out DOMAIN_NAME.crt -days 1095 -sha256 -extfile DOMAIN_NAME.ext
-
Add the frontend, backend, and models path into your
/etc/hosts
. Format should follow:127.0.0.1\tyour_subject_alt.your_fake_domain.com
-
Create a wildcard certificate that will be used for the frontend, backend, and models. Save this in
proxy/tls
. -
Build with
docker-compose build
-
Launch with
docker-compose up