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

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@scipio·
0.000 HBD
scippyCRM v0.0.2: a (B2B) CRM application built with Flask
# scippyCRM v0.0.2: a (B2B) CRM application built with Flask

![scippycrm-logo.png](https://cdn.steemitimages.com/DQmdytV9SnBuNenRWy9V1gsmYg7AsVkmbcbmf7tm4UZZXD3/scippycrm-logo.png)

### Repository
https://github.com/realScipio/scippycrm

### Commits
Because I had to carefully re-structure the whole application via Blueprints, plus to add more detailed commit comments, I've added quite a few commits:
[f1a615bcc32065b9b78e8e0d586ae7963536e637](https://github.com/realScipio/scippycrm/tree/f1a615bcc32065b9b78e8e0d586ae7963536e637)
[086ae7660e2567a773d6a6a9e64b3f95009f408e](https://github.com/realScipio/scippycrm/commit/086ae7660e2567a773d6a6a9e64b3f95009f408e)
[c1e82434cb5fe07bf9d4d9d3c4a31a1ea424cd20](https://github.com/realScipio/scippycrm/commit/c1e82434cb5fe07bf9d4d9d3c4a31a1ea424cd20)
[ea53340252543b127bdcd5ddb25abaece51b940f](https://github.com/realScipio/scippycrm/commit/ea53340252543b127bdcd5ddb25abaece51b940f)
[8c1dcce7f207be71f21c4c1c907b8d4403efa588](https://github.com/realScipio/scippycrm/commit/8c1dcce7f207be71f21c4c1c907b8d4403efa588)
[aacac05fead2000bfba83880d1a76868d6f2854e](https://github.com/realScipio/scippycrm/commit/aacac05fead2000bfba83880d1a76868d6f2854e)
[c78e6cf1a24dce87d70d3b6f5d90811752d2e040](https://github.com/realScipio/scippycrm/commit/c78e6cf1a24dce87d70d3b6f5d90811752d2e040)
[61356789df7293c49582a11bbccb7d64c14028b9](https://github.com/realScipio/scippycrm/commit/61356789df7293c49582a11bbccb7d64c14028b9)
[2fb62aeaa7fea807cd00b14c0dd9a1434fb8b5bf](https://github.com/realScipio/scippycrm/commit/2fb62aeaa7fea807cd00b14c0dd9a1434fb8b5bf)
[a58c2d683fe6ca169b9b65bed21ca44d7be80110](https://github.com/realScipio/scippycrm/commit/a58c2d683fe6ca169b9b65bed21ca44d7be80110)
[3822aa3c495705cf6277d59555776a591edd35e9](https://github.com/realScipio/scippycrm/commit/3822aa3c495705cf6277d59555776a591edd35e9)
[4f975305d00e668dd217d48f86fe7430015a2b83](https://github.com/realScipio/scippycrm/commit/4f975305d00e668dd217d48f86fe7430015a2b83)
[9013cfe8fcc39fba5a267cc4777e5a391f56c106](https://github.com/realScipio/scippycrm/commit/9013cfe8fcc39fba5a267cc4777e5a391f56c106)
[a78f808cf3279aae0680c8458b4737839e5ffa23](https://github.com/realScipio/scippycrm/commit/a78f808cf3279aae0680c8458b4737839e5ffa23)
[4d06793ef5dac0a78dee71921c06f43379420749](https://github.com/realScipio/scippycrm/commit/4d06793ef5dac0a78dee71921c06f43379420749)
[aff08868062b17ccac7940a8983141d8a3c4e8c6](https://github.com/realScipio/scippycrm/commit/aff08868062b17ccac7940a8983141d8a3c4e8c6)
[f267b82f07e2784e97089b0b9a35024d58fd4a60](https://github.com/realScipio/scippycrm/commit/f267b82f07e2784e97089b0b9a35024d58fd4a60)

### What is `scippyCRM` about?
scippyCRM is a B2B Customer Relationship Management application. 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.

### Why did I create v.0.0.2 ?
In iteration v.0.0.2, I've focused on structuring the application code via Flask Blueprints and an Application Factory (well, the latter was _technically_ already present in v.0.0.1, but just about all Python code was still positioned in `__init__.py`.) Application Factories allow for creating the Flask application object within a function (`create_app()`), which has the advantage (at a later stage) to test with different settings for different application instances, as well to run different or even multiple identical versions of the application in the same application process.

Blueprints in Flask are well-suited for larger applications. Also different Blueprints can have different (sub) templates / template filters / static files. In the current state, the application isn't yet _that_ large, but still it seems smart to restructure the application right now, instead of a complex overhaul later on.

On the inititial (introduction) iteration, @amosbastian asked me why I didn't implement Blueprints _right away_. My answer to that, is that I was still thinking about a **divisional or a functional approach** to the Blueprints structure. What I've set-up for the Blueprints architecture on v.0.0.2 suits the application best, I think.

### 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
```

For running the application, I've now added a `main.py` file in the root folder, which now loads the config settings from file (`flask.cfg`) instead of a mapping, so run the app as follows:
```
export FLASK_APP=main.py
export FLASK_ENV=development
flask run
```

Then open up your browser, head over to **http://localhost:5000/** _et voila!_ (Login with `admin:admin`, or via your own login credentials).

### Tasks completed for v.0.0.2
- Blueprint- & Application Factory enabled architecture (as explained above)

- display an overview of current "Users"
I've implemented an overview for the current "Users" in the MongoDB database. Every row contains a "route rule" and a user_id passed as an additional argument to the `url_for()` redirect. New "Users" can be added via the `+` sign on the right hand-side.

- add a new "User" & update/change "User" fields
Because scippyCRM isn't intended to be used on a public domain, yet as stand-alone or in an intranet/extranet context, and is an "Admin / Mid-End Only" application, it felt unappropriate to add a _"regular"_ registration route where new system users could sign up: in a closed organisational environment, you don't want "others" to sign up, of course.

Instead, I've chosen the mechanism to login via `admin:admin` on a clean install, create a user account (for yourself or for a colleague) from **within the application**, and from that point on you cannot login with the default `admin:admin` login anymore. The `Passlib` password hashing library was used for hashing the user passwords. For iteration v.0.0.2, I've chosen to disable password editing for existing users. I'm thinking about implementing **User Roles**, so that both a logged-in user can change their own User Profile as well as Power Users to change all User Accounts. To do so, I also need to implement a "Read-Only" mode (as per the roadmap), for read-only viewing colleague user (profile) data.

- login via user['username']:user['password'] if users.count() > 0:
As explained above.

### A few screenshots of the GUI thus far:

(1) The Login screen

![1.png](https://cdn.steemitimages.com/DQmSSpu5iKtYu8eCSBRtiSfCn4o4nS2zSZZcS5hGJY4hEYa/1.png)

(2) The Organisations overview screen, which also allows for adding new Organisations via the `+` sign at the top right

![2.png](https://cdn.steemitimages.com/DQmSHHM2pNgaDdpoPzsdarHip9R4GgnvCVkpzfV3NCqRBwS/2.png)

(3) Inserting / Updating individual Organisational data

![3.png](https://cdn.steemitimages.com/DQma7pq7fMiz17gP1qa3WKHo3Evy8Jhg4riJmzgQo598Lfc/3.png)

(4) The Users overview screen, which also allows for adding new Users via the `+` sign at the top right
_(PS: that's **not** my real email address shown in there! ;-) )_

![4.png](https://cdn.steemitimages.com/DQmaXesT56DXDjpuF1vv11WxF8x5jXRAZYnMRgJBB8xwPtF/4.png)

(5) Adding a new User to the system

![5.png](https://cdn.steemitimages.com/DQmccAeJx3gG7QLtG1qGrhtTi2vZ36VPJjn7kub9uj87JFx/5.png)

### 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](https://github.com/realScipio/scippycrm/blob/master/CONTRIBUTING.md).

### My GitHub Account
https://github.com/realScipio
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,