Simple angular2 app with python-flask backend (for learning angular2)
-
backend
directory contains the flask backend with simple authentication methods -
frontend
directory contains the angular2 frontend as explained in angular-webpack-starter
-
Clone the repo
git clone --depth 1 https://github.com/ansrivas/angular2-flask.git cd angular2-flask
-
Install and run backend in a terminal
- Server logs are stored in a directory named log_output
cd backend sudo pip install -r requirements.txt python run.py
-
Install frontend related dependencies
- Easiest way to handle node related dependencies is to install nvm
- Once you have node installed, install the project's dependencies
cd front # install global dependencies npm install webpack-dev-server rimraf webpack typescript -g # install project related dependencies npm install # run server npm run server:dev:hmr
-
Navigate to
http://localhost:3000
-
Default credential :
admin:admin
- Build the docker backend
cd backend
docker build --no-cache -t backend/python:latest .
docker run -it -p 8081:8081 --name server backend/python
To connect to the running container:
docker exec -it server /bin/sh
- Build the frontend
cd front
docker build --no-cache -t frontend/angular2:latest .
docker run -it -p 3000:8080 --name angular2-app frontend/angular2
-
Navigate to
http://localhost:3000
-
Easiest way to run this application to run
docker-compose up
in the project root directory.