-
Clone the repository:
-
Checkout to edges-integration
git checkout edges-integration
-
Create and Activate virtual env:
python3 -m venv site-front-env source site-front-env/bin/activate
-
Install the dependencies:
pip install -r requirements.txt
-
Set up the environment variables: Create a
.env
file in the root directory and add the following:PORT=5000 [you can choose some other port number too] SOLR_URL= [you need to point this to your solr url]
-
Run the application:
python run.py
- The application will be accessible at
http://localhost:5000
.
This project is missing it's own solr ingration hence we will he using the older project which can be accessible here. You need to follow the following steps
- Run the site-front project, this will allow us to access solr data from the current EMLO front.
- Run the current project.
views/
: Contains the view functions for different routes.templates/
: Contains the HTML templates.static/
: Contains static files like CSS and JS.config.py
: Contains configuration settings.run.py
: The entry point to run the Flask application.setup.py
: Setup script for packaging.requirements.txt
: Python dependencies..env
: Environment variables.
The edges code lies under the static/lib directory. In order to use this code smoothly we have created the files
- _edges_common_js.jinja2 : This file includes all the components and edges you simply need to call this file in your jinja2 files.
- static/js/edges.js : This file has basic structure for you to access edges so the dependencies can be avoided and a better code maintainability can be achieved.
- You can update the variable emloEdges.searchUrl in such a way that it points to the server which will be helping us to fetch data from solr.
- Rules:
- Logic related to the pages will be written in js files we will be using the file format
<route>.edges.js
. - Inside each file you need to follow the same pattern where you will provide
- selector: HTML element ID (without #)
- collection: Solr collection name.
- Components: Array all the components that are to be used by you.
- You will then import this js file inside your jinja2 file using the syntax
<script type="module" src="../static/js/<route>.edges.js">
- Logic related to the pages will be written in js files we will be using the file format