{"id":20129895,"url":"https://github.com/maniecodes/shapes-api","last_synced_at":"2025-07-24T13:03:51.885Z","repository":{"id":137054662,"uuid":"355534005","full_name":"maniecodes/shapes-api","owner":"maniecodes","description":null,"archived":false,"fork":false,"pushed_at":"2021-04-09T11:02:48.000Z","size":316,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-13T08:45:05.510Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maniecodes.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":"2021-04-07T12:19:21.000Z","updated_at":"2021-04-09T11:02:50.000Z","dependencies_parsed_at":"2023-06-12T21:30:43.445Z","dependency_job_id":null,"html_url":"https://github.com/maniecodes/shapes-api","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/maniecodes%2Fshapes-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maniecodes%2Fshapes-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maniecodes%2Fshapes-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maniecodes%2Fshapes-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maniecodes","download_url":"https://codeload.github.com/maniecodes/shapes-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241577071,"owners_count":19984940,"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-11-13T20:36:35.435Z","updated_at":"2025-03-02T21:40:33.967Z","avatar_url":"https://github.com/maniecodes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Description of the Shapes Area API and how to set it up\n\nThis is a RESTful API for calculating the area of different shapes.\nSwagger Documentation https://shapes-dev.herokuapp.com/api-docs/ \n\n## Getting Started\n\n    There are two methods for getting started with this repo.\n\n    1. Download the .zip file. Extract the contents of the zip file then change directory to the file\n\n    2. Checkout this repo, install dependencies, then start the gulp process with the following:\n\n    ```bash\n\n    \u003e git clone https://github.com/Dev-Manny/shapes-api.git\n    \u003e cd shapes-api\n    \u003e npm install\n    \u003e npm start\n\n    ```\n\n## Generate Environment Variable\n\nsimple run:\n\n    ```bash\n        cp .env.example .env\n    ```\n\nin your terminalof the the root directory\n\n## Features\n\n- Controller\n- Model\n- Server Responses\n\n## Migration:\n\n## RUN\n\nTo run a migration use:\n\n```bash\nSequelize db:migrate\n```\n\n## Undo Migration:\n\n```bash\nsequelize db:migrate:undo:all\n```\n\n## PostgresSql:\n\nThis project expects that you have postgres installed\nneed help with installing postgres on mac check :\nhttps://flaviocopes.com/postgres-how-to-install/\n\nexcept you don't intend to use PostgresSql then edit the configuration dialect in Server -\u003e api -\u003e server -\u003e src -\u003e config -\u003e config.js\n\n## \\*bonus postgres:\n\nto create a database with postgres use command\n\n```bash\n    createdb shape\n```\n\n## To create a model:\n\n```bash\n    sequelize model:create --name User --attributes name:string,email:string,password:string\n```\n\n- where\n  User: the model name,\n  Attributes: the table fields and data type structure\n\n## Undo migration\n\n```bash\n    sequelize db:migrate:undo:all\n```\n\n## One to many association\n\nin your users model in models -\u003e user add\n\n```bash\n   User.hasMany(models.Result, {\n           foreignKey: 'user_id',\n       });\n       };\n       return User;\n```\n\n- where Result is another model you must have created.\n\n- In a case where ResultModel is another model\n  So we must have done this : sequelize model:create --name Result --attributes shape:string,dimension:json,result:double\n\nThen that means we must edit out Result model to be :\n\n```bash\n       Result.associate = (models) =\u003e {\n       // associations can be defined here\n       Result.belongsTo(models.User, {\n           foreignKey: 'user_id'\n       });\n       };\n       return Result;\n```\n\n Cheers :clinking_glasses:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaniecodes%2Fshapes-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaniecodes%2Fshapes-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaniecodes%2Fshapes-api/lists"}