Introducing scippyCRM v0.0.1: a (B2B) CRM application built with Flask

in #utopian-io6 years ago (edited)

Introducing scippyCRM v0.0.1: a (B2B) CRM application built with Flask

scippycrm-logo.png

Repository

https://github.com/realScipio/scippycrm

Commits

All the (initial) commits are relevant to this (introduction) contribution.

Why did I create it?

A few years ago, I developed a B2B CRM application built with PHP and MySQL. I've been using it just myself ever since, to keep track of organisations and their employees I'm in contact with, including a barebones 'Task Manager' so that I know who to contact when and for what exactly. A little while later, I created another app using Python and MongoDB, to perform some data analysis. The two applications grew closer and closer to one another as I added more functionality to both, and I began to use them in conjunction. However, over time, I felt the urge to completely re-write the CRM application in Python & MongoDB as well, to have only one tech stack used, but never did so before. Up until now of course!

@scipio still new to Flask

Those of you who follow me, and maybe have read one or more episodes of my Learn Python Series tutorials, knew already I like to code in Python. However, having done most web development projects in PHP, MySQL, and Wordpress, I'm still new to Flask: a Python-based microframework using the Jinja2 templating engine and Werkzeug (a WSGI (Web Server Gateway Interface) utility library for Python). Also recently (late April 2018), Flask released its 1.0 versions, so right now for me is a good time to dive right in!

What is scippyCRM about?

I decided to Open Source scippyCRM because even though I will use it myself, it might also be very helpful to others, and while I'm continuously adding more functionality to the application, other Open Source enthusiasts might decide to join me in development efforts! scippyCRM is intended to be used by non-tech commercial people, e.g. in marketing and / or sales. Therefore (almost?) all functionality needs to be available via the GUI. To begin with, I'll be focusing purely on the browser, but since Flask is also a suitable framework for APIs, maybe over time I will add support for that as well.

Technology stack

  • Python 3
  • Flask
  • MongoDB

Installation

To run this locally you must have MongoDB and Python3.6 (I've used the Anaconda distribution myself), and git, obviously, installed, and if you have, you can clone the repository via:

$ git clone https://github.com/realScipio/scippycrm.git

If you prefer to use a venv, proceed with

$ cd scippycrm
$ python3 -m venv venv
$ source venv/bin/activate

Then (inside your venv) install the Python packages using:

pip install -r requirements.txt

Running the application (at this stage preferably in dev mode), like so:

export FLASK_APP=scippycrm
export FLASK_ENV=development
flask run

Then open up your browser, head over to http://localhost:5000/ et voila! (Login with admin:admin).

Tasks completed for v.0.0.1

  • after reviewing some "best-practises" information regarding Flask 1.0 and the WTForms extension, I began coding the initial Application Factory and the index (Login) route
  • then I designed a new (temporary?) logo for scippyCRM, expanded the font letters, and exported as Scalable Vector Graphic, for its small filesize and crystal clear vector-enabled browser rendering

scippycrm-logo.png

  • afterwards I created a custom-built HTML container structure, with custom HTML id & class names, and custom CSS (no Bootstrap or SCSS needed!) ;-)
  • I then created a barebones re-usable Overview and Formblock template structure (to be used in several places throughout the application GUI), and modularized it via Jinja extends, includes and one macro function found in _render_field.html:
{% macro render_field(field) %}
  • because I wanted to use the same View for inserting and updating an "Organisation", and want to keep to MongoDB database nice & clean (no empty strings / None values), I decided (for now at least!) to first gather all submitted "organisation" form data (via a POST request) ...
if form.validate_on_submit():
    obj_for_update = {}
    for fieldname, value in form.data.items():
        if (fieldname != 'submit' and fieldname != 'csrf_token' and fieldname != 'org_id'):
            obj_for_update[fieldname] = value 
  • ... then either insert (new organisation) or update (existing organisation) the associated "organisation" document record using all form data ...
if org_id == 'new':
    org_id = coll.insert_one(obj_for_update).inserted_id

else:
    result = coll.update_one({"_id": ObjectId(org_id)}, {"$set": obj_for_update})
  • ... and then clean up the MongoDB record
org = coll.find_one_or_404({'_id': org_id})            
clean_obj = {}
for key in org:
    if org[key] != None and org[key] != "":
        clean_obj[key] = org[key]            
result = coll.replace_one({'_id': ObjectId(org_id)}, clean_obj) 

Features v0.0.1

  • login via admin:admin
  • logout
  • display an overview of current "Organisations"
  • add a new "Organisation"
  • update / change "Organisation" fields

Roadmap

Some of the planned roadmap milestones include:

  • architecture-wise, I will modularize the (future) application components with Flask Blueprints;
  • add functionality for multiple System Users
  • add functionality for "Employees / Contactpersons", that work for a given "Organisation"
  • add functionality for "Contact history" for a given "Organisation" & "Employee"
  • add functionality for "Task management" (what to do when for who), integrated with "Contact history"
  • add a generic Overview Pager, to "visually step through / browse" large chunks of Overview data
  • add Read/Write View functionality for Form Blocks
  • add custom-built Responsive Design View @media queries, for system users using the application via mobile / on the road
  • add pre-defined Data Filters
  • add support for Overview Field Ordering (asc / desc)
  • add various Data Import / Export functionality via the GUI (DB dumps, CSV exports, etc.)
  • add "Sales Opportunity Tracker"
  • add "Document Generator", e.g. to semi-automatically compose Sales Offers and Mailings & export via PDF
  • add Visual Graphs to the "Dashboard"
  • add "Visual Field Generator", to add and manage Data Components via the GUI instead of programmatically
  • etc.!

Feature Requests

Always feel free to suggest new / enhanced features, or UI changes for example!

Contributing

If you want to contribute, then please read CONTRIBUTING.md.

My GitHub Account

https://github.com/realScipio

Sort:  

Thanks for the contribution, @scipio! Unfortunately I am stuck on a clean install of Windows so couldn't test out everything, but just looked over the code.

  • From what I can tell the code is very clean and of high quality, so good work on that! Is there a reason you didn't start using Blueprints right from the start?
  • Commit messages could be better in my opinion - a lot of them are the same and don't really describe what you are committing

no Bootstrap or SCSS needed!

  • I understand why you wouldn't want to use Bootstrap, but not that sure why you wouldn't want to use a CSS preprocessor like SCSS in your case?
  • Would've been great if you included some images of the application for people that are just checking out the post and haven't installed it (like me)

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Hey @scipio
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Thank you, scipio. Upvoted and resteemed!

@ArtTurtle is an upvote bot run by @Artopium dedicated to upvoting your art, music, fashion, video and books. Find out how you can get an upvote for every creative post you make by visitng @ArtTurtle and reading the latest report.

Coin Marketplace

STEEM 0.17
TRX 0.15
JST 0.028
BTC 62102.06
ETH 2415.08
USDT 1.00
SBD 2.49