{"id":15068193,"url":"https://github.com/imoamo/alphatribe","last_synced_at":"2026-01-03T02:14:31.146Z","repository":{"id":256889512,"uuid":"856729603","full_name":"imoamo/AlphaTribe","owner":"imoamo","description":"Backend API for user and product management with authentication, profile access, and cart operations, featuring dynamic routing and error handling.","archived":false,"fork":false,"pushed_at":"2024-09-13T08:20:40.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T18:51:29.962Z","etag":null,"topics":["bcryptjs","express-js","jsonwebtoken","mongodb","moongose","nodejs"],"latest_commit_sha":null,"homepage":"","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/imoamo.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-09-13T05:12:01.000Z","updated_at":"2024-09-13T08:20:44.000Z","dependencies_parsed_at":"2024-09-13T16:46:42.119Z","dependency_job_id":"3731610c-99a2-4f66-95e1-913a88a8157a","html_url":"https://github.com/imoamo/AlphaTribe","commit_stats":null,"previous_names":["imoamo/alphatribe"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imoamo%2FAlphaTribe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imoamo%2FAlphaTribe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imoamo%2FAlphaTribe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imoamo%2FAlphaTribe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imoamo","download_url":"https://codeload.github.com/imoamo/AlphaTribe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243833356,"owners_count":20355258,"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":["bcryptjs","express-js","jsonwebtoken","mongodb","moongose","nodejs"],"created_at":"2024-09-25T01:32:18.538Z","updated_at":"2026-01-03T02:14:31.113Z","avatar_url":"https://github.com/imoamo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🐾 AlphaTribe Backend\n\nWelcome to the **AlphaTribe Backend**! This backend powers AlphaTribe's social platform for stock enthusiasts, featuring user authentication, stock posts, comments, and a like system.\n\n---\n\n## 🛠️ Tech Stack\n\nThis project uses a modern backend stack for performance and scalability:\n\n- **Node.js**: Server-side JavaScript runtime.\n- **Express.js**: Fast and flexible API routing.\n- **MongoDB**: NoSQL database for data storage.\n- **Mongoose**: Elegant MongoDB object modeling for Node.js.\n- **JWT**: Secure authentication with JSON Web Tokens.\n---\n\n## 🚀 Getting Started\n\nFollow the steps below to get the AlphaTribe backend up and running on your local machine.\n\n### Prerequisites\n\nEnsure you have the following installed:\n\n- **Node.js** (v14+)\n- **MongoDB** (local or cloud)\n- **MongoDB credentials** (username/password)\n\n---\n\n## 🛠️ Installation\n\n1. Clone the Repository:\n  ```bash\n      git clone https://github.com/imoamo/AlphaTribe.git\n  ```\n\n2. Navigate to the project directory:\n  ```bash\n    cd AlphaTribe\n  ```  \n3. Install the dependencies:\n  ```bash\n    npm install\n  ```\n\n## 🌐 API Endpoints\n The AlphaTribe API is designed for flexibility and ease of use. Below is a breakdown of the key endpoints:\n\n## 🧑‍💻 User Authentication \u0026 Management\n### Register a User\n\n### Endpoint: POST /api/auth/register\n\nRequest Body:\n\n```json\n  {\n     \"username\": \"johndoe\",\n     \"email\": \"john@example.com\",\n     \"password\": \"secret\"\n  }\n```\nSample Response:\n\n```json\n  {\n     \"success\": true,\n     \"message\": \"User registered successfully\",\n     \"userId\": \"614b1b2d8f9a4e2a3c8b3e7f\"\n  }\n```\n\n## Login a User\n\n### Endpoint: POST /api/auth/login\n\nRequest Body:\n\n```json\n  {\n     \"email\": \"john@example.com\",\n     \"password\": \"secret\"\n  }\n```\n\n Sample Response:\n```json\n  {\n     \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\n     \"user\": {\n        \"id\": \"614b1b2d8f9a4e2a3c8b3e7f\",\n        \"username\": \"johndoe\",\n        \"email\": \"john@example.com\"\n     }\n  }\n```\n\n## Get User Profile\n\n### Endpoint: GET /api/user/profile/:userId\n\nHeaders:Authorization: Bearer \u003ctoken\u003e\n\nSample Response:\n\n```json\n  {\n     \"id\": \"614b1b2d8f9a4e2a3c8b3e7f\",\n     \"username\": \"johndoe\",\n     \"bio\": \"Stock market enthusiast\",\n     \"profilePicture\": \"https://yourfirebaseapp.com/profilePic.jpg\"\n  }\n```\n\n## Update User Profile\n\n### Endpoint: PUT /api/user/profile\n\nHeaders:Authorization: Bearer \u003ctoken\u003e\nRequest Body:\n\n```json\n  {\n     \"username\": \"john_doe_updated\",\n     \"bio\": \"Updated bio\",\n     \"profilePicture\": \"https://yourfirebaseapp.com/newProfilePic.jpg\"\n  }\n```\n\nSample Response:\n\n```json\n  {\n     \"success\": true,\n     \"message\": \"Profile updated\"\n  }\n```\n\n\n## 📈 Stock Posts Management\n\n### Create a Stock Post\n\nEndpoint: POST /api/posts\n\nHeaders:Authorization: Bearer \u003ctoken\u003e\n\nRequest Body:\n\n```json\n  {\n     \"stockSymbol\": \"AAPL\",\n     \"title\": \"Apple stock hitting new highs\",\n     \"description\": \"Apple stock is up by 10% today\",\n     \"tags\": [\"apple\", \"stock\", \"technology\"]\n  }\n```\n\nSample Response:\n\n```json\n  {\n     \"success\": true,\n     \"postId\": \"614b1e9b8f9a4e2a3c8b4e7f\",\n     \"message\": \"Post created successfully\"\n  }\n```\n\n## Get All Stock Posts (with filters \u0026 sorting)\n\n### Endpoint: GET /api/posts\n\nQuery Parameters ::=\u003e stockSymbol=AAPL\u0026tags=technology\u0026sortBy=date\n\nSample Response:\n\n```json\n  [\n     {\n        \"postId\": \"614b1e9b8f9a4e2a3c8b4e7f\",\n        \"stockSymbol\": \"AAPL\",\n        \"title\": \"Apple stock hitting new highs\",\n        \"description\": \"Apple stock is up by 10% today\",\n        \"likesCount\": 50,\n        \"createdAt\": \"2024-09-13T12:34:56Z\"\n     }\n  ]\n```\n## Get a Single Stock Post (with comments)\n\n### Endpoint: GET /api/posts/:postId\n\nSample Response:\n\n```json\n  {\n     \"postId\": \"614b1e9b8f9a4e2a3c8b4e7f\",\n     \"stockSymbol\": \"AAPL\",\n     \"title\": \"Apple stock hitting new highs\",\n     \"description\": \"Apple stock is up by 10% today\",\n     \"likesCount\": 50,\n     \"comments\": [\n        {\n           \"commentId\": \"614b1f2d8f9a4e2a3c8b4e8e\",\n           \"userId\": \"614b1b2d8f9a4e2a3c8b3e7f\",\n           \"comment\": \"Great news!\",\n           \"createdAt\": \"2024-09-13T13:45:12Z\"\n        }\n     ]\n}\n```\n\n## Delete a Stock Post\n\n### Endpoint: DELETE /api/posts/:postId\n\nHeaders:Authorization: Bearer \u003ctoken\u003e\nSample Response:\n\n```json\n  {\n     \"success\": true,\n     \"message\": \"Post deleted successfully\"\n  }\n```\n\n## 💬 Comments Management\n### Add a Comment to a Post\n\nEndpoint: POST /api/posts/:postId/comments\n\nHeaders:Authorization: Bearer \u003ctoken\u003e\nRequest Body:\n\n```json\n  {\n     \"comment\": \"This is a very insightful post!\"\n  }\n```\nSample Response:\n\n```json\n  {\n     \"success\": true,\n     \"commentId\": \"614b20f98f9a4e2a3c8b4e9f\",\n     \"message\": \"Comment added successfully\"\n  }\n```\n\n## Delete a Comment\n\n### Endpoint: DELETE /api/posts/:postId/comments/:commentId\n\nHeaders:Authorization: Bearer \u003ctoken\u003e\nSample Response:\n\n```json\n  {\n     \"success\": true,\n     \"message\": \"Comment deleted successfully\"\n  }\n```\n\n## ❤️ Like System\n### Like a Post\n\nEndpoint: POST /api/posts/:postId/like\n\nHeaders: Authorization: Bearer \u003ctoken\u003e\nSample Response:\n\n```json\n  {\n     \"success\": true,\n     \"message\": \"Post liked\"\n  }\n```\n\n## Unlike a Post\n\n### Endpoint: DELETE /api/posts/:postId/like\nHeaders: Authorization: Bearer \u003ctoken\u003e\nSample Response:\n\n```json\n  {\n     \"success\": true,\n     \"message\": \"Post unliked\"\n  }\n```\n\n\n## 🔧 Troubleshooting\n\nEnsure that MongoDB is running locally or you are using a valid cloud connection string.\n\nVerify that the Firebase credentials are valid for storing profile images.\n\n## 👥 Contributing\n\nWe welcome contributions from the community! To contribute:\n\nFork the repository.\n\nCreate a new feature branch (git checkout -b feature/new-feature).\n\nCommit your changes (git commit -am 'Add new feature').\n\nPush to the branch (git push origin feature/new-feature).\n\nOpen a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimoamo%2Falphatribe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimoamo%2Falphatribe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimoamo%2Falphatribe/lists"}