{"id":15889083,"url":"https://github.com/srikanth-kandi/wellnessz-backend","last_synced_at":"2025-07-20T12:03:21.843Z","repository":{"id":237906059,"uuid":"795095306","full_name":"srikanth-kandi/wellnessz-backend","owner":"srikanth-kandi","description":"Posts API that takes Image upload","archived":false,"fork":false,"pushed_at":"2024-09-26T18:00:52.000Z","size":197,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-28T03:16:12.140Z","etag":null,"topics":["expressjs","rest-api"],"latest_commit_sha":null,"homepage":"https://wellnessz-backend-495a90d34b2b.herokuapp.com/posts","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/srikanth-kandi.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-05-02T15:17:25.000Z","updated_at":"2024-09-26T18:00:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"dab5c0a4-809b-44ed-8ccc-c22a9a0748f1","html_url":"https://github.com/srikanth-kandi/wellnessz-backend","commit_stats":null,"previous_names":["srikanth-kandi/wellnessz-backend"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srikanth-kandi%2Fwellnessz-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srikanth-kandi%2Fwellnessz-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srikanth-kandi%2Fwellnessz-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srikanth-kandi%2Fwellnessz-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/srikanth-kandi","download_url":"https://codeload.github.com/srikanth-kandi/wellnessz-backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229805182,"owners_count":18126807,"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":["expressjs","rest-api"],"created_at":"2024-10-06T06:41:12.089Z","updated_at":"2024-12-15T10:08:32.218Z","avatar_url":"https://github.com/srikanth-kandi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WellnessZ Posts API\n\nLive API URL - [https://wellnessz-backend-495a90d34b2b.herokuapp.com/posts](https://wellnessz-backend-495a90d34b2b.herokuapp.com/posts)\n\nPostman Workspace - [https://www.postman.com/interstellar-flare-93984/workspace/wellnessz-posts-api-workspace](https://www.postman.com/interstellar-flare-93984/workspace/wellnessz-posts-api-workspace)\n\n## Posts table Schema\n\nCreate a PostgreSQL Database with name of your choice and run the following SQL commands to create the required table.\n\n```sql\nCREATE TABLE IF NOT EXISTS posts (\n    id SERIAL PRIMARY KEY,\n    title VARCHAR(255) NOT NULL,\n    description TEXT NOT NULL,\n    tag VARCHAR(255) NOT NULL,\n    \"imageURL\" TEXT NOT NULL,\n    \"createdAt\" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n    \"updatedAt\" TIMESTAMP DEFAULT CURRENT_TIMESTAMP\n);\n```\n\n### Instructions to run the application\n\n1. Clone the repository\n2. Run `npm install` to install the dependencies\n3. Create a `.env` file in the root directory and add the following environment variables\n\n    ```\n    DB_NAME=your_db_name\n    DB_USER=your_db_user\n    DB_PASS=your_db_pass\n    DB_HOST=your_db_host\n    DB_PORT=5432\n    DB_CERT=your_db_cert\n    AWS_BUCKET_NAME=your_bucket_name\n    AWS_SECRET_ACCESS_KEY=your_secret_access_key\n    AWS_ACCESS_KEY_ID=your_access_key_id\n    AWS_REGION=your_region\n    ```\n4. Run `npm start` to start the server\n5. The server will start running on `http://localhost:3000`\n\n## API Endpoints\n\n### GET /posts\n\n- Description: Get all posts\n- Response: Array of posts limited to 10\n- Example: [/posts](https://wellnessz-backend-495a90d34b2b.herokuapp.com/posts)\n\n### GET /posts?tag=:tag\n\n- Description: Get all posts with a specific tag\n- Query Parameter:\n    - tag: String (required) - The tag to filter the posts by \"nature\", \"animals\", \"people\", \"food\",\"travel\", \"tech\", \"architecture\", \"art\", \"fashion\" and \"sports\"\n- Response: Array of posts\n- Example: [/posts?tag=nature](https://wellnessz-backend-495a90d34b2b.herokuapp.com/posts?tag=nature)\n\n### GET /posts?keyword=:search\n\n- Description: Get all posts that match the search query\n- Query Parameter:\n    - search: String (required) - The search query to match against post titles and descriptions\n- Response: Array of posts\n- Example: [/posts?keyword=in](https://wellnessz-backend-495a90d34b2b.herokuapp.com/posts?keyword=in)\n\n### GET /posts?sort=:sort\u0026order=:order\n\n- Description: Get all posts sorted by a specific field\n- Query Parameter:\n    - sort: String (required) - The field to sort the posts by \"id\", \"title\", \"description\", \"tag\" and \"imageURL\". The fields order is used for sorting in ascending order (\"asc\") and for descending order (\"desc\").\n- Response: Array of posts\n- Example: [/posts?sort=id\u0026order=desc](https://wellnessz-backend-495a90d34b2b.herokuapp.com/posts?sort=id\u0026order=desc)\n\n### GET /posts?limit=:limit\u0026page=:page\n\n- Description: Get all posts with pagination\n- Query Parameter:\n    - limit: Number (required) - The number of posts to return per page\n    - page: Number (required) - The page number to return\n- Response: Array of posts\n- Example: [/posts?limit=5\u0026page=3](https://wellnessz-backend-495a90d34b2b.herokuapp.com/posts?limit=5\u0026page=3)\n\n### POST /posts\n\n- Description: Create a new post\n- Request Body: JSON\n  - title: String\n  - description: String\n  - tag: String\n  - image: File (multipart/form-data)\n- Response: Created post\n- Example: [https://wellnessz-backend-495a90d34b2b.herokuapp.com/posts](https://wellnessz-backend-495a90d34b2b.herokuapp.com/posts)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrikanth-kandi%2Fwellnessz-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrikanth-kandi%2Fwellnessz-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrikanth-kandi%2Fwellnessz-backend/lists"}