Skip to content

Building a portfolio website from scratch to showcase my data science projects

License

Notifications You must be signed in to change notification settings

petrokvitka/portfolio-website

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Portfolio Website for my Data Science Projects

This project showcases my data science projects on a deployed website.

Table of Contents

  1. Installation
  2. Project Motivation
  3. Instructions
    1. Create Database for Content
    2. Updating Database Content
  4. File Descriptions
  5. Licensing, Authors, Acknowledgements

Installation

The code requires Python versions of 3.* and general libraries available through the Anaconda package. In addition, psycopg2 for the PostgreSQL database, Flask, Werkzeug and gunicorn need to be installed to be able to deploy the website. Please refer to the requirements.txt file for more details on dependencies.

Project Motivation

I wanted to have a space to showcase my projects with references to their code, blog posts and deployed apps, where applicable. I also added more details about my learning path towards data science and the skills I acquired.

Instructions

Create Database for Content

The database containing the content for the website is a PostgreSQL database on Heroku.

If you want to update the database, you need to connect to the remote database in your local environment. Follow the below steps to connect to a Heroku PostgreSQL database locally:

  1. Install the Heroku CLI.
  2. Create a PostgreSQL database on Heroku that is linked to this app.
  3. Install PostgreSQL on your computer locally and update your PATH environment variable to add the bin directory of your Postgres installation. (More details here)
  4. Get the database credentials by running heroku pg:credentials:url -a <your app name>. Copy the Connection URL.
  5. Type into your shell $ export DATABASE_URL=postgres://<Connection URL> if you're using a Mac or Linux and $ set DATABASE_URL=postgres://<Connection URL> if you're using Windows. (See the documentation here)

Now your local environment has the DATABASE_URL for your remote Heroku PostgreSQL database saved and the code in app.py can access this database from your local computer.

Update Database Content

If you want to update the database content, you need to create Excel files containing the relevant information you want to display on the website.

Running python database_feeder.py will read the data from the Excel files into the database.

Please note: There is currently no feature in this file that deletes and creates a new database if a new column is added. Adding of rows is handled, but not of columns. Therefore, if you want to add a new column to the Excel file and then database, you need to first reset the PostgreSQL in the app on Heroku and then you need to add the relevant code to the script, before running it.

File Description

The templates folder contains all html pages that will be accessible through the site. The static folder is made up of the images displayed on my website, the robots.txt site as well as the css stylesheet. app.py is the file which will render the website through the micro web framework Flask. database_feeder.py is the script that reads in the data from the Excel files into the database. And the helper.py file contains the functions querying the database when a html page is rendered.

Licensing, Authors, Acknowledgements

This code can be used under the MIT license. I created this website completely from scratch, therefore I am the author of the code, including certain references and code snippets from other people which I marked appropriately. Feel free use the code - but remove any of the content relating to me - to create your own portfolio website.

About

Building a portfolio website from scratch to showcase my data science projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 72.4%
  • Python 14.5%
  • CSS 13.1%