Developer: Kristian Colville
(Image of final terminal)
- Project Goals
- User Experience
- User Stories
- Design
- Logic
- Technologies & Tools
- Features
- Data Model
- Testing
- Validation
- Bugs
- Development & Deployment
- Credits
- Acknowledgements
The goals of this project include:
- Designing a back-end application for users with in need of a software utility tool for business
- It should provide users with the ability to store and access data
- This is a CLI project so the application should work in a terminal
- Use the python programming language to build the application
- To be able store and access an account within Rapid Silver
- Log in or create an account
- Add some form of data and manipulate it for specific needs
- Build a software utility tool for small business users
- Provide the ability for users to log in and create user accounts
- Design it so a user can set up a data in ways that are unique to them
- Build it using a back-end language
- Any user who needs to use a software utility tool to analyze some form data
- Users who are self-employed or freelancing or run small businesses
- Users who may need to manage and update inventories of some form like employees/customers/products
- People starting new ventures in need to managing their new companies
- Clear navigation through the CLI
- Information provided to help guide users
- Any errors or actions are handled and work as expected
- There should be appropriate feedback displayed for the interactions provided
- Help should be provided where appropriate
- The user is guided through the program in a logical and meaningful way
- The user would expect to see log in options for the program
- Any user would expect the application to have a high degree of security
- As a new user I want to understand how to use this CLI application
- As a new user I want to create an account to store my personal information
- As a new user I want to be able store and analyze some form of data
- As a returning user I want to be able to log into the application
- As a returning user I want to be able to update inventory/customers/products etc.
- As a returning user I want to see available options
- As the owner I want my users data to be stored safely
- As the owner I want my users passwords uniquely encrypted in the database for extra protection
- As the owner I want users to see sample data and understand how to use the program
Although not a requirement for the CLI application some colors were chosen for the website containing the terminal. I chose to use Coolers to make a palette for the website.
As I mentioned above, the site itself was not a requirement for this project but fonts were chosen for the site containing the terminal.
I chose 'Anton', sans-serif as my website font. I got it from Google Fonts.
The structure of the terminal application was designed to be easily navigated and in order of importance. The terminal consists of 80 columns and 24 rows. Each menu of navigation appears when needed.
-
The application contains the following menus:
- Welcome Menu with a prompt for the user to press enter so that the next menu can be printed to the terminal
- Leading on from the welcome menu is another menu reminding the user of available options to them and prompting for the user to click enter again
- After the user clicks enter on the reminder of options, the log in portal menu is shown and the user can either create a new account or log in as a returning user. This provides the user with flexibility to store and access their data.
- Entering from the account creation route the next screens involve username and password validation and checking for conflicts in the database
- From the login side for returning users the user is welcomed back.
- Coming back to the main route in the main route menu which can be navigated seamlessly to and from the various options within
-
From the main menu for the different selections the user has options for:
- Setting up to do list
- Storing inventory/ updating inventory
- Information on data protection
- How data is stored and protected
- Coolors to get palette colors for the website
- Balsamiq used for creating wireframes for the terminal application
- Chrome Developer Tools for checking and debugging the site in the browser
- Font Awesome for the footer icons
- Grammarly for grammar and spell checking
- Git for version control with VSCode to push commits to GitHub
- GitHub as a remote repository solution for project development
- Google Fonts for the button and heading within the website hosting the terminal application
- Heroku as a deployment solution and hosting the website containing the application
- Jigsaw W3 Validator for validating CSS code
- JShint for validating JavaScript code
- Lighthouse used inside Chrome Dev Tools for testing the website hosting the terminal application
- MongoDB as a database solution for storing the users passwords and various collections
- PEP8 for validating python code
- Ubuntu as the operating system on the local machine
- VSCode as a local repository
- WC3 Validator for validating HTML code
- Colorama used for adding color to terminal
- Bcrypt used to salt and hash passwords for new accounts and checking credentials for returning users
- Better Profanity used in the user class to avoid profanity being entered
- Getpass to hide the users password on the terminal for the user
- OS used for manipulating and storing environment variables
- Pymongo for accessing the Mongo Database and storing users passwords
- Random used for calculating random numbers and selecting random choices in the various classes
- Rich used for creating tables to display user data for the profile, to do list and the users inventory
- Sys used for accessing the system and exiting the program within the selection menu for the user
- Time used throughout for adding delays between text on terminal and for the loading animations
This CLI application was forged using a powerful multi purpose programming language called python. The entire program consists of 10 distinct features as described below.
-
When the application is started we have a classic looking loading animation that brings us to the welcome screen. It's quick and simple looking but effectively used to draw in the user to what's next
-
On the welcome screen we have the name of the application in audacious ascii art. It's energetic and bold. The developer responsible for the application name is also present underneath in the same color
-
The user is prompted to press enter to continue to go to the next screen
-
To help the user immediately understand the application the next menu shows some of the options available to a logged in user
-
This provides intent to the user and a user can get an idea of what to expect further along into the program
-
Again your prompted to hit enter to move on with the program. This functionality provides quick navigation through the application and also provides an easy method of quickly handling input errors by a user
-
Seamlessly, with just two hits of the 'Enter' key you are brought straight through to the login portal
-
We have more ascii art at the top of the screen in big bold words telling us exactly where we are in the program
-
Within the listed options we have logging in as a returning user, an option for creating an account and even option for some information on how data is stored and protected
-
Starting from the bottom up with the information on how data is protected you can once again hit the 'Enter key' to return to login portal, this provides quick navigation back after reading
-
Next in a clear and easy to read format we have an option for creating an account by hitting the letter 'd' and hitting 'Enter'
-
Following the flow of the program after hitting 'd' and 'Enter' we can create an account
-
We are given two options for creating a username
-
We can either create one ourselves or we can let Rapid Silver generate a username for us
-
All routes lead to Rome, creating a username yourself or generating one will bring you to the password creation screen
-
Here things are slightly more complicated. The user must enter a password that's strong. At least 10 characters long and it must contain a capital letter, a number and one of the special characters provided
-
To securely store passwords in the database they would need to be salted and hashed so the stronger the password the better for extra security
Go to MongoDB section for information on secure password storage
-
The user is made of aware of very important information as its in red text color
-
There is also an indented piece of information informing the user that for password protection the input is hidden
-
This acts as a form of security and assures the user that information inserted is hidden from other people who might see their log in credentials
-
Helping users as much as possible is another prompt to re-enter their password to validate matches, this is to avoid mistakes as it is easy to make them when you can't see the password on the screen
-
Following the flow we find ourselves transported to the login screen which is also navigated to by choosing the first option on the login portal screen
-
If we have created an account we will get here automatically
-
To log in we simply enter our username and password
-
We are also made aware that our input for our password is hidden, this helps reassure users who might need that layer of security to protect their credentials
-
To tie things together we have the main menu of navigation to which we get to by logging into Rapid Silver
-
We have ascii art again on the top of the screen informing the user of the intent of the screen they are on
-
We have 6 options available to us on this menu:
- We can set up a profile
- we can make/update our to do list
- We can store inventory/update inventory
- Go to the GDPR screen found on the login portal
- Go to our data storage for information and help
- We can create a profile with our details and update them if we need to keep track of anything
-
This functionality provides a method of keeping track of our goals, achievements, anything specific to the wide spectrum of users who could use this resource
-
You can add, modify and clear your inventory
-
The best part is that your details are saved and you can access them by just being logged in.
-
Having this functionality could really help a lot of users to keep track of information about their inventories, customers, products. It's purpose could be adapted easily to different scenarios.
-
You can add, modify and clear your inventory
-
As mentioned above for the tasks the best part is that your details are saved and you can access them by just being logged in.
-
Only you the user can access your details unique to you.
-
With this option the user is provided informative info on Rapid Silver and can be assured of the quality of the protection offered by Rapid Silver to them
-
There are well known data protection standards and these have been placed on the bottom as to inform that the program meets these standards for data protection and security
-
A user can quickly navigate back to the main menu from this position by hitting the 'Enter key' on their keyboard
-
In order to be fully transparent and user friendly there is a data storage section that provides the user with contact details and general information as how the data is stored
-
To meet standards of openness and transparency this helps reassure users that this is a safe program to use and have their data stored in
-
A user can quickly navigate back to the main menu from this position by hitting the 'Enter key' on their keyboard
Object Orientated programming was used throughout the project. The CLI application consists of 4 classes and 1 subclasses.
- User
- PasswordManager
- DataManager
- ColorPrint
- TextArt
As a database solution MongoDB was chosen to store user data provided. MongoDB is a document database.
Used within is a database called RapidSilver.
- It contains 4 clusters:
- inventory
- to_do_lists
- users
- users_details
- As a new user I want to understand how to use this CLI application
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Reminder menu, options menu | Informs user of intent and any help needed is shown along all routes | User can figure out how to use application all | Works as expected |
- As a new user I want to create an account to store my personal information
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Profile, to do list, inventory | create an account, create a profile, create a to do list and create an inventory | The user should be able to complete all of these and return to the options menu | Works as expected |
- As a new user I want to be able store and analyze some form of data
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
To do list, inventory | update to do list, clear to do list, update inventory and clear inventory | the user should be able to add to and from their to do lists and inventories | Works as expected |
- As a returning user I want to be able to log into the application
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Login portal | log into Rapid Silver | enter username and password and gain access to the options menu | Works as expected |
- As a returning user I want to be able to update inventory/customers/products etc.
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
To do list, inventory list | update a to do list, update inventory | select options and update the various lists | Works as expected |
- As a returning user I want to see available options
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Options menu | navigate to the options menu | Start the application and log in, the options menu should open after logging in | Works as expected |
- As the owner I want my users data to be stored safely
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Password protection, Database solution | Salt and hash passwords, do not display passwords on screen, restrict access to documents | passwords are encrypted with bcrypt and not displayed on screen, mongo access is limited to specific clusters | Works as expected |
- As the owner I want my users passwords uniquely encrypted in the database for extra protection
Feature | Action | Expected Result | Actual Result |
---|---|---|---|
Password Encryption | Salt and hash passwords correctly, hide access to links and passwords | environment variables are used to store credentials to database, links are hidden and passwords are encrypted using bcrypt | Works as expected |
This project is displayed inside a website. The requirements did not include validation for the website only for python. Validation has been carried out on the template provided and no issues or problems are noted other than what was provided with the template from Code Institute. These errors are small and of no relevance to the goal of this project.
I have added some HTML and CSS to the website to improve the appearance of the project. All code added has been validated with no errors.
HTML: validated using WC3 Validator.
CSS: validated using Jigsaw W3 Validator
PEP8 was used to make sure conformity was met with python code written. I have tested all python files.
- color.py
- data_manager.py
- password_manager.py
- text_art.py
- user.py
- run.py
- console.py
There are no errors on PEP8 validation of python code, any errors have been fixed while in development.
Pylint was used as a linter within VSCode and enabled globally and there are no errors in any of the files within the workspace
Bug | Fix |
---|---|
Environment variable for MongoDB password not being accessed, keep getting a NameError | Found the issue online and realized that the config variable was wrong, I removed the quotes and got access to the password for MongoDB |
User not able to log into rapid silver | Discovered the issue was with the encoding for the password |
Set mongo link as config var but not letting me create new accounts | Found the issue, unfortunately a typo was inserted into the environment variables name on Heroku, link was fixed |
Type error being caught on account creation when user enters valid input, stuck on loop in menu | Converted the users input to a string and this resolved the issue |
Bug found when user enters password incorrectly and then tries again, its not flowing properly after recursion | Found missing variable declarations and reassigned variables to password_one for checking and validation |
Found an interesting bug when logging in after creating an account, it acknowledges the user is logged in but doesn't progress. I checked three times with the same data input and on the third try it works as intended | Checked the issue after some time and found that the recursion was one line above it's intended position. Issue resolved with relief |
On testing routes and handling user errors I found that if a user enters wrong information that my handling of ValueError in password_manager is being used but not being raised effectively to be caught with the right intention | Issue resolved and error caught properly after indenting the intended code |
Getting an AttributeError calling the users name from password manager object, I have not specified it as a private member but it is behaving as such | The username object was out of scope for the intended goal, I created an instance attribute and when password manager finishes main purpose it assigns the users name to it |
After installing the Rich module, the terminal is reporting error and not loading terminal | Debugged and couldn't identify the issue so removed the virtual environment and reset it and the list of requirements for Heroku and it solved the issue |
Credentials not being saved to MongoDb and new user cant log in | Ran an npm audit fix and it resolved the issue for creating a new account |
Updating to do list missing last entry by the user when adding to the list and not updating new values when created | Using mongo methods for updating and deleting solved the issue and it's behaving as expected |
I used Visual Studio Code as a local repository and IDE & GitHub as a remote repository.
-
Firstly, I needed to create a new repository on Github rapid-silver.
-
I opened that repository on my local machine by copying the URL from that repository and cloning it from my IDE for use.
-
Visual Studio Code opened a new workspace for me.
-
I created files and folders to use.
-
To push my newly created files to GitHub I used the terminal by pressing Ctrl + shift + `.
-
A new terminal opened and then I used the below steps.
- git add (name of the file) This selects the file for the commit
- git commit -m "Commit message: (i.e. Initial commit)" Allows the developer to assign a specific concise statement to the commit
- git push The final command sends the code to GitHub
If you would like to clone this repository please follow the bellow steps.
Instructions:
- Log into GitHub
- Navigate to the repository you want to clone
- Click on the green button labelled 'Code'
- Copy the URL under the HTTPS option
- Open an IDE of your choosing that has Git installed
- Open a new terminal window in your IDE
- Type this exactly: git clone the-URL-you-copied-from-GitHub
- Hit Enter
You should have a local copy of the repository to use on your machine.
As a deployment solution I chose Heroku.
To deploy a project using Heroku follow these steps:
-
Log into heroku
-
Go to the heroku dashboard
-
Create a new app by selecting 'New'
-
Give your application a name and select a preferred location
-
Click the 'Create app' button
-
If you have config variables in your application
- Click on settings
- Click 'Reveal config vars'
- Input your deployment variables
-
If you need specific build packs
- Click on settings
- Click on build pack
- Add your packs as needed (Please be aware that the order matters)
- For Rapid Silver, Python and then NodeJs was selected.
-
Once these steps are completed
- Go to the deploy section
- Select your version control system
- For Rapid Silver, GitHub was selected
-
Connect your version control system
-
Add your repository
-
Connect the app selecting 'connect'
-
Either choose automatic deployment or manual deployment
-
Once all these steps are completed and the build is successful
- You can click the 'view' button
- It will reveal your deployed app
Function for clearing the console if an error occurs taken from Delf Stack.