Code Monkey home page Code Monkey logo

food-ordering-applicaoin's Introduction

اتوماسیون تغذیه کارمندان

سیستم اتوماسیون تغذیه یا سلف سرویس در واقع یک نوع از سیستم جامع تحویل غذا است که پرسنل و دانشجویان می توانند به منظور سفارش و صرف غذا در سازمان های دولتی و خصوصی و همچنین دانشگاه ها از این سیستم استفاده کنند.

GitHub repo size

GitHub contributors

Tech Stack:

  python3
      jinja2
      sms_ir-python
      requests
      Khayyam
  Flask
    Flask-Captcha2
    Flask-Sqlalchemy
    Flask-Session
    Flask-Wtf
    Flask-Migrate
    Flask-RQ
    Flask-Mail
  Redis 
  Mysql
    PyMySQL
  Html
  Css
      Bootstrap 5.2
      Bootstrap Icon 1.10
  Javascript
      Chart js
      Moment js
      SweetAlert2 js
      Jquery js
      PersianDatePicker js

Persian Version of readme Click

virtual environment:

  Python3 -m venv venv
  or 
  python -m vevn venv

activate:

  source ./venv/bin/active
  or
  .\venv\Scripts\activate.bat

Install dependencies:

  pip install -r requirements.txt

Configurations and Settings:

  • before starting the app, you should do some steps

  • first create your own config file with below command:

    cp .env.sample .env
    
  • then open the .env file and fill in all the required fields

  • the required files include the database configuration, admin configuration, and SecretKey

  • after these steps you have to run below commands for SMS_IR config file

      cp FoodyConfig/StaticConfig/SMS_IR_Config.py.sample FoodyConfig/StaticConfig/SMS_IR_Config.py
    
  • and then open FoodyConfig/StaticConfig/SMS_IR_Config.py and replace your template id (FROM SMS_IR) with fake one in file

  • then init and migrate db with below commands:

      # remember at this poit you should create a database 
      # and also put database name in .env file before running below commands
        
      flask db init
      flask db migrate
      flask db upgrade
    
  • to change the sections, simply open FoodyConfig/StaticConfig/Sections.py and replace all Sections with your own Company Sections (this required a little bit knowledge of Python Dict )

  • one last command is init settings:

      flask create init_setting
    
  • this command update database with setting file

  • simply run the following command :

      flask run [--port int:portNumber] [--debug] [ --reload ] [-- with-threads OR --without-threads]
      or 
      python app.py
    

create superuser account:

for creating admin Account go to root of project and run below commands :

  flask create superuser [--help]

Admin Panel

For the admin panel URL, there is a key in the .env file called ADMIN_LOGIN_TOKEN. You should remember that token because you have to pass that token to a special endpoint every time you want to log in to the admin panel.

Admin Login URL:

Default Token:

The default token is 123654. So, the admin URL login with the default token is:

Nginx Config:

When the application is running with Debug=True (APP-DEBUG property in the .env file), the application itself serves static files locally. However, when the debug mode is set to False, the application no longer serves static files, and Nginx serves them for you. Therefore, if the app's debug mode is set to False, you need to create a reverse proxy and add some configuration to your web server so that the app can render static files correctly.

liara deploy:

this web application configure for deploying to liara.ir if you want to use another pass Service provider make sure, to change nginx config

liara Disk:

this app required a disk Volume to save images food

for this app configure to point to a disk called #Media

so don't forget to create a Disk for this (recommended size: 1G)

CLI Commands :

- create cli:

flask create init_setting [--help]

this command is super important because this command insert all sections,days in database
when ever you add new item to sections you have to run this command

flask create superuser [--help]

Use this command for adding new admin to database

flask create fakeuser [--help]

adding Fake users to app [for development purpose]

- status cli:

flask status users [--help]

this command show you information about users in app (all users, active users, ...)

flask status admins [--help]

this command show you information abut admins in app (all admins, active admins, ...)

flask status orders [--help]

this command show you information abot orders (all orders, today orders, ...)

Admin Panel

User Panel

Responsive

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.