Git Product home page Git Product logo

xyz-project's Introduction

Requirements for the project:

  • A user signs up using the details
    • Unique Email
    • First Name
    • Surname
    • Password
  • The user logs in using their email and password
    • Sign up and login should be secure on a token based system
    • To do any functionality a secure token is required.
  • The user creates a new project. The project creator is the owner
  • A user can be part of many projects
  • The user can view a list of projects that are already created
  • A project owner can add a registered user to a project using their email address.
  • If a user is part of a project then they can access the project
  • When in a project a user can add a device to the project (for this a device is a record consisting of a 5 digit serial number and a Name)
  • User that have access to a project can see a list of devices.
    • A device can be part of many projects

Run Application:

There are two options to run the application:

  • Run with docker:

    First clone the project:

    git clone https://github.com/mesuttekin/xyz-reality-project.git
    cd xyz-reality-project
    

    Run image build

    docker image build -t xyz-reality-project:latest .
    

    Run container and

    docker run -d -p 5000:5000 xyz-reality-project:latest
    

    And check http://localhost:5000/

  • Run locally:

    This project is developed with Python. So before start please install Python if you don't have it already

    • Python3
    • PIP
    • Virtualenv

    For Mac:

    brew install python3
    python3 -m pip install --user --upgrade pip
    python3 -m pip install --user virtualenv
    

    To test and run application:

    make all
    

    To run test:

    make tests
    

    To run application:

    make run
    

Used python features and extensions:

Below python features and extensions are used within the project.

  • Flask-Bcrypt: A Flask extension that provides bcrypt hashing utilities for your application.
  • Flask-Migrate: An extension that handles SQLAlchemy database migrations for Flask applications using Alembic. The database operations are made available through the Flask command-line interface or through the Flask-Script extension.
  • Flask-SQLAlchemy: An extension for Flask that adds support for SQLAlchemy to your application.
  • PyJWT: A Python library which allows you to encode and decode JSON Web Tokens (JWT). JWT is an open, industry-standard (RFC 7519) for representing claims securely between two parties.
  • Flask-Script: An extension that provides support for writing external scripts in Flask and other command-line tasks that belong outside the web application itself.
  • Namespaces (Blueprints)
  • Flask-restplus
  • UnitTest

Database Models and Migration:

If you want to make any database related changes, please follow below steps.

To perform the migration please run the following commands on the project root directory:

  1. Initiate a migration folder using init command for alembic to perform the migrations.
python manage.py db init
  1. Create a migration script from the detected changes in the model using the migrate command. This doesn’t affect the database yet.
python manage.py db migrate --message 'initial database migration'
  1. Apply the migration script to the database by using the upgrade command
python manage.py db upgrade

If everything runs successfully, you should have a new sqlLite database xyz_reality_main.db file generated inside the main package.

Note: Each time the database model changes, repeat the migrate and upgrade commands

Run Application:

You can run the application with the command below in the project root directory

python manage.py run

Test Application:

You can run the unit tests of the application with the command below in the project root directory

python manage.py test

xyz-project's People

Contributors

mesuttekin avatar

Watchers

James Cloos avatar  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.