{"id":22420039,"url":"https://github.com/tempehs/2025se_elliott.p_hsc","last_synced_at":"2025-10-15T22:31:00.026Z","repository":{"id":262976296,"uuid":"888488131","full_name":"TempeHS/2025SE_Elliott.P_HSC","owner":"TempeHS","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-30T10:53:56.000Z","size":1954,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-30T11:31:39.463Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TempeHS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"security_log.log","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-14T13:39:54.000Z","updated_at":"2025-01-30T10:53:59.000Z","dependencies_parsed_at":"2024-11-15T11:28:09.554Z","dependency_job_id":"d5bb8cf5-3d11-49d8-96b7-157c3229229b","html_url":"https://github.com/TempeHS/2025SE_Elliott.P_HSC","commit_stats":null,"previous_names":["tempehs/2025se_elliott.p_hsc"],"tags_count":0,"template":false,"template_full_name":"TempeHS/Secure_Flask_PWA_Template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TempeHS%2F2025SE_Elliott.P_HSC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TempeHS%2F2025SE_Elliott.P_HSC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TempeHS%2F2025SE_Elliott.P_HSC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TempeHS%2F2025SE_Elliott.P_HSC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TempeHS","download_url":"https://codeload.github.com/TempeHS/2025SE_Elliott.P_HSC/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236646158,"owners_count":19182608,"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":[],"created_at":"2024-12-05T16:17:28.458Z","updated_at":"2025-10-15T22:30:59.575Z","avatar_url":"https://github.com/TempeHS.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DevLog - Developer Log Management System\n\n### IF THE MAIL DOESNT WORK, PLEASE MESSAGE ME ON elliott.pezzutti@education.nsw.gov.au\n\n\u003e **Note:** For 2FA mail-related issues, contact elliott.pezzutti@education.nsw.gov.au\n\n\n## Security Features\n- Bcrypt password hashing\n- CSRF protection on all forms\n- Session management with 1-hour timeout\n- Two-Factor Authentication via email\n- API key authentication\n- Input sanitization and validation\n- Secure cookie handling\n- XSS protection\n\n## Quick Links\n- [Security Features](#security-features)\n- [API Documentation](#api-documentation)\n- [Setup Guide](#setup-guide)\n- [Testing Guide](#testing-guide)\n\n## API endpoints\n- POST /api/auth/signup     - Create new user\n- POST /api/auth/login      - Login existing user\n- POST /api/user/generate-key - Generate API key\n- POST /api/auth/enable-2fa - Enable 2FA\n- POST /api/auth/verify-2fa - Verify 2FA code\n\n## Entries\n- POST /api/entries         - Create new entry\n- GET  /api/entries        - Get all entries\n- GET  /api/entries/search - Search entries with filters\n- GET  /api/entries/metadata - Get projects and developers list\n\n# Devlog webapp initialisation and User Acceptance Testing\n\n## Initialisation\nPrerequisites:\n- Python 3.12+\n- Flask 3.0.0+\n- SQLite 3+\n(we have this because of codespace)\n\n1. set up dependancies:\n\n  pip install -r requirements.txt\n\n4. verify .env file:\n\n  SECRET_KEY=your-secure-secret-key-here\n  DATABASE_URL=sqlite:///.databaseFiles/devlog.db\n  MAIL_USERNAME=elliottpezzutti@gmail.com\n  MAIL_PASSWORD=itoy hsyh kudx cgsf \n\nthe mail password is a app password generated from my google account, mail me if it does not work and needs to be updated\n\n\n\n\n\n## generate base test data\nYou can create whatever test data you want, but here is a basic example:\nALSO THE API ENDPOINT VERSION OF THIS IS POSSIBLY FASTER, but fidgety\n\n1. Create User 1:\ngo to sign up and use\n```\n      email: user1@example.com\n      password: UserUser!1\n      developer_tag: user1\n```\n\n2. Create User 2:\ngo to sign up and use\n```\n      email: user2@example.com\n      password: UserUser@2\n      developer_tag: user2\n```\n3. generate API key:\nyou can do this from the user profile page, by clicking the generate API key button\nthis can be done with API, but its just easier and more functional to do it from the profile page.\n\n4. generate entries, FILL IN API KEY:\n```bash\n      project: Project Name,\n      content: \"Entry content,\n      repository_url: https://github.com/user/repo\n      start_time: 2024-01-31T10:00:00\n      end_time: 2024-01-31T11:00:00\n```\n\n\n\u003cdetails\u003e\n\u003csummary\u003e API usage test with enpoints (works) \u003c/summary\u003e\n\n1. Create User 1:\nor API it\n```bash\n  curl -X POST http://localhost:5000/api/auth/signup \\\n    -H \"Content-Type: application/json\" \\\n    -d '{\n      \"email\": \"user1@example.com\",\n      \"password\": \"UserUser!1\",\n      \"developer_tag\": \"user1\"\n    }'\n```\n2. Create User 2:\nor API it\n```bash\n  curl -X POST http://localhost:5000/api/auth/signup \\\n    -H \"Content-Type: application/json\" \\\n    -d '{\n      \"email\": \"user2@example.com\",\n      \"password\": \"UserUser@2\",\n      \"developer_tag\": \"user2\"\n    }'\n```\n3. generate API key:\nyou can do this from the user profile page, by clicking the generate API key button\nthis can be done with API, but its just easier and more functional to do it from the profile page.\n\n4. generate entries, FILL IN API KEY:\n```bash\n  curl -X POST http://your-api/api/entries \\\n    -H \"X-API-Key: YOUR_API_KEY\" \\\n    -H \"Content-Type: application/json\" \\\n    -d '{\n      \"project\": \"Project Name\",\n      \"content\": \"Entry content\",\n      \"repository_url\": \"https://github.com/user/repo\",\n      \"start_time\": \"2024-01-31T10:00:00\",\n      \"end_time\": \"2024-01-31T11:00:00\"\n    }'\n```\n\u003c/details\u003e\n\n### User Acceptance Testing Guide\n\n1. Sign in with one of the example credintials (in this case user1) and Create a new entry with alot of text for the content\n\n2. then go to your profile page and check that the entry is there, then click on it and it will go to the full veiw\n\n3. then create another entry with a different project and check that it is there and verify the statistics on the profile page match the entries\n\n4. go to the profile page, click log out, sign in on another user(user2), and enter a different entry under one of the same project names of the other user.\n\n5. log out, sign in as the first user(user1) and check the home page to see that the entry matching your project activity is there.\n\n\u003cdetails\u003e\n\u003csummary\u003eif you want to API this\u003c/summary\u003e\n\n# this is the api version of the above, but it doesnt demonstrate the funcitonality of the website well\n## Get CSRF token\n```bash\ncurl -s http://localhost:5000/login | grep \"csrf-token\"\n```\n## 1. Sign in as user1 and create entry FILL IN CSRF\n```bash\ncurl -X POST http://localhost:5000/api/auth/login -c cookies.txt -H \"Content-Type: application/json\" -H \"X-CSRF-TOKEN: YOUR_TOKEN\" -d '{\"email\":\"user1@example.com\", \"password\":\"UserUser!1\"}'\n\ncurl -X POST http://localhost:5000/api/entries -b cookies.txt -H \"Content-Type: application/json\" -H \"X-CSRF-TOKEN: YOUR_TOKEN\" -d '{\n    \"project\": \"project_alpha\",\n    \"content\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\",\n    \"repository_url\": \"https://github.com/test/project_alpha\",\n    \"start_time\": \"2024-02-01T09:00:00\",\n    \"end_time\": \"2024-02-01T11:30:00\"\n}'\n```\n## 2. Check profile and entry\n```bash\ncurl -b cookies.txt http://localhost:5000/api/entries/user-stats\ncurl -b cookies.txt http://localhost:5000/api/entries/1\n```\n## 3. Create second entry and verify stats FILL IN CSRF\n```bash\ncurl -X POST http://localhost:5000/api/entries -b cookies.txt -H \"Content-Type: application/json\" -H \"X-CSRF-TOKEN: YOUR_TOKEN\" -d '{\n    \"project\": \"project_beta\",\n    \"content\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\",\n    \"repository_url\": \"https://github.com/test/project_beta\",\n    \"start_time\": \"2024-02-01T13:00:00\",\n    \"end_time\": \"2024-02-01T15:30:00\"\n}'\n\ncurl -b cookies.txt http://localhost:5000/api/entries/user-stats\n```\n## 4. Logout, login as user2, create entry FILL IN CSRF\n```bash\ncurl -X POST http://localhost:5000/api/auth/logout -b cookies.txt -H \"X-CSRF-TOKEN: YOUR_TOKEN\"\n\ncurl -X POST http://localhost:5000/api/auth/login -c cookies.txt -H \"Content-Type: application/json\" -H \"X-CSRF-TOKEN: YOUR_TOKEN\" -d '{\"email\":\"user2@example.com\", \"password\":\"UserUser@2\"}'\n\ncurl -X POST http://localhost:5000/api/entries -b cookies.txt -H \"Content-Type: application/json\" -H \"X-CSRF-TOKEN: YOUR_TOKEN\" -d '{\n    \"project\": \"project_alpha\",\n    \"content\": \"User2 working on project_alpha. Adding new features to existing codebase.\",\n    \"repository_url\": \"https://github.com/test/project_alpha\",\n    \"start_time\": \"2024-02-01T16:00:00\",\n    \"end_time\": \"2024-02-01T17:30:00\"\n}'\n```\n## 5. Logout, login as user1, check home\n```bash\ncurl -X POST http://localhost:5000/api/auth/logout -b cookies.txt -H \"X-CSRF-TOKEN: YOUR_TOKEN\"\n\ncurl -X POST http://localhost:5000/api/auth/login -c cookies.txt -H \"Content-Type: application/json\" -H \"X-CSRF-TOKEN: YOUR_TOKEN\" -d '{\"email\":\"user1@example.com\", \"password\":\"UserUser!1\"}'\n\ncurl -b cookies.txt http://localhost:5000/api/entries/search?project=project_alpha\n```\n^ this doesnt demonstrate the functionality of the home page correctly, but pretty much it does\n\u003c/details\u003e\n\n##### If all tests are passed, log entry, home page, profile page, and cross user entry meta data should be working correctly.\n\n\n#### if you ever have any issues PLEASE WRITE THEM DOWN IN A .TXT FILE and COPY AND PASTE THE LOGS / ERROR ALERTS INTO THE FILE.\n\n\n\n## FUNCTIONAL API ENDPOINTS\n\nthis doesnt have alot of support, but it is usable\n\n## Get CSRF token needed for alot of the commands\n### Save CSRF token to file\n```bash\ncurl -s http://localhost:5000/login | grep \"csrf-token\" | sed 's/.*content=\"\\([^\"]*\\)\".*/\\1/' \u003e csrf_token.txt\n```\n\n#### Function to read token (add to start of script)\n\n```bash\nTOKEN=$(cat csrf_token.txt) \u0026\u0026\n```\n\n## authentication stuff\n\n\n\u003cdetails\u003e\n\u003csummary\u003e \nLogin as a user with 2fa disabled\n\u003c/summary\u003e\n\nfill in the YOUR_EMAIL, and USER_PASSWORD\n```bash\nTOKEN=$(cat csrf_token.txt) \u0026\u0026\ncurl -X POST http://localhost:5000/api/auth/login -c cookies.txt -H \"Content-Type: application/json\" -H \"X-CSRF-TOKEN: $TOKEN\" -d '{\n    \"email\": \"user1@example.com\",\n    \"password\": \"UserUser!1\"\n}'\n```\nyou will then be logged in for a bit\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e Login as a user with 2fa enabled (no api key)\u003c/summary\u003e\n\n1. fill in the  YOUR_EMAIL, and USER_PASSWORD\n```bash\nTOKEN=$(cat csrf_token.txt) \u0026\u0026\ncurl -X POST http://localhost:5000/api/auth/login -c cookies.txt -H \"Content-Type: application/json\" -H \"X-CSRF-TOKEN: $TOKEN\" -d '{\n    \"email\": \"YOUR_EMAIL\",\n    \"password\": \"USER_PASSWORD\"\n}'\n```\n\n2. fill in the VERIFICATION (code sent to your email)\n```bash\nTOKEN=$(cat csrf_token.txt) \u0026\u0026\ncurl -X POST http://localhost:5000/api/auth/verify-login -b cookies.txt -H \"Content-Type: application/json\" -H \"X-CSRF-TOKEN: $TOKEN\" -d '{\n    \"code\": \"VERIFICATION\"\n}'\n```\n\nyou will now be logged in with 2fa for a bit\n\n\u003c/details\u003e\n\n### logout\n```bash\nTOKEN=$(cat csrf_token.txt) \u0026\u0026\ncurl -X POST http://localhost:5000/api/auth/logout -b cookies.txt -H \"X-CSRF-TOKEN: $TOKEN\"\n```\n## entry stuff\n\n###\n\u003cdetails\u003e\n\u003csummary\u003e create entries once logged in\u003c/summary\u003e\n\n\n1. log in\n\n2. fill in this template\n```bash\nTOKEN=$(cat csrf_token.txt) \u0026\u0026\ncurl -X POST http://localhost:5000/api/entries -b cookies.txt -H \"Content-Type: application/json\" -H \"X-CSRF-TOKEN: $TOKEN\" -d '{\n    \"project\": \"project_name\",\n    \"content\": \"Entry content here\",\n    \"repository_url\": \"https://github.com/user/repo\",\n    \"start_time\": \"2024-02-01T09:00:00\",\n    \"end_time\": \"2024-02-01T10:30:00\"\n}'\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e search entries\u003c/summary\u003e\n\n\n### get some general metadata\n```bash\ncurl -b cookies.txt http://localhost:5000/api/entries/metadata\n```\n### Get All Entries\n```bash\ncurl -b cookies.txt http://localhost:5000/api/entries\n```\n### Get Single Entry\n```bash\ncurl -b cookies.txt http://localhost:5000/api/entries/1\n```\n### Search Entries\n```bash\ncurl -b cookies.txt \"http://localhost:5000/api/entries/search?project=project_name\u0026developer_tag=dev1\u0026date=2024-02-01\"\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e profile utils\u003c/summary\u003e\n\n\n### Enable 2FA\n```bash\nTOKEN=$(cat csrf_token.txt) \u0026\u0026\ncurl -X POST http://localhost:5000/api/auth/enable-2fa -b cookies.txt -H \"Content-Type: application/json\" -H \"X-CSRF-TOKEN: $TOKEN\"\n```\n### Verify 2FA Setup\n```bash \nTOKEN=$(cat csrf_token.txt) \u0026\u0026\ncurl -X POST http://localhost:5000/api/auth/verify-2fa -b cookies.txt -H \"Content-Type: application/json\" -H \"X-CSRF-TOKEN: $TOKEN\" -d '{\n    \"code\": \"123456\"\n}'\n```\n\n### Disable 2FA\n```bash\nTOKEN=$(cat csrf_token.txt) \u0026\u0026\ncurl -X POST http://localhost:5000/api/auth/disable-2fa -b cookies.txt -H \"Content-Type: application/json\" -H \"X-CSRF-TOKEN: $TOKEN\"\n```\n\u003c/details\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftempehs%2F2025se_elliott.p_hsc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftempehs%2F2025se_elliott.p_hsc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftempehs%2F2025se_elliott.p_hsc/lists"}