A repository containing a starter MongoDB, Express.js, Angular, and Node.js (MEAN) project for full-stack web development
- Start by installing Docker if you have not already done so: https://docs.docker.com/get-docker/
- NOTE for Windows users: I highly recommend that you enable the Windows Subsystem for Linux Version 2 (WSL2) in Windows, and install a default Linux
distribution (like Ubuntu) prior to
installing Docker. Docker will run much easier on all editions of Windows 10 if you perform this step first
- This article will walk you through enabling WSL2: https://www.omgubuntu.co.uk/how-to-install-wsl2-on-windows-10
- If your BIOS does not have virtualization enabled, you may encounter an error enabling WSL 2. This article can help you enable virtualization on your computer: https://support.bluestacks.com/hc/en-us/articles/115003174386-How-to-enable-Virtualization-VT-on-Windows-10-for-BlueStacks-4
- Once you have Docker installed, set Ubuntu 20 to be your default distribution by opening a command prompt as administrator and running the
following command:
wsl -s Ubuntu-20.04
- Once your default distribution is set, verify Docker is configured correctly to use WSL 2 and your default WSL distro: https://docs.docker.com/docker-for-windows/wsl/
- Check the "Settings > General" and ""Settings > Resources > WSL Integration" sections of your Docker installation and compare them to the screenshots on this website
- This article will walk you through enabling WSL2: https://www.omgubuntu.co.uk/how-to-install-wsl2-on-windows-10
- NOTE for Windows users: I highly recommend that you enable the Windows Subsystem for Linux Version 2 (WSL2) in Windows, and install a default Linux
distribution (like Ubuntu) prior to
installing Docker. Docker will run much easier on all editions of Windows 10 if you perform this step first
- After installing Docker, start the necessary containers for the project by running the
scripts/start_container
script appropriate for your operating systemscripts/start_container
for macOS and Linuxscripts/start_container.bat
for Windows
- Once the Docker containers have started, attach to the development container by running the
scripts/attach_container
script appropriate for your operating systemscripts/attach_container
for macOS and Linuxscripts/attach_container.bat
for Windows
- Navigate to the
/app/meantemplate
directory. This will be where the source code of the project will be shared into the Docker container - Run
yarn install
to install server dependencies. - Run
npm run start:server
to start the development server.- You can access the Express.js API via http://localhost:9000 on your local machine
- In a new terminal, run another instance of
scripts/attach_container
and runnpm run start:client
to run the development client application inside the/app/meantemplate
directory.- You can access the Angular application via http://localhost:8080 in a browser on your local machine
Run gulp build
for building and gulp buildcontrol:heroku
to deploy to Heroku.
- Running
npm test:client
will run the client unit tests. - Running
npm test:server
will run the server unit tests. - Running
npm test:e2e
will run the e2e tests using Protractor.
If you see an error from Heroku saying "match is not defined", try running these commands from your dist directory:
heroku config:set NODE_MODULES_CACHE=false
git commit -am 'disable node_modules cache' --allow-empty
git push heroku master
heroku config:set NODE_MODULES_CACHE=true
If you see a message during yarn install
saying "info There appears to be trouble with your network connection. Retrying...", followed by the error
"ESOCKETTIMEDOUT", cancel the yarn install and try it again. If this does not help, try restarting Docker.
This project is based, in part, on the Yeoman Angular Full-Stack Generator
This software is licensed under the FreeBSD License