Angular 2 frontend with Django backend implemention of ahernp.com.
- Frontend – NPM, Typescript & Webpack.
- Backend – Ubuntu, nginx, uWSGI & Django.
The website content is mostly stored as Markdown text in a PostgreSQL database. Access to this data is provided via endpoints implemented by a Django backend.
Most of the application logic resides in an Angular 2 single page application run in the browser.
When the site is first visited, the Angular 2 application is downloaded and runs to render the initial page. All the other page content is downloaded in the background so that clicks on internal links can be serviced by the SPA without further recourse to the backend.
Feedreader, an RSS reader, is also available. Its content is also downloaded in the background and the server polled hourly to check for updates.
Logged in users gain access to additional controls to edit the markdown content and feedreader subscriptions.
There are also some text manipulation tools, implemented in Javascript which merely process text input in the local browser session.
A dashboard page is also available showing the current versions of software and recent log entries for the application.
Tested on Ubuntu 16.04 with python fabric
installed.
- Get source code:
git clone https://github.com/ahernp/angular-django.git
- Create Python virtual environment:
mkvirtualenv ad
- Change to
angular
directory:angular-django/angular'
- Full development environment setup:
fab setup:init
- In one terminal, start the Django runserver:
fab runserver
- In another terminal, build the client side application:
npm run build
- Visit http://localhost:8000/
- Run unit tests:
npm test
- Run end to end tests using Selenium IDE. The test case is in the project root directory in a file called
sanityCheck.selenium
.