This README outlines the details of collaborating on the 8th Mind web application. It runs using 3 sub-applications in parallel:
- Admin - content management system powered by a CodeIgniter backend with a MySQL database
- API - provides REST API access to the MySQL data using ExpressJS
- Frontend - presentation and UI control layer using Ember framework
You will need the following things properly installed
In production:
Deployment servers must have their public keys added to this repository in order to have read access (see Settings). The default configuration assumes deployment on a Linux server with the above packages installed where users can access the sub-applications as follows:
-
Main site: http://8thmind.com
-
Back-end Content Management: http://admin.8thmind.com
-
Content API: http://api.8thmind.com
-
git clone <repository-url>this repository
- copy web.env.production or equivalent to web.env to match your DNS settings
- if a more up-to-date mysqldump is available, replace the one in ./docker-entrypoint-initdb.d/content_portal.sql
- run
docker-compose up -dto start the containers in detached mode
- View all submissions for an article
http://localhost:3000/articles/27/submissions/ - View all submission details
http://localhost:3000/articles/27/submissions/1 - Add submission
http://localhost:3000/articles/27/submissions/new - Add submission asset (url)
http://localhost:3000/articles/27/submissions/1/asset/new - Add submission asset (upload)
http://localhost:3000/articles/27/submissions/1/asset/new - Delete submission
http://localhost:3000/articles/27/submissions/1/ - Delete submission asset
http://localhost:3000/articles/27/submissions/1/asset/2
cd frontendnpm installbower installember build --environment production- configure nginx to serve ./frontend/dist/ (see ./nginx/nginx.conf for sample configuration)
- configure nginx to reverse proxy route admin and API (see ./nginx/virtual.conf for sample configuration)
The default configuration assumes that you are running the latest version of the Docker client on your computer. The applications will be accessible as follows:
- Main site: http://localhost:4200
- Back-end Content Management: http://localhost:8001
- Content API: http://localhost:3000
-
copy web.env.dev or equivalent to web.env
-
if a more up-to-date mysqldump is available, replace the one in ./docker-entrypoint-initdb.d/content_portal.sql
-
run
docker-compose up -dto start the containers in detached mode -
The current docker-compose.yml maps the port for mysql to that of the host machine. This allows development to access the database directly as needed for testing. But, should be blocked by firewall on any production server to prevent outside access.
cd frontendnpm installbower installember serve
When changes have been made to the codebase, this process will allow them to be reflected on a production server:
IMPORTANT: if the mysql container is rebuilt, the database will be repopulated with the data contained in ./docker-entrypoint-initdb.d/content_portal.sql -- if this is not the intended effect, be sure to take precaution to either update the sql with a current mysqldump. In most cases, it is not necessary to restart or rebuild the mysql container.
For the below commands, replace [container] with the container label (either [mysql] for database, [admin] for back-end, or [server] for API) as appropriate:
git pulldocker-compose stop [container]docker-compose rm -f [container]docker-compose up -d
The above can also be accessed by using the rebuild.sh to rebuild a single server, or rebuild-all.sh to rebuild all servers.
git pullcd frontendnpm installbower installember build --environment production