Giter VIP home page Giter VIP logo

lms's Introduction

Team Unity - LMS application

Welcome

This project is the repository for the LMS application.

Running with docker

Make sure you have docker running locally, otherwise download the desktop application from the docker website.

Create the config file:

cp .env.example .env

Spin up compose:

docker compose up

Create a launch.json file inside .vscode if you want hot-reload and debugging:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Flask via Docker",
            "type": "python",
            "request": "attach",
            "port": 5678,
            "host": "0.0.0.0",
            "pathMappings": [
                {
                    "localRoot": "${workspaceFolder}",
                    "remoteRoot": "/app"
                }
            ]
        }
    ]
}

Run the tests:

docker exec -it lms python3 -m pytest -v

Launch the CLI App: By default, we create a admin user for ease of use, (username: admin, password: admin)

docker exec -it lms python3 cli.py

You're good to go ๐ŸŽ‰
You can now select Flask via Docker in the Run And Debug tab and start debugging away ๐Ÿค—

Stop docker-compose:

docker-compose down -v --remove-orphans

Running without docker-compose

Prerequisites

Make sure you have python 3.11 installed and running on your computer, otherwise download the latest version either via pyenv or via the python website

Install Python via pyenv

Click here and follow step 2, 3 and 4

Install python (we currently run 3.11.6) and make it your default version:

pyenv install 3.11.6
pyenv global 3.11.6

Create a virtual environment and activate it:

python3 -m venv venv
source venv/bin/activate

Install the python requirements:

python3 -m pip install -r requirements.txt -r tests/requirements.txt

Run the app

You should now be able to run the app locally:

Visual Studio Code configuration

Create a new launch.json inside .vscode:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Flask",
            "type": "python",
            "request": "launch",
            "module": "flask",
            "env": {
                "FLASK_APP": "lms/app.py",
                "FLASK_ENV": "development",
                "DEBUG": "1"
            },
            "args": [
                "run",
                "--port=5002"
            ],
            "jinja": true
        }
    ]
}

You'll then be able to start the application via the debugger

The app should be running on http://127.0.0.1:5002

Other editors
flask --app lms.app run

The app should be running on http://127.0.0.1:5000


lms's People

Contributors

sebdeol avatar

Stargazers

Hainadine Chamane 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.