{"id":20629888,"url":"https://github.com/lbrulet/apinit","last_synced_at":"2026-04-13T03:01:48.060Z","repository":{"id":47398803,"uuid":"158514022","full_name":"lbrulet/APINIT","owner":"lbrulet","description":"[apiREST] Setup | NodeJS - Mongoose - JWT with Docker","archived":false,"fork":false,"pushed_at":"2022-12-22T11:49:01.000Z","size":411,"stargazers_count":3,"open_issues_count":9,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-17T07:07:05.710Z","etag":null,"topics":["api-rest","docker-compose","javascript","jwt-token","mongodb","mongoose","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/lbrulet.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-11-21T08:17:57.000Z","updated_at":"2019-07-25T03:47:40.000Z","dependencies_parsed_at":"2023-01-30T08:00:46.427Z","dependency_job_id":null,"html_url":"https://github.com/lbrulet/APINIT","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/lbrulet%2FAPINIT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbrulet%2FAPINIT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbrulet%2FAPINIT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbrulet%2FAPINIT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lbrulet","download_url":"https://codeload.github.com/lbrulet/APINIT/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242583244,"owners_count":20153409,"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":["api-rest","docker-compose","javascript","jwt-token","mongodb","mongoose","nodejs"],"created_at":"2024-11-16T14:06:20.482Z","updated_at":"2025-12-16T02:05:34.058Z","avatar_url":"https://github.com/lbrulet.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# APINIT\n\nAPINIT is a setup of an apiREST using nodeJS with a mongo database and Docker.\n\nThere is a simple model of user implemented with these methods (GET/POST/PUT/DELETE), and an authentification service using JWT.\n\n\n## Installation\n\nUse [curl](https://curl.haxx.se/) to install [Docker Compose](https://docs.docker.com/compose/install/#install-compose).\n\n```bash\nsudo curl -L \"https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)\" -o /usr/local/bin/docker-compose\n```\nThen apply executable permissions to the binary:\n\n```bash\nsudo chmod +x /usr/local/bin/docker-compose\n```\n\n## Usage\n\nTo start the container\n```bash\nsudo docker-compose up --build\n```\nDoes not forget to create a '.env' file with :\n```bash\nSECRET = \"your secret\"\n```\n\n## AUTHENTIFICATION\n\nMind always to use the __\"user\"__ object into your request\n\n* __POST__: localhost:8080/auth/login\n\n```json\n{\n\t\"user\": {\n\t\t\"username\": \"sankamille\",\n\t\t\"password\": \"password123\"\n\t}\n}\n```\n\n* __PUT__: localhost:8080/auth/register\n\n```json\n{\n\t\"user\": {\n\t\t\"username\": \"sankamille\",\n\t\t\"password\": \"password123\"\n\t}\n}\n```\n\n## API CALLS\n\nMind always to use the __\"user\"__ object into your request\n\n* __GET__: localhost:8080/api/user + [Bearer auth]\n\n```json\nnothing to send\n```\n    \n* __PUT__: localhost:8080/api/user + [Bearer auth]\n\n```json\n{\n\t\"user\": {\n\t\t\"username\": \"sankamille\",\n\t\t\"password\": \"password123\"\n\t}\n}\n```\n\n* __POST__: localhost:8080/api/user + [Bearer auth]\n\n```json\n{\n\t\"user\": {\n\t\t\"_id\": \"5bf6499c3d5ce90012a9722c\"\n\t}\n}\n```\n\n* __DELETE__: localhost:8080/api/user + [Bearer auth]\n\n```json\n{\n\t\"user\": {\n\t\t\"_id\": \"5bf6499c3d5ce90012a9722c\"\n\t}\n}\n```\n\n\n\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flbrulet%2Fapinit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flbrulet%2Fapinit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flbrulet%2Fapinit/lists"}