{"id":20083783,"url":"https://github.com/y9c/angular_reatful_gin_sqlite_template","last_synced_at":"2025-05-06T01:31:35.705Z","repository":{"id":43845882,"uuid":"122822027","full_name":"y9c/Angular_Reatful_Gin_Sqlite_template","owner":"y9c","description":"🌐 Angular_Reatful_Gin_Sqlite_template","archived":false,"fork":false,"pushed_at":"2022-02-16T04:59:00.000Z","size":3300,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T06:35:08.208Z","etag":null,"topics":["angular","caddy","echarts","gin","restful-api"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/y9c.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":null,"support":null}},"created_at":"2018-02-25T09:29:00.000Z","updated_at":"2022-10-03T02:53:06.000Z","dependencies_parsed_at":"2022-09-09T22:23:21.206Z","dependency_job_id":null,"html_url":"https://github.com/y9c/Angular_Reatful_Gin_Sqlite_template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y9c%2FAngular_Reatful_Gin_Sqlite_template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y9c%2FAngular_Reatful_Gin_Sqlite_template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y9c%2FAngular_Reatful_Gin_Sqlite_template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y9c%2FAngular_Reatful_Gin_Sqlite_template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/y9c","download_url":"https://codeload.github.com/y9c/Angular_Reatful_Gin_Sqlite_template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252604300,"owners_count":21775079,"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":["angular","caddy","echarts","gin","restful-api"],"created_at":"2024-11-13T15:48:44.662Z","updated_at":"2025-05-06T01:31:35.354Z","avatar_url":"https://github.com/y9c.png","language":"TypeScript","readme":"# `Angular + Reatful + Gin +  Sqlite` template\n\n## Aim\n\nThe most **basic** code to show the **full** architecture\n\n## Application Architecture\n\n```diagram\n\n    ----------\n    | client | ←-----|\n    ----------       |\n       |             ↓\n       |         ----------\n       |         | server |\n       |         ----------\n       |render       ↑\n       |         ---------\n       ||------→ | Caddy |\n       ||        ---------\n       ↓|proxy       ↑\n    ╔══════╗     -------    ╔═══════╗   --------   ╔══════════╗\n    ║ View ║  →  | API | ←  ║ Model ║ ← | Data | ← ║ Analysis ║\n    ╚══════╝     -------    ╚═══════╝   --------   ╚══════════╝\n        ↓            ↓          ↓           ↓          ↓\n    -----------  -----------  -------  ----------   ----------\n    | Angular |  | Restful |  | Gin |  | Sqlite |   | Pandas |\n    -----------  -----------  -------  ----------   ----------\n        ↓                        ↓                      ↓\n    --------------           ----------             ----------\n    | TypeScript |           | Golang |             | Python |\n    --------------           ----------             ----------\n\n```\n## Fetures\n\n- Angular 5.2.0\n- golang 1.10\n- caddy 0.10.10\n- Echarts 4.0.1\n- python 3.6.4\n- pipenv 8.3.2\n\n## Prerequisites\n\n- **Client**:\n\n\u003e Node, npm\n\n```bash\ncd ./client\nnpm install --global @angular/cli\n```\n\n- **Server**:\n\n\u003e Go, caddy\n\n```bash\ngo get github.com/gin-gonic/contrib/static\ngo get github.com/gin-gonic/gin\ngo get github.com/jinzhu/gorm\ngo get github.com/jinzhu/gorm/dialects/sqlite\n```\n\n```bash\ncurl https://getcaddy.com | bash -s http.git,http.ratelimit\n```\n\n\u003e Python, pandas\n\n```bash\npip install pipenv\ncd ./server/analysis\npipenv install --python 3.6\n```\n\n## Compile and Run\n\nTested on linux machine only!\n\n\u003e Run on development environment\n\n```bash\n# make dev\n\ncd client\nng server \u0026\ncd ..\ngo run server/main.go \u0026\ncaddy -conf ./server/caddy/Caddyfile_dev\n```\n\n\u003e Run on production environment\n\n```bash\n# make run\n\ncd client\nng build --prod\ncd ../server\ngo build main.go\ncd ..\n./server/main\ncaddy -conf ./server/caddy/Caddyfile\n```\n\nOpen `http://0.0.0.0:8888/`\n\n## Analysis Data\n\n```bash\ncd ./server/analysis\n\n# do something...\n```\n\n## Changelog\n\n- [x] use gin to route both static page and API\n- [x] split router in differnt files ([ref](https://stackoverflow.com/questions/47115731/how-to-split-my-resources-into-multiply-files))\n- [x] expose the API to the client\n- [x] use caddy Proxy for /index.html and /api\n- [x] write a makefile\n- [ ] Add Wiki page\n- [x] Add nested component in Angular client\n- [ ] Add UI (Bootstrap or Antd?)\n- [ ] Use python to manipulate data layer\n- [x] change models directory structure in server\n- [x] Add RxJS observer of API to plot cell data\n- [x] Add python type hinting\n\n## ISSUE\n\n- Gin model is case insensitive, but Angular is case sensitive. (May raise error)\n- 'index' is meaningful in gorm, thus `where(index = ?)` trigger a bug. (database table column name)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fy9c%2Fangular_reatful_gin_sqlite_template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fy9c%2Fangular_reatful_gin_sqlite_template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fy9c%2Fangular_reatful_gin_sqlite_template/lists"}