{"id":30496221,"url":"https://github.com/foobar404/semantiks-code-test","last_synced_at":"2025-08-25T01:23:20.883Z","repository":{"id":310563003,"uuid":"1036915823","full_name":"foobar404/semantiks-code-test","owner":"foobar404","description":"The Challenge Build a simple application for managing and publishing AI prompts (these could be used in AI tools, bots, or assistant configurations).","archived":false,"fork":false,"pushed_at":"2025-08-12T21:00:48.000Z","size":292,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-18T22:52:23.695Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/foobar404.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":"2025-08-12T19:18:04.000Z","updated_at":"2025-08-12T21:00:51.000Z","dependencies_parsed_at":"2025-08-18T22:52:29.358Z","dependency_job_id":"e189e579-6ef8-4938-bf1d-6a038a8216f1","html_url":"https://github.com/foobar404/semantiks-code-test","commit_stats":null,"previous_names":["foobar404/semantiks-code-test"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/foobar404/semantiks-code-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foobar404%2Fsemantiks-code-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foobar404%2Fsemantiks-code-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foobar404%2Fsemantiks-code-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foobar404%2Fsemantiks-code-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foobar404","download_url":"https://codeload.github.com/foobar404/semantiks-code-test/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foobar404%2Fsemantiks-code-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271990535,"owners_count":24854703,"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","status":"online","status_checked_at":"2025-08-24T02:00:11.135Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2025-08-25T01:23:17.362Z","updated_at":"2025-08-25T01:23:20.871Z","avatar_url":"https://github.com/foobar404.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"./screenshot.png\"\u003e\n\n## How to Run\n\n### Prerequisites\n\n1. **PostgreSQL Database Setup**:\n   - Install PostgreSQL on your machine\n   - Create a database user `postgres` with password `postgres`\n   - Ensure PostgreSQL is running on port `5432`\n   - Or modify the `DATABASE_URL` in `backend/database.py` for your setup\n\n### Frontend (Next.js + shadcn/ui)\n\n1. Open a terminal in the `frontend` directory.\n2. Install dependencies:\n   ```powershell\n   npm install\n   ```\n3. Start the development server:\n   ```powershell\n   npm run dev\n   ```\n4. Visit [http://localhost:3000](http://localhost:3000) in your browser.\n\n### Backend (FastAPI + PostgreSQL)\n\n1. Open a terminal in the `backend` directory.\n2. Activate the Python virtual environment:\n   ```powershell\n   .\\venv\\Scripts\\activate\n   ```\n3. Set up the database (first time only):\n   ```powershell\n   python setup_db.py\n   python seed_db.py\n   ```\n4. Start the FastAPI server:\n   ```powershell\n   uvicorn main:app --reload\n   ```\n5. Visit [http://localhost:8000](http://localhost:8000) for the API.\n\n## Example API Usage\n\n### List All Published Prompts\n```powershell\ncurl http://localhost:8000/prompts\n```\nResponse:\n```json\n[\n  {\n    \"id\": 1,\n    \"title\": \"Sample Prompt\",\n    \"description\": \"This is a sample prompt.\",\n    \"published\": true,\n    \"active\": true,\n    \"tags\": \"sample, test\"\n  },\n  {\n    \"id\": 2,\n    \"title\": \"Creative Writing Assistant\",\n    \"description\": \"Help users write creative stories and poems.\",\n    \"published\": true,\n    \"active\": false,\n    \"tags\": \"creative, writing, assistant\"\n  }\n]\n```\n\n### Filter Prompts by Status\n```powershell\ncurl \"http://localhost:8000/prompts?status=active\"\n```\n\n### Filter Prompts by Tag\n```powershell\ncurl \"http://localhost:8000/prompts?tag=creative\"\n```\n\n### Filter Prompts by Both Status and Tag\n```powershell\ncurl \"http://localhost:8000/prompts?status=active\u0026tag=assistant\"\n```\n\n### Add New Prompt with Tags\n```powershell\ncurl -X POST \"http://localhost:8000/prompts\" -H \"Content-Type: application/json\" -d \"{\\\"id\\\": 3, \\\"title\\\": \\\"Code Review Helper\\\", \\\"description\\\": \\\"Assists in reviewing code for best practices and bugs.\\\", \\\"published\\\": true, \\\"active\\\": true, \\\"tags\\\": \\\"code, review, programming\\\"}\"\n```\nResponse:\n```json\n{\n  \"id\": 3,\n  \"title\": \"Code Review Helper\",\n  \"description\": \"Assists in reviewing code for best practices and bugs.\",\n  \"published\": true,\n  \"active\": true,\n  \"tags\": \"code, review, programming\"\n}\n```\n\n### Get Specific Prompt\n```powershell\ncurl http://localhost:8000/prompts/1\n```\nResponse:\n```json\n{\n  \"id\": 1,\n  \"title\": \"Sample Prompt\",\n  \"description\": \"This is a sample prompt.\",\n  \"published\": true,\n  \"active\": true,\n  \"tags\": \"sample, test\"\n}\n```\n\n### Update Prompt Status (Activate)\n```powershell\ncurl -X PATCH \"http://localhost:8000/prompts/2/status?active=true\"\n```\nResponse:\n```json\n{\n  \"id\": 2,\n  \"title\": \"Creative Writing Assistant\",\n  \"description\": \"Help users write creative stories and poems.\",\n  \"published\": true,\n  \"active\": true,\n  \"tags\": \"creative, writing, assistant\"\n}\n```\n\n### Update Prompt Status (Deactivate)\n```powershell\ncurl -X PATCH \"http://localhost:8000/prompts/1/status?active=false\"\n```\nResponse:\n```json\n{\n  \"id\": 1,\n  \"title\": \"Sample Prompt\",\n  \"description\": \"This is a sample prompt.\",\n  \"published\": true,\n  \"active\": false,\n  \"tags\": \"sample, test\"\n}\n```\n\n### Delete Prompt\n```powershell\ncurl -X DELETE \"http://localhost:8000/prompts/3\"\n```\nResponse:\n```json\n{\n  \"message\": \"Prompt deleted successfully\"\n}\n```\n\n### API Documentation\nVisit [http://localhost:8000/docs](http://localhost:8000/docs) for interactive API documentation (Swagger UI)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoobar404%2Fsemantiks-code-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoobar404%2Fsemantiks-code-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoobar404%2Fsemantiks-code-test/lists"}