angular-7-starter
angular-7-starter copied to clipboard
Ready to use boilerplate project for Angular applications.
Angular Full Stack
The frontend is generated with Angular CLI. The backend is made from scratch. Whole stack in TypeScript.
Prerequisite
- PHP >= 7: runtime environment
- MongoDB: database
- Slim API: backend framework
- Angular CLI: frontend scaffolding
Uses
- Angular 7+: frontend framework
- Bootstrap: layout and styles
- Font Awesome: icons
Prerequisites
npm i -g @angular/cli
- From project root folder install all the dependencies by running the following command inside your terminal:
npm install
Run the app
Development mode
By running the following command a window will automatically open at localhost:4200. Angular and Express files are being watched. Any change automatically creates a new bundle, restart Express server and reload your browser.
npm run dev
Production mode
To run the project with a production bundle and AOT compilation listening at localhost:3000 run the following command:
npm run prod
Deploy to Heroku
- Go to Heroku and create a new app
- Install Heroku CLI
- Run the following command to login to heroku:
heroku login
- Open the root directory of the project inside your terminal by running:
cd my-project/
- Inside of the project running the following command will creates a new Git repository
git init
- Update your heroku app name by running the following command:
heroku git:remote -a your-app-name
- Download this repo and copy all files into
my-project
folder - Now Edit
.gitignore
and remove line with/dist
text. - Edit
.env
and replace the MongoDB URI with a real remote MongoDB server. You can create a MongoDB server with Heroku or mLab. - Install the dependencies by running the following command:
npm install
- Now build your app by running one of the following command:
ng build -prod
>> or
ng build -aot -prod
- Run the following command
tsc -p server
- Make a new commit and push the changes to heroku by running the following commands:
git add .
git commit -m "Going to Heroku"
git push heroku master
- Now following command will open with your app inside your browser:
heroku open
Running tests
Run the following command inside your terminal to execute the unit tests via Karma.
npm run test
Contributors
A huge thanks to all of our contributors:
Mohamed Meabed 💻 📢 |
Zeeshan Ahmad 💻 🐛 ⚠️ 📖 |
---|
License
The code is available under the MIT license.