{"id":41374484,"url":"https://github.com/thinkful-ed/solution-code-flask-database-project-setting-up-databases","last_synced_at":"2026-01-23T10:00:01.292Z","repository":{"id":207832446,"uuid":"719802725","full_name":"Thinkful-Ed/solution-code-flask-database-project-setting-up-databases","owner":"Thinkful-Ed","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-17T20:39:12.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2023-11-20T17:51:13.607Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/Thinkful-Ed.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}},"created_at":"2023-11-16T23:39:32.000Z","updated_at":"2023-11-20T02:29:27.000Z","dependencies_parsed_at":"2023-11-17T21:46:55.545Z","dependency_job_id":null,"html_url":"https://github.com/Thinkful-Ed/solution-code-flask-database-project-setting-up-databases","commit_stats":null,"previous_names":["thinkful-ed/solution-code-flask-database-project","thinkful-ed/solution-code-flask-database-project-setting-up-databases"],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/Thinkful-Ed/solution-code-flask-database-project-setting-up-databases","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thinkful-Ed%2Fsolution-code-flask-database-project-setting-up-databases","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thinkful-Ed%2Fsolution-code-flask-database-project-setting-up-databases/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thinkful-Ed%2Fsolution-code-flask-database-project-setting-up-databases/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thinkful-Ed%2Fsolution-code-flask-database-project-setting-up-databases/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Thinkful-Ed","download_url":"https://codeload.github.com/Thinkful-Ed/solution-code-flask-database-project-setting-up-databases/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thinkful-Ed%2Fsolution-code-flask-database-project-setting-up-databases/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28687414,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T05:48:07.525Z","status":"ssl_error","status_checked_at":"2026-01-23T05:48:07.129Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-23T09:59:59.747Z","updated_at":"2026-01-23T10:00:01.288Z","avatar_url":"https://github.com/Thinkful-Ed.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flask-SQLAlchemy Database Project\n\nThis repository contains the implementation of a simple database system using Flask and Flask-SQLAlchemy. The project demonstrates the creation, configuration, and operation of a basic database for AI models.\n\n## Installation\n\n1. Clone this repository.\n2. Navigate to the project directory:\n```bash\n   cd databases_project\n```\n3. Set up a virtual environment (recommended):\n   - For macOS and Linux:\n```bash\n     python -m venv databases_project_env;\n     source databases_project_env/bin/activate;\n```\n   - For Windows:\n```bash\n     python -m venv databases_project_env\n     .\\databases_project_env\\Scripts\\activate\n```\n4. Install the required packages:\n```shell\n   pip install -r requirements.txt\n```\n\n## Project Structure\n\nThe project is structured into different modules for easy management and scalability:\n\n- `app.py`: Initializes the Flask application and configures the database.\n- `config.py`: Contains configuration settings for the database.\n- `models.py`: Defines the database models (e.g., `AIModel`).\n- `run.py`: The entry point of the Flask application, containing routes and logic.\n- `requirements.txt`: Lists all Python packages required for the project.\n\n## Running the Application\n\nTo start the Flask application:\n\n```bash\npython run.py;\n```\n\n- The application will be accessible at `http://127.0.0.1:5001`.\n- Use the provided endpoints to interact with the database.\n\n## API Endpoints\n\n1. **Add a New AI Model** (`run.py`):\n   - Add a new AI model to the database: `POST /models`\n   - Request body should include `name` and `description` of the AI model.\n\n2. **Home Page**:\n   - Access the welcome message: `GET /`\n\n## Database Model\n\nThe `AIModel` class in `models.py` represents the AI models stored in the database. It includes fields for `id`, `name`, and `description`.\n\n## Notes\n\n- Ensure the virtual environment is activated when running the application.\n- The database is configured to use SQLite (`sqlite:///site.db`).\n\nFeel free to modify and extend the project as needed for your specific requirements!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinkful-ed%2Fsolution-code-flask-database-project-setting-up-databases","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthinkful-ed%2Fsolution-code-flask-database-project-setting-up-databases","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinkful-ed%2Fsolution-code-flask-database-project-setting-up-databases/lists"}