Skip to content

IliyanKostov9/portfolio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

198 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

πŸ“ Portfolio Django app πŸ“

License Dependabot Updates Create and publish a Docker image Security scanning Test GitHub release GitHub release date itHub last commit

πŸš€ About

This project is for creating and maintaining my personal website at https://portfolio.ikostov.org.

The project is build as a server side web app with the Django framework. It uses the standard (MVC) architecture pattern and the views are rendered as Jinja templates.

Important

The application follows the Django guide deployment checklist, however if you find any security vulnerabilities during your interaction with the prod version with the app (or just by looking at the code), then please contact me by following the SECURITY.md guide.

Since the application is light and only loads static data from these yaml files, it currently uses SQLite (the simpler the better). Email sending is done with AWS SES.

For the web server, it uses the better ASGI web server on Uvicorn. We don't need to run it on Guvicorn, as it doesn't get a lot of web traffic.

Testing is written with the Django integrated test suite libraries, with unit tests on the models and integration tests for the views.

The development environment can be optionally installed with the help of Nix devenv. For CI/CD, it uses github action to test & scan for security vulnerabilities, for deployment is by publishing a docker image to Github packages. Afterwards the image gets pulled from Raspberry PI 4B and finally gets exposed to the public internet via HTTP proxy traefik (you can find it's configuration here).

For maintenance it uses Grafana, that the application sends log data via the Loguru library and sends it to Grafana Loki.

✨ Technology stack

πŸŽ‰ Getting started

βœ… Prerequisites

In order to build & run the app, make sure you have installed Python 3.14.

If you are using Nix or NixOS you can install it in flake.nix via devenv

🌱 Setup

  1. Add your secrets in .env file.
PORTFOLIO_FROM_EMAIL=john.doe@mail.com
PORTFOLIO_TO_EMAIL=jane.doe@mail.com
PORTFOLIO_EMAIL_HOST="smtp.outlook.com"
PORTFOLIO_EMAIL_USER=user123
PORTFOLIO_EMAIL_PASSWORD=password123
PORTFOLIO_HOST=localhost
PORTFOLIO_ENV=dev
PORTFOLIO_SECRET_KEY="django-insecure-123"
PORTFOLIO_LOKI_URL="https://{{USER}}:{{PASSWORD}}@grafana.net/loki/api/v1/push"
  1. Install your dependencies
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

If you're using uv

uv venv
uv sync

πŸƒ Run

python3 src/manage.py runserver
# Or
make run

πŸ§‘β€πŸ’» Make commands

Command Description
make help Show available commands with their description
make all Perform check clean test run at the same time
make run Run Django app
make test Test Django app
make check Check the django templates
make type-inference Perform static type check with Pyre
make schema-update Update SQL schema & create an empty migration
make sql-init-test Perform SQL migration
make sql-reset Perform SQL reset

πŸ“ƒ License

This product is licensed under GNU General Public License

About

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors