This project is built using the following technologies:
- Backend: Python 3.9, Django 4.2
- Frontend: Node.js 23.5.0, Angular 19.1
- Database: sqllite
- Testing:
- Django:
pytest - Angular:
Karma(npm run test),Cypress(npm run e2e-test)
- Django:
- Linting:
- Django:
Ruff(ruff check) - Angular:
ESLint(npm run lint)
- Django:
- Containerization: Docker, Docker Compose
- Task Automation: Makefile
- CSRF Skipped for Simplicity: In this setup, CSRF protection is disabled for development convenience. In a production environment, enable CSRF protection is a MUST.
- Partial Unit Test Coverage: Not every unit is covered. However, key functionalities and E2E are tested.
- Angular in Production: In a production environment, Angular should run using a build output (
ng build --prod) instead ofng serve. - Django in Production: The Django backend should be served using Nginx instead of
runserverfor better performance and security. - Node.js Version: The project currently uses the latest Node.js 25, but it is recommended to use an LTS (Long-Term Support) version for stability.
- Python Version: The project uses Python 3.9, which is still security-supported, but upgrading to a newer version is recommended for long-term maintenance.
- Backend Accessibility: The Django backend must be accessible at
http://127.0.0.1:8000, as the frontend environment is configured to map to this address. - (Angular/Karma) (Angular/Cypress): Better to test the Angular project using npm run, not with docker.
Before running the project, ensure you have the following installed:
For running/testing/linting the application locally:
- Python 3.9 (or newer)
- Node.js 25 (or LTS version recommended)
For running/testing/linting the application on docker
- Docker (for containerized development)
- Docker Compose (to manage multiple services)
- Make (for simplified command execution)
If you don’t have make, install it using:
sudo apt install make # Linux
brew install make # macOSTo start the backend, frontend using Docker, run:
make run-appThis will:
- Start Django backend on
http://127.0.0.1:8000 - Start Angular frontend on
http://localhost:4200
We have provided a Makefile to simplify development tasks.
make run-appmake testmake lintmake stopIf you prefer running the project manually, follow these steps:
cd opaala/Django
python3 -m venv venv
source venv/bin/activate
cd opaala
pip install -r requirements.txt
python manage.py migrate
python manage.py loaddata books
python manage.py runserver 127.0.0.1:8000cd opaala/Angular/opaala
npm install
npm start
# In case the server dose not start and you get the following error 'ng: not found'
export PATH="$(pwd)/node_modules/.bin:$PATH"
# or
npm install -g @angular/clipytestnpm run testnpm run e2e-testruff checknpm run lintdocker compose run django-testdocker compose run django-lintdocker compose run angular-lint- Ensure Docker and Docker Compose is running before executing
docker composecommands. - The Makefile simplifies running commands, but you can always use
docker composemanually. - To check logs of the passed/failed tests or linting errors run the following:
docker logs <container-name>