{"id":20603477,"url":"https://github.com/danpoynor/portfolio-with-sqlalchemy","last_synced_at":"2026-04-20T19:05:32.376Z","repository":{"id":56706307,"uuid":"518581837","full_name":"danpoynor/portfolio-with-sqlalchemy","owner":"danpoynor","description":"Web interface for a portfolio of projects.","archived":false,"fork":false,"pushed_at":"2023-05-01T23:56:32.000Z","size":1433,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-17T02:11:50.934Z","etag":null,"topics":["crud-operations","csv-import","flask","jinja","portfolio-website","python","python-dotenv","sqlalchemy","sqlite3"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danpoynor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-27T19:07:05.000Z","updated_at":"2022-08-11T18:02:21.000Z","dependencies_parsed_at":"2024-11-16T09:17:30.771Z","dependency_job_id":"22ab83de-f16a-4090-bb87-e313fdf24d25","html_url":"https://github.com/danpoynor/portfolio-with-sqlalchemy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danpoynor%2Fportfolio-with-sqlalchemy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danpoynor%2Fportfolio-with-sqlalchemy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danpoynor%2Fportfolio-with-sqlalchemy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danpoynor%2Fportfolio-with-sqlalchemy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danpoynor","download_url":"https://codeload.github.com/danpoynor/portfolio-with-sqlalchemy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242249025,"owners_count":20096778,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crud-operations","csv-import","flask","jinja","portfolio-website","python","python-dotenv","sqlalchemy","sqlite3"],"created_at":"2024-11-16T09:17:23.852Z","updated_at":"2026-04-20T19:05:27.357Z","avatar_url":"https://github.com/danpoynor.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Portfolio with Flask and SQLAlchemy\n\n## Description\n\nWeb interface for a portfolio of projects.\n\nThis demo app uses my knowledge of CSV, File I/O, and database ORMs to create a portfolio management system which users can easily interact with to store project data. The data is cleaned from a CSV file with default data before it's added to an SQLite database file named `projects.db`. All interactions with the records use ORM methods for viewing records, creating records, editing records, and deleting records.\n\n---\n\n## Run the app\n\nClone this repo then `cd portfolio-with-sqlalchemy`.\n\nAssuming you have Python3 installed on a MacOS, run these commands (or something similar):\n\n```bash\npython3 -m venv env\nsource env/bin/activate\npip install -r requirements.txt\n```\n\n👉 Rename the `.env.example` file to `.env` and edit for your local environment if needed:\n\n```bash\ncp .env.example .env\n```\n\nThen run the app:\n\n```bash\npython app.py\n```\n\nYou should then be able to view the app at \u003chttp://127.0.0.1:8000/\u003e\n\nWhen done running the app, you can deactivate the virtual environment by running `deactivate`.\n\n---\n\n## What I Learned About / Feature Highlights\n\n- Loading default data from a CSV file `projects.csv`.\n- Cleaning data and formatting before storing in a SQLite database `projects.db` file.\n- Using Flask-SQLAlchemy to connect and interact with the database.\n- Using Jinja templating and template inheritance.\n- Using one form input template for both create and edit views.\n- Implementing CRUD functionality.\n- Catching 404 errors and display a custom error message.\n- Catching 500 errors and display a custom error message.\n- Using [python-dotenv](https://pypi.org/project/python-dotenv/) `load_dotenv()` to [configure Flask dev environment](https://flask.palletsprojects.com/en/2.2.x/config/) from a .env file.\n- Using Flask [Context Processors](https://flask.palletsprojects.com/en/2.2.x/templating/#context-processors) to inject variables automatically into templates.\n- Using [Pylint](https://pylint.pycqa.org/en/latest/) to analyze the code for errors and potential problems.\n\n---\n\n## Technologies Used\n\n\n- [Python](https://www.python.org/): Programming language\n- [Flask](https://flask.palletsprojects.com/): Flexible and popular web development microframework.\n- [Jinja](https://jinja.palletsprojects.com/): Full featured, fast, expressive, extensible templating engine for Python.\n- [SQLAlchemy](https://www.sqlalchemy.org/): Python SQL toolkit and Object Relational Mapper (ORM) that gives application developers the full power and flexibility of SQL.\n- [SQLite](https://www.sqlite.org/): Most used database engine in the world.\n- [Python-dotenv](https://github.com/theskumar/python-dotenv): Reads key-value pairs from a `.env` file and can set them as environment variables. It helps in the development of applications following the 12-factor principles.\n- [Pylint](https://pylint.pycqa.org/en/latest/)\n- [CSV](https://en.wikipedia.org/wiki/Comma-separated_values) file format used for storing imported and exported data in a human readable including a header row of field names.\n\n---\n\n## Screenshot of Index Page\n\n\u003cdetails\u003e\n\u003csummary\u003eExpand/Collapse\u003c/summary\u003e\n\n\u003cimg src=\"https://user-images.githubusercontent.com/764270/184202788-2040f643-de6f-4721-9752-07dce2031290.png\" data-canonical-src=\"https://user-images.githubusercontent.com/764270/184202788-2040f643-de6f-4721-9752-07dce2031290.png\" width=\"640\" alt=\"Screenshot of Python Portfolio with Flask and SQLAlchemy by Dan Poynor\" /\u003e\n\n\u003c/details\u003e\n\n---\n\n## Potential TODO's\n\n- Add Python unit tests. \u003chttps://docs.python.org/3/library/unittest.html\u003e\n- Add Flask unit tests. \u003chttps://flask.palletsprojects.com/en/2.2.0/testing/\u003e\n- Add screenshots or screen recording of portfolio apps.\n- Add more Python Type Hinting. \u003chttps://docs.python.org/3/library/typing.html\u003e\n- Add Backup data feature to output a CSV file of the current data in the database.\n- Add authentication. Potential extension to consider: \u003chttps://pypi.org/project/FlaskSimpleAuth/\u003e\n- Improve Doctest documentation. \u003chttps://docs.python.org/3/library/doctest.html\u003e\n- Investigate using flask-wtf to implement forms. \u003chttps://pypi.org/project/flask-wtf/\u003e \u003chttps://flask-wtf.readthedocs.io/en/1.0.x/\u003e\n- Investigate other Flask extensions to potentially integrate. \u003chttps://pypi.org/search/?c=Framework+%3A%3A+Flask\u003e\n- Improve visual and UX/interaction design.\n- Create a REST API server, potentially using Flask, Connexion or Flask-RESTful, and SQLAlchemy.\n- If ever the application gets bigger, look into using [Flask Blueprints](https://flask.palletsprojects.com/en/2.2.0/blueprints/) to simplify different parts of the application. Such as to separate various subdomains or different parts of the application into different template directories.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanpoynor%2Fportfolio-with-sqlalchemy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanpoynor%2Fportfolio-with-sqlalchemy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanpoynor%2Fportfolio-with-sqlalchemy/lists"}