Skip to content

My personal portfolio which presents some of my github projects as well as my CV and technical skills.

Notifications You must be signed in to change notification settings

mavamalonga/my-website

Repository files navigation

forthebadge

My-website

My personal portfolio which presents some of my github projects as well as my resume and technical skills.

Local testing

Creating Virtual environment and downloading the program:

You need Python 3 (tested on 3.10), git and venv installed on your machine.

Open a terminal and navigate into the folder you want My-website CRM to be downloaded, and run the following commands:

  • On Linux or macOS:
git clone https://github.com/mavamalonga/my-website
cd my-website
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
  • On Windows:
git clone https://github.com/mavamalonga/my-website
cd EpicEvents
python -m venv env
env\Scripts\activate
pip install -r requirements.txt

Initiate SQlite database

Open a terminal and navigate into the root of the project (i.e. the folder where is situated manage.py) , and run the following commands:

python manage.py makemigrations
python manage.py migrate
python manage.py collectstatic

Create a superuser (administrator)

Open a terminal and navigate into the root of the project (i.e. the folder where is situated manage.py) , and run the following command:

python manage.py createsuperuser

You will be prompted an email, first and last name, and a password. That's it, the superuser is created !

Run My-website CRM

Open a terminal and navigate into the root of the project (i.e. same folder than manager.py), and run the following command:

python manage.py runserver

The admin page will be accessible at http://127.0.0.1:8000/admin. You can then login with previously created superuser email and password. It is now possible to populate the database, with some sales or support team members (don't forget to assign roles).

API will be accessible (with Postman for example) at http://127.0.0.1:8000 .

Linting

cd /path/to/my-website
source venv/bin/activate
flake8

Unit tests

d /path/to/my-website
source venv/bin/activate
python manage.py test

Implementation of integration and continuous deployment (CI/CD Pipeline)

The stages of the CI/CD Pipeline

1) unittest-and-linter

CircleCi creates a virtual environment, installs the project dependencies and runs all the unit tests for the application. CircleCi then runs flake8 to check the consistency of the code according to the PEP8 rules defined in the setup.cfg file. If the tests are successful CircleCi moves on to the next job, otherwise the execution stops and CircleCi returns the cause of the failure. This step does not filter the branches, it will be executed at each commit on a branch of the GitHub repository.

python manage.py test
flake8 --max-line-length=99

2) build-and-push-docker-image

CircleCi creates a docker container from the project's Dockerfile and then, once the image is created it is published on the assigned Docker Hub account. This step is only performed for commits made on the main branch of the GitHub repository.

docker login -u DOCKERHUB_USER -p DOCKERHUB_PASS
docker build -t DOCKERHUB_USER/oc_lettings:lastest .
docker push DOCKERHUB_USER/oc_lettings:lastest

3) deploy-on-heroku

CircleCi makes the connection with the heroku account thanks to the Key API then, proceeds to the configuration of the production environment by mentioning the values of the variables SECRET_KEY, HEROKU_APP_NAME to identify the application, DEBUG, and dsn for Sentry.
Once the configuration is finished, an image is created from Dockerfile and then deployed to heroku in production.
This step only executes for commits made on the main branch of the GitHub repository.

heroku container:login
heroku container:push web --app NOM_APP_HEROKU
heroku container:release --app NOM_APP_HEROKU web

Local testing with Docker

  • To retrieve an existing image from Docker Hub
docker pull DOCKERHUB_USER/IMAGE_NAME:TAG_IMAGE
docker run --name IMAGE_NAME -d -p PORT:PORT DOCKERHUB_USER/IMAGE_NAME:TAG_IMAGE
  • For an existing image in Docker desktop
docker run --name IMAGE_NAME -d -p PORT:PORT DOCKERHUB_USER/IMAGE_NAME:TAG_IMAGE

API Documentation

API endpoint HTTP method URI
Get the list of projects GET api/project/
Get a single project GET api/project/{id}/
Get the list of badges GET api/badge/
Get a single badge GET api/badge/{id}/
Get the list of tasks GET api/task/
Get a single task GET api/task/{id}/

Contact

For any other questions contact me by email : mavamalonga.alpha@gmail.com

About

My personal portfolio which presents some of my github projects as well as my CV and technical skills.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published