{"id":29225642,"url":"https://github.com/hsavoye/rest-starter-template","last_synced_at":"2026-04-29T07:34:57.146Z","repository":{"id":302453119,"uuid":"1012495058","full_name":"hsavoye/rest-starter-template","owner":"hsavoye","description":"Une API REST modulaire en Go avec Gorilla Mux et PostgreSQL. Parfait pour apprendre ou démarrer un backend rapide en Go.","archived":false,"fork":false,"pushed_at":"2025-07-02T12:59:54.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-02T13:41:08.774Z","etag":null,"topics":["backend","go","gorilla","postgresql","rest-api"],"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/hsavoye.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-07-02T12:21:55.000Z","updated_at":"2025-07-02T13:26:09.000Z","dependencies_parsed_at":"2025-07-02T13:42:14.891Z","dependency_job_id":"83b3e2d9-c214-4772-b728-00f540c2b841","html_url":"https://github.com/hsavoye/rest-starter-template","commit_stats":null,"previous_names":["hsavoye/rest-starter-template"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hsavoye/rest-starter-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsavoye%2Frest-starter-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsavoye%2Frest-starter-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsavoye%2Frest-starter-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsavoye%2Frest-starter-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hsavoye","download_url":"https://codeload.github.com/hsavoye/rest-starter-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsavoye%2Frest-starter-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32416146,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T06:29:02.080Z","status":"ssl_error","status_checked_at":"2026-04-29T06:29:00.631Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["backend","go","gorilla","postgresql","rest-api"],"created_at":"2025-07-03T07:11:14.265Z","updated_at":"2026-04-29T07:34:57.131Z","avatar_url":"https://github.com/hsavoye.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Articles API\n\nCe projet est une API REST écrite en Go, utilisant le routeur Gorilla Mux et une base de données PostgreSQL. Elle permet de gérer une collection d’articles via des opérations de base (GET, POST). C’est un bon point de départ pour construire une API modulaire en Go.\n\n## Fonctionnalités\n\n- API REST en Go\n- Récupération et création d’articles\n- Routage avec Gorilla Mux\n- Connexion PostgreSQL\n- Configuration par fichier `.env`\n- Architecture claire et modulaire \n\n## Structure du projet\n\n```\nserv/\n├── db/\n    └── db.go          → Connexion à la db \n├── handlers/\n    └── routes.go      → Fonctions des routes HTTP (Get,Post) \n├── models/            \n    └── article.go     → Structure des articles\n├── .env               → Variables pour accéder db\n├── go.mod    \n└── main.go            → Point entrée de l'app\n````\n\n## Configuration\n**Attention à bien configurer votre BDD PostgreSQL dans pgAdmin4 (Port, User, Password).** \n\nCrée un fichier `.env` à la racine du projet avec les variables suivantes : (en fonction de votre bdd Postgres)\n\n```env\nDB_USER=postgres\nDB_PASSWORD=yourpassword\nDB_NAME=postgres\nDB_HOST=localhost\nDB_PORT=5432\nDB_SSLMODE=disable\n````\n\nCes variables seront chargées automatiquement au lancement de l’application.\n\n## Installation\n\n1. Clone le dépôt :\n\n   ```bash\n   git clone https://github.com/hsavoye/rest-starter-template.git\n   ```\n\n2. Installe les dépendances :\n\n   ```bash\n   cd go-articles-api\n   ```\n   ```bash\n   go mod tidy\n   ```\n\n## Lancer le serveur\n\n```bash\ngo run main.go\n```\n\nLe serveur démarrera sur `http://localhost:8081`\n\n## Endpoints disponibles\n\n| Méthode | URL       | Description                |\n| ------: | --------- | -------------------------- |\n|     GET | `/`       | Message d’accueil          |\n|     GET | `/get`    | Récupère tous les articles |\n|    POST | `/create` | Crée un nouvel article     |\n\n## Test rapide avec curl\n\n```bash\n# Créer un article (Windows)\ncurl -X POST http://localhost:8081/create -H \"Content-Type: application/json\" -d \"{\\\"title\\\": \\\"Nouveau contenu\\\"}\"\n\n# Lister les articles (Windows)\ncurl http://localhost:8081/articles   \n```\n\n## Dépendances principales\n\n* [Go](https://golang.org/)\n* [Gorilla Mux](https://github.com/gorilla/mux)\n* [PostgreSQL](https://www.postgresql.org/)\n* [joho/godotenv](https://github.com/joho/godotenv)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhsavoye%2Frest-starter-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhsavoye%2Frest-starter-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhsavoye%2Frest-starter-template/lists"}