{"id":27624245,"url":"https://github.com/roeisharon/user-server-project","last_synced_at":"2026-04-15T13:33:57.911Z","repository":{"id":288766415,"uuid":"969119458","full_name":"roeisharon/user-server-project","owner":"roeisharon","description":"Flask-based REST API for managing validated users.","archived":false,"fork":false,"pushed_at":"2025-04-19T18:24:29.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-06T21:03:49.634Z","etag":null,"topics":["flask","json","pytest","python","rest-api","server","validation"],"latest_commit_sha":null,"homepage":"","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/roeisharon.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-04-19T12:36:15.000Z","updated_at":"2025-04-19T18:24:32.000Z","dependencies_parsed_at":"2025-04-23T11:32:45.425Z","dependency_job_id":null,"html_url":"https://github.com/roeisharon/user-server-project","commit_stats":null,"previous_names":["roeisharon/user-server-project"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/roeisharon/user-server-project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roeisharon%2Fuser-server-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roeisharon%2Fuser-server-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roeisharon%2Fuser-server-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roeisharon%2Fuser-server-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roeisharon","download_url":"https://codeload.github.com/roeisharon/user-server-project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roeisharon%2Fuser-server-project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31842958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T13:28:40.153Z","status":"ssl_error","status_checked_at":"2026-04-15T13:28:29.396Z","response_time":63,"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":["flask","json","pytest","python","rest-api","server","validation"],"created_at":"2025-04-23T11:24:53.109Z","updated_at":"2026-04-15T13:33:57.906Z","avatar_url":"https://github.com/roeisharon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# User Server Project\n\n## Project Summary\n\nThis project is a RESTful web server built with Python and Flask. It manages user data including name, phone number, ID, and address. The server reads from a JSON file at startup and allows access via RESTful API endpoints for retrieving or creating users. The JSON file acts as a lightweight alternative to a traditional database, enabling simple data persistence without external dependencies. It validates Israeli IDs and phone numbers, persists new valid users to the file, and handles bad input or duplicates with clear error messages. A test suite built with pytest ensures reliable behavior and edge-case handling. The code is documented, tested, and ready to run on any Linux/macOS/Windows environment.\n\n---\n\n## Features\n\n- Load user data from a JSON file\n- Validate Israeli ID numbers and phone numbers\n- REST API with:\n  - `GET /users` - List all usernames\n  - `GET /users/\u003cname\u003e` - Get full user info (case-insensitive)\n  - `POST /users` - Create a new user\n- Persist new users to `users.json`\n- Extensive input validation\n- Full test suite using `pytest`\n\n---\n\n## How to Run the Server (Linux)\n\n### Install Dependencies Automatically\nAfter cloning the project and activating the virtual environment, you can install all required packages with:\n```bash\npip install -r requirements.txt\n```\n\nAlternatively, you can install them manually (see below).\n\n### 1. Clone or Download the Project\n```bash\ngit clone \u003cyour-repo-url\u003e\ncd user_server_project\n```\n\n### 2. Create and Activate a Virtual Environment\n```bash\npython3 -m venv venv\nsource venv/bin/activate\n```\n\n### 3. Install Required Packages\n```bash\npip install Flask pytest\n```\n\n### 4. Run the Server\n```bash\npython server.py\n```\nVisit: `http://localhost:5000`\n\n### 5. Use curl to Test API\n```bash\n# Get all users\ncurl http://localhost:5000/users\n\n# Get user by name\ncurl http://localhost:5000/users/roei\n\n# Add a new user\ncurl -X POST http://localhost:5000/users \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"id\": \"328957431\",\n    \"name\": \"RoeiTest\",\n    \"phone\": \"0531234567\",\n    \"address\": \"Tel Aviv\"\n}'\n```\n\n---\n\n## How to Run the Tests\n```bash\npytest test_server.py\n```\n\nYou should see:\n```\ncollected 7 items\ntest_server.py .......                        [100%]\n```\n\n---\n\n## File Structure\n```\nuser_server_project/\n├── server.py          # Main Flask server\n├── user.py            # User class\n├── validator.py       # ID and phone validation\n├── users.json         # Loaded and updated user data\n├── test_server.py     # Full pytest suite\n├── requirements.txt   # Python dependencies file\n├── venv/              # Python virtual environment\n```\n\n---\n\n## Notes\n- All new users are validated and then saved to `users.json`\n- If `users.json` is missing, the server starts with an empty map\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froeisharon%2Fuser-server-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froeisharon%2Fuser-server-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froeisharon%2Fuser-server-project/lists"}