Coder Social home page Coder Social logo

metron-ta's Introduction

Metron TA

Metron TA to manage an industrial site. The site has a manager and can have multiple assets.

Requirements

Using python virtual environ
Install python
  • Install python 3.10 on your system.
  • Create and activate a python virtual environment
    • python -m venv env_name
    • source env_name/bin/activate
  • Install all the packages using requirements.txt file. pip install -r requirements.txt
Install mariadb
  • Install mariadb on your system.
  • create and grant access to a new user with username: metron and password metron
  • create a database called MetronTA

You're now up to start the application.

Using docker

You can also install docker on your system to run the app within a docker container.

Features

  • Register and login of the manager
  • All the CRUD operations for Manager, Site and Asset

Build and execution

Launch the API

Using python virtual env

In your folder metron-ta and your activated virtual environment you just created above run the command:

flask run

Your server will listen on http://127.0.0.1:5000

Using docker

In your folder metron-ta simply run :

 docker-compose up --build

If you get the error : interfaceerror: lost connection to mysql server at 'handshake: reading initial communication Run the command second time and everything will be okay.

Your server will listen on http://127.0.0.1:9000

Launch the tests

Using virtual environment

in the same folder metron-ta launch the command :

python -m pytest --setup-show
Using docker

To launch to unit tests simply run :

docker exec metron_api python -m pytest --setup-show

Test with POSTMAN

You can use the postman collection METRON_API_COLLECTION.postman_collection.json with environment variables METRON_API_ENV.postman_environment.json to test the API.

TODO

  • Add more tests case
  • Add logout
  • Add token blacklist

metron-ta's People

Contributors

pakenfit avatar

Watchers

 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.