Giter VIP home page Giter VIP logo

thomasforselius-milestone3's Introduction

FriendControl - project documentation

This is the README.md descriptive file of the project FriendControl; an original web project from Thomas Forselius, studying font-end webdevelopement at CodeInstitute.

Responsive Mockup

Table of Contents

  1. What is FriendControl?
  1. UX & UI
  2. Testing
  3. Tech
  4. Deployment
  5. Support

What is it?

FriendControl is the first version of the backend player management for my upcoming real world game FriendFeud. It's a simple python script to crud - create, read, update, delete - players and admins for the game.

The first part of any product or idea is to sketch it down on paper or in a diagram digitally, so I used Lucidchart to help me with the diagram. Lucidchart is a free online tool for just this step in the process.

Diagram

User Story

To start the game, navigate to this adress: Heroku Deployment

The application is started automatically when the page loads. To restart the application, click the button "Run Program" at the top

When starting the game, the user is presented with a menu consisting of 6 menu items: Layout

On each menu item the user is guided through simple steps and is prompted for input when applicable.

UX and UI

Styles

The program is written to be as clear to read as possible, with line breaks to separate information, colors to group certain objects such as inputs, the main menu and wrong input as well as styling the player and admin lists as tables.

The use of colors is also a part of keeping the application interesting and fun to use, instead of the old, tried and true black/white console. Using colorama is a very simple way to spice up an otherwise pale application.

Inputs: Cyan Main menu: Green Player tables: white Wrong input: Red

A key aspect of any user experience is the ease-of-use of a product or application. People want quick and easy to use and navigate. Keep the intrest alive!

Tabulate

Another library that I implemented in this application is Tabulate; which makes displaying data much more efficient visually. There are different styles to choose from, so you can choose which suits your needs most.

Testing

Testing

The testing procedure in this application is done manually by entering different data in the input prompts.

For every input where the application expects a certain type, length or string I have raised an exception in the code with a print()-statement to let the user know that they have entered incorrect code. The make the incorrect input more clear it prints red text explaining what is required for the input to be considered correct. Once again, the ease-of-use for the user is vital to keep the application easy and interesting

Example of test:

  • Where the application prompts for a number (i.e. menu items or player numbers from a list) I enter letters and/or special characters There should be a red print()-statement declaring wrong input, and the user is prompoted again until the correct value is entered
  • Where the application prompts for a string value, the only restriction is the length of input which must be longer than 2 letters.
  • At the main menu, the user only has 6 alternatives, any input that is a string, more than the num 6 or less than the num 1 triggeres an exception with a red print()-statement

In my future projects I will be looking to use pytest for testing. Pytest is a python framework for automated testing of code which saves time for both me as an author and anybody whom may want to fork the project and test themselves

Technologies

  • Python is the language used for this project

  • Pep8 An online code checker for python code

  • Lucidchart For making mockup diagrams

Github

  • VSCode The application was built using the IDE VS Code. It's a program for both Windows and MacOS that you run locally but can connect to your github account, built in terminal and live server. It's a perfect tool for writing code locally before pushing to github or uploading to the internet.

To install libraries in VSCode I use the command 'pip install library name ' - this downloads the library to my computer. To be able to use libraries in my deployed project I need to add them to the top of the run.py file like this:

example: import gspread
example: from colorama import Fore, Back, Style, init

Also these must be added to the file: requirements.txt like this: first the library name, followed by == and then the library version

tabulate==0.8.9
colorama==0.4.4

Gspread is a library from Google to be able to read/write to google documents

OAuth 2.0 is used to authenticate towards Google API's

Colorama is a library that lets you simply add color to your terminal application

Lets you style your displayment of data to tables of different styles. This a very simple and pwerful way to make the readability of your code better

An online platform where people upload and contribute code they have written.

An online platform for deploying backend applications and code

Deployment

  • After making the brainstorming diagram in Lucidchart, I do the following steps:

The first step is to create a Google Sheet file to store all my data in. This is done by this process:

Create a spreadsheet file in your Google Docs

Screenshot of Spreadsheet

Setting up credentials

Follow this tutorial form CodeInstitute on how to setup your API credentials:

Youtube Tutorial

Now you must add the code to the run.py to be able to connect to the spreadsheet

Credentials

Setting up GitHub repository

  1. Go to my github account and create a new repository
  2. I clone that repository to my computer via VSCode using the following code in the terminal: gh repo clone ThomasForselius/milestone3 note: this requires github extension being installed in VSCode and user logged in to the extension
  3. Now I write all code and add images locally.
  4. When finished with a part of the code, I add, commit and push the changes to github via the source control tab

Checking Pep8

Pep8

Using http://pep8online.com/ i check the code for flaws, and when it's done and fixed, I save the code and commit and push to GitHub. Then I proceed to deploy it on Heroku according to the steps below:

Setting up Heroku project and connecting from GitHub

Since I deploy my python code from GitHub to Heroku, I need to connect them with the following steps:

  1. Register account on Heroku and then login
  2. In the upper right hand corner, add a New App
  3. Choose App name and region
  4. Navigate to Settings tab
  5. Under Config Vars, click Reveal Config Vars
  6. In the KEY input write CREDS
  7. In the VALUE textbox, enter the credentials from your CREDS.json file
  8. The second config variable you need is to enter key: PORT and value: 8000, then press 'add'
  9. Under Buildpacks - add first(!) python and then(!) node.js
  10. Navigate to Deploy section and choose GitHub as deployment method
  11. Login to your github account, and then choose a repo to deploy to Heroku
  12. When you have found your repo, click Connect
  13. Now you can deploy your project directly to Heroku from GitHub

Support

  • Stackoverflow
  • Slack with fellow students in the CodeInstitute Course
  • Ronan McClelland, my mentor who is fantastic in supporting and guiding me in the right way

thomasforselius-milestone3's People

Contributors

thomasforselius avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.