{"id":22533496,"url":"https://github.com/vectormike/super-robot","last_synced_at":"2025-03-28T05:43:06.675Z","repository":{"id":191282600,"uuid":"683891359","full_name":"Vectormike/super-robot","owner":"Vectormike","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-28T23:16:59.000Z","size":145,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-02T06:41:27.435Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/Vectormike.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":"2023-08-28T02:10:49.000Z","updated_at":"2023-08-28T23:07:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"7a40cc60-4190-4868-8457-02c26efd6bcd","html_url":"https://github.com/Vectormike/super-robot","commit_stats":null,"previous_names":["vectormike/super-robot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vectormike%2Fsuper-robot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vectormike%2Fsuper-robot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vectormike%2Fsuper-robot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vectormike%2Fsuper-robot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vectormike","download_url":"https://codeload.github.com/Vectormike/super-robot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245978230,"owners_count":20703677,"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-12-07T09:08:30.414Z","updated_at":"2025-03-28T05:43:06.668Z","avatar_url":"https://github.com/Vectormike.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Senior Backend Engineer Test - Submission\n\n## Overview\n\nThis project is a RESTful API built using Node.js, Express, TypeScript, and PostgreSQL. It features a simple token-based authentication system, basic input validation, and error handling. The database consists of three tables: Users, Posts, and Comments. The API endpoints facilitate CRUD operations for these tables. Additionally, there is a specific endpoint that fetches the top 3 users with the most posts and the latest comment made by each of those users.\n\n## Project Structure\n\n- `/models` - Contains database models for Users, Posts, and Comments.\n- `/controllers` - Contains logic for handling requests.\n- `/routes` - Contains endpoint routes.\n- `/middlewares` - Contains middleware functions, including authentication.\n- `/tests` - Contains unit tests.\n- `/utils` - Contains utility functions and constants.\n- `Dockerfile` - Instructions for building the Docker container.\n- `.env` - Contains environment variables (not committed to Git for security).\n\n## Endpoints\n\n1. Create and retrieve users: `/users`\n2. Create a post for a user and retrieve all posts of a user: `/users/:id/posts`\n3. Add a comment to a post: `/posts/:postId/comments`\n4. Fetch the top 3 users with the most posts and the latest comment they made: (Endpoint URL provided in the Postman collection)\n\n## Tools/Stack\n\n- Node.js (with TypeScript \u0026 Express)\n- MySQL\n- Redis\n- Docker\n- Postman for API documentation\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js\n- MySQL\n- Redis\n- Docker\n\n### Setup\n\n1. Clone the repository:\n\n   ```bash\n   git clone [repository-link]\n   ```\n\n2. Navigate to the project directory:\n\n   ```bash\n   cd [project-directory]\n   ```\n\n3. Install dependencies:\n\n   ```bash\n   npm install\n   ```\n\n4. Set up the `.env` file with your environment variables.\n\n5. Build and run the Docker container:\n\n   ```bash\n   docker-compose up --build\n   ```\n\n6. The API should now be running at `http://localhost:PORT`, where `PORT` is the port specified in the `.env` file.\n\n## Testing\n\nRun unit tests using the following command:\n\n```bash\nnpm test\n```\n\n## API Documentation\n\nThe Postman collection with all the endpoint documentation can be found [here](https://documenter.getpostman.com/view/20922064/2s9Y5ZugQd#intro).\n\n## Deployment\n\nThe live version of the API is hosted on Heroku and can be accessed [here](https://risevesttest-276191955a1f.herokuapp.com/v1/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvectormike%2Fsuper-robot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvectormike%2Fsuper-robot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvectormike%2Fsuper-robot/lists"}