{"id":24991801,"url":"https://github.com/junho100/tmr-backend","last_synced_at":"2025-08-16T11:39:43.923Z","repository":{"id":260920023,"uuid":"882696959","full_name":"junho100/tmr-backend","owner":"junho100","description":"A Go-based backend service for TMR (Targeted Memory Reactivation) lab experiment management.","archived":false,"fork":false,"pushed_at":"2025-02-16T13:24:58.000Z","size":56,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-16T14:40:38.814Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/junho100.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}},"created_at":"2024-11-03T14:23:03.000Z","updated_at":"2025-02-16T13:25:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"fb7b3fdb-d9af-4949-85b2-727343163729","html_url":"https://github.com/junho100/tmr-backend","commit_stats":null,"previous_names":["junho100/tmr-backend"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junho100%2Ftmr-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junho100%2Ftmr-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junho100%2Ftmr-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junho100%2Ftmr-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/junho100","download_url":"https://codeload.github.com/junho100/tmr-backend/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246187238,"owners_count":20737463,"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":"2025-02-04T13:52:10.306Z","updated_at":"2025-03-29T13:15:33.796Z","avatar_url":"https://github.com/junho100.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TMR Backend\n\nA Go-based backend service for TMR (Targeted Memory Reactivation) lab experiment management.\n\n## Overview\n\nThis project provides a REST API service for managing TMR lab experiments, including subject management, lab test administration, and result tracking. It's built with Go and uses MySQL as the database.\n\n## Tech Stack\n\n- **Language**: Go 1.22.1\n- **Framework**: Gin Web Framework\n- **Database**: MySQL with GORM\n- **Container**: Docker\n- **CI/CD**: GitHub Actions\n- **Cloud Services**: AWS (ECR, CodeDeploy, S3, EC2)\n\n## Key Features\n\n### 1. Subject Management\n\n- Create new test subjects\n- Verify subject existence\n- Generate unique login IDs for subjects\n\n### 2. Lab Test Management\n\n- Support for pre-tests and post-tests\n- Track breathing patterns during tests\n- Record cue word presentations\n- Store test results and histories\n\n### 3. File Management\n\n- Temporary file storage for test results\n- Automatic file cleanup after expiration (60 minutes)\n- Secure file download functionality\n\n### 4. Slack Integration\n\n- Automated notifications for test events\n- Test result summaries with downloadable CSV files\n- Real-time updates on experiment progress\n\n## Project Structure\n\n- config/: Configuration setup (DB, env)\n- dto/: Data Transfer Objects\n- entity/: Database entities\n- handler/: HTTP request handlers\n- model/: Business logic and database operations\n- router/: Route definitions\n- util/: Utility functions\n- main.go: Application entry point\n\n## API Endpoints\n\n### Subject APIs\n\n- POST /api/subjects - Create new subject\n- GET /api/subjects/check - Check subject existence\n\n### Lab APIs\n\n- POST /api/labs/breathing - Record breathing history\n- POST /api/labs/cue - Record cue presentation\n- POST /api/labs/start-test - Start a new test session\n- POST /api/labs/test - Record test history\n- GET /api/labs/cue - Get target words\n\n### File APIs\n\n- GET /api/files/:filename - Download result files\n\n### Health Check\n\n- GET /api/health - Service health check\n\n## Deployment\n\nThe project uses GitHub Actions for CI/CD pipeline:\n\n1. Builds Docker image\n2. Pushes to Amazon ECR\n3. Deploys to EC2 using AWS CodeDeploy\n\n### Prerequisites\n\n- AWS credentials\n- MySQL database\n- Slack webhook URL\n- Environment variables setup\n\n### Environment Variables\n\n- DB_HOST\n- DB_USERNAME\n- DB_PASSWORD\n- DB_NAME\n- SLACK_WEBHOOK_URL\n- BASE_URL\n\n## Development Setup\n\n1. Clone the repository\n2. Install dependencies: go mod download\n3. Set up environment variables: Copy .env.example to .env and configure\n4. Run the application: go run main.go\n\n## Docker Support\n\nBuild the image:\ndocker build -t tmr-backend .\n\nRun the container:\ndocker run -p 8080:8080 -v /path/to/temp_files:/temp_files tmr-backend\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunho100%2Ftmr-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunho100%2Ftmr-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunho100%2Ftmr-backend/lists"}