{"id":27390866,"url":"https://github.com/manish-jsx/flaskproject","last_synced_at":"2025-06-28T04:33:54.519Z","repository":{"id":240622126,"uuid":"803125745","full_name":"manish-jsx/flaskproject","owner":"manish-jsx","description":"Machine Learning Project Portfolio","archived":false,"fork":false,"pushed_at":"2024-05-29T04:10:55.000Z","size":383,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-20T20:08:58.215Z","etag":null,"topics":["csv","flask","graph","machine-learning","pandas-python"],"latest_commit_sha":null,"homepage":"https://flaskproject-4182.onrender.com/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/manish-jsx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-20T05:51:37.000Z","updated_at":"2024-06-10T05:01:30.000Z","dependencies_parsed_at":"2024-05-20T07:27:42.825Z","dependency_job_id":"dc0e16c3-e21b-4d51-bdef-3413a5987915","html_url":"https://github.com/manish-jsx/flaskproject","commit_stats":null,"previous_names":["manish-jsx/flaskproject"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/manish-jsx/flaskproject","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manish-jsx%2Fflaskproject","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manish-jsx%2Fflaskproject/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manish-jsx%2Fflaskproject/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manish-jsx%2Fflaskproject/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manish-jsx","download_url":"https://codeload.github.com/manish-jsx/flaskproject/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manish-jsx%2Fflaskproject/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262376080,"owners_count":23301343,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csv","flask","graph","machine-learning","pandas-python"],"created_at":"2025-04-13T20:04:33.377Z","updated_at":"2025-06-28T04:33:54.510Z","avatar_url":"https://github.com/manish-jsx.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Flask Data Visualization App\n\nThis is a simple Flask web application that reads data from a CSV file and displays it in a table format on the homepage. Additionally, it provides a bar graph visualization of the data on a separate page using Plotly.\n\n## Screenshots\n\n\u003cdiv style=\"text-align: center;\"\u003e\n    \u003cimg src=\"/screenshots/data_graph.png\" alt=\"Graph\" width=\"300\"/\u003e  \n    \u003cimg src=\"/screenshots/data_table.png\" alt=\"Table\" width=\"300\"/\u003e\n\u003c/div\u003e\n\n## Project Structure\n\n```\nmyproject/\n├── README.md\n├── app/\n│   ├── __init__.py\n│   ├── main.py\n│   ├── templates/\n│   │   ├── base.html\n│   │   ├── graph.html\n│   │   └── index.html\n│   └── wsgi.py\n├── data.csv\n├── graph.csv\n├── requirements.txt\n├── screenshots/\n│   ├── data_graph.png\n│   └── data_table.png\n└── static/\n    └── css/\n        └── styles.css\n```\n\n## Requirements\n\n- Python 3.7+\n- Flask\n- pandas\n- plotly\n\n## Installation\n\n1. **Clone the repository:**\n    ```bash\n    git clone https://github.com/yourusername/myproject.git\n    cd myproject\n    ```\n\n2. **Create a virtual environment:**\n    ```bash\n    python -m venv venv\n    source venv/bin/activate  # On Windows use `venv\\Scripts\\activate`\n    ```\n\n3. **Install the dependencies:**\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n## Usage\n\n1. **Run the Flask application:**\n    ```bash\n    gunicorn app.wsgi:app\n    ```\n\n2. **Open your web browser and navigate to:**\n    ```\n    http://127.0.0.1:5000/\n    ```\n\n## Application Features\n\n### Homepage\n\n- Displays the CSV data in a table format.\n- Provides a link to view the data visualization.\n\n### Graph Page\n\n- Displays a bar graph visualization of the data using Plotly.\n\n## Data Files\n\nThe application reads data from `data.csv` and `graph.csv`. Make sure your CSV files are structured correctly. Here's an example structure for `graph.csv`:\n\n```csv\nCountry,Score\nUSA,85\nCanada,90\nUK,78\nAustralia,88\nIndia,92\nGermany,75\nJapan,80\nChina,95\nFrance,82\nBrazil,87\n```\n\n## Templates\n\n- `base.html`: The base template that includes the navbar, hero section, and footer.\n- `index.html`: Inherits from `base.html` and displays the data table.\n- `graph.html`: Inherits from `base.html` and displays the data graph.\n\n## Static Files\n\n- `styles.css`: Custom styles for the application.\n\n## Deployment on Render\n\nTo deploy this application on Render, follow these steps:\n\n1. **Create a `requirements.txt` file:**\n    ```bash\n    pip freeze \u003e requirements.txt\n    ```\n\n2. **Create a `render.yaml` file** in the root of your project:\n    ```yaml\n    services:\n    - type: web\n        name: my-flask-app\n        env: python\n        region: oregon\n        plan: free\n        buildCommand: pip install -r requirements.txt\n        startCommand: gunicorn app.wsgi:app\n\n\n    ```\n\n3. **Push your code to a GitHub repository.**\n\n4. **Create a new Web Service on Render:**\n    - Go to [Render](https://render.com/).\n    - Click on the \"New\" button and select \"Blueprint\".\n    - Connect your GitHub repository.\n    - Use the settings from your `render.yaml` file.\n\n5. **Deploy the service.**\n\n6. **Access your deployed application.**\n\n\n\n\n\n### Updated Code Files\n\n#### `app/main.py`\n\n```python\nfrom flask import Flask, render_template\nimport pandas as pd\nimport plotly.express as px\nimport os\n\napp = Flask(__name__)\n\nport = int(os.environ.get('PORT', 10000))  # Adjusted the default port\n\n@app.route('/')\ndef index():\n    # Load CSV data\n    data = pd.read_csv('data.csv')\n    # Convert to HTML table\n    data_html = data.to_html(classes='table table-striped', index=False)\n    return render_template('index.html', data=data_html)\n\n@app.route('/graph')\ndef graph():\n    # Load CSV data\n    data = pd.read_csv('graph.csv')\n    \n    # Create a plotly figure\n    fig = px.bar(data, x='Country', y='Score', title='Sample Data Visualization')\n    graph_html = fig.to_html(full_html=False)\n    \n    return render_template('graph.html', graph=graph_html)\n\nif __name__ == '__main__':\n    app.run()\n```\n\n#### `app/wsgi.py`\n\n```python\nfrom app.main import app\n\nif __name__ == \"__main__\":\n    app.run()\n```\n\n#### `app/__init__.py`\n\n```python\n# This file is intentionally left blank.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanish-jsx%2Fflaskproject","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanish-jsx%2Fflaskproject","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanish-jsx%2Fflaskproject/lists"}