Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Database Setup:

    • Clone openIMIS Database Project:

      Code Block
      git clone https://github.com/openimis/openimis-db_dkr.git
    • In SQL Server, create a new Database, e.g., "open-imis-db".

    • Create a database user with read, write, and adminddl access only to our database.

    • Log in to the database as the newly added user.

    • Navigate to the cloned folder 'database_ms_sqlserver' within the openIMIS Database Project.

    • Open a Linux shell and execute the script file "concatenate_files.sh" located in the aforementioned folder.

    • Run the generated sql script in the output folder, e.g., "fullDemoDatabase.sql".

  2. Backend Setup:

    • Clone openIMIS Backend Project:

      Code Block
      git clone https://github.com/openimis/openimis-be_py.git
    • Create your .env file based on the provided example.env file.

    • Ensure that you have the correct settings within your .env file

      Code Block
      MSSQL_DB_USER= <your database user name>
      MSSQL_DB_PASSWORD = <your database user password>
      MSSQL_DB_NAME = <your database name>
      
      DB_DEFAULT=mssql
    • Install openIMIS (external) dependencies:

      • Open the command prompt.

      • Navigate to the cloned repository "..\openimis-be_py".

      • virtual environment:

        • Create your virtual environment:

          Code Block
          python -m virtualenv venv
        • Activate your virtual environment

          Code Block
          venv\Scripts\activate
      • install requirements

        Code Block
        pip install -r requirements.txt
        Code Block
        python script\modules-requirements.py openimis.json > modules-requirements.txt
        Code Block
        pip install -r modules-requirements.txt
        Code Block
        pip install -U 'Twisted[tls,http2]'

      Migrate the Database with the Backend:

      • Open the command prompt and navigate to "openimis-be_py/openIMIS".

      • Run

        Code Block
        python manage.py migrate
      • Start the server by running:

        • run server on port 8000

          Code Block
          python manage.py runserver
        • or run server with specified port

          Code Block
          python manage.py runserver <your port> 
  3. Frontend Setup (on work):
    will ba shared soon:

    • Clone the Frontend Repository

      Code Block
      languagepowershell
      git clone https://github.com/openimis/openimis-fe_js.git
    • Switch to Your Frontend Project Directory

      Code Block
      languagepowershell
      cd path/to/openimis-fe_js

      Replace path/to with the actual path where you cloned the repository.

    • Configure the Backend Port in package.json: Open the package.json file in your preferred text editor and ensure the proxy configuration points to your backend port. It should look something like this:

      Code Block
      languagejson
      "proxy": "http://localhost:<your backend port number>"

      Replace <your backend port number> with the actual port number your backend is running on.

    • Load Configuration

      Code Block
      languagepowershell
      yarn load-config

      This step loads necessary configurations for the project.

    • Build the Project

      Code Block
      languagepowershell
      yarn build

      This command builds the project for production.

    • Install serve Globally

      Code Block
      languagepowershell
      yarn global add serve

      This command installs serve, a simple static file server, globally on your system.

    • Start the Project

      Code Block
      languagepowershell
      yarn start

      This command starts the development server. You can now access the frontend in your browser at http://localhost:3000 (or another port if specified).