{"id":18846792,"url":"https://github.com/mayank0255/stackoverflow-clone-backend","last_synced_at":"2025-08-21T00:30:39.511Z","repository":{"id":38320414,"uuid":"406051045","full_name":"Mayank0255/Stackoverflow-Clone-Backend","owner":"Mayank0255","description":"Backend code of the Stackoverflow Clone project. Built using Express, Node, MySQL, and Sequelize","archived":false,"fork":false,"pushed_at":"2023-08-26T10:39:22.000Z","size":4250,"stargazers_count":127,"open_issues_count":11,"forks_count":63,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-12-10T07:11:14.634Z","etag":null,"topics":["api","backend","database","docker","express","expressjs","hacktoberfest","javascript","mern","mern-stack","mysql","nodejs","rest-api","sequelize","sql","stack","stackoverflow"],"latest_commit_sha":null,"homepage":"https://stackoverflow-clone-api.onrender.com","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/Mayank0255.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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-09-13T16:38:08.000Z","updated_at":"2024-11-30T11:19:01.000Z","dependencies_parsed_at":"2024-11-08T03:04:20.774Z","dependency_job_id":"21c457db-adb7-4c32-bfdf-5369682cb982","html_url":"https://github.com/Mayank0255/Stackoverflow-Clone-Backend","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mayank0255%2FStackoverflow-Clone-Backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mayank0255%2FStackoverflow-Clone-Backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mayank0255%2FStackoverflow-Clone-Backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mayank0255%2FStackoverflow-Clone-Backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mayank0255","download_url":"https://codeload.github.com/Mayank0255/Stackoverflow-Clone-Backend/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230471175,"owners_count":18231193,"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","backend","database","docker","express","expressjs","hacktoberfest","javascript","mern","mern-stack","mysql","nodejs","rest-api","sequelize","sql","stack","stackoverflow"],"created_at":"2024-11-08T03:03:57.293Z","updated_at":"2024-12-19T17:08:43.198Z","avatar_url":"https://github.com/Mayank0255.png","language":"JavaScript","readme":"![Stackoverflow-Clone-Backend](https://socialify.git.ci/Mayank0255/Stackoverflow-Clone-Backend/image?font=Source%20Code%20Pro\u0026forks=1\u0026issues=1\u0026language=1\u0026owner=1\u0026pattern=Charlie%20Brown\u0026pulls=1\u0026stargazers=1\u0026theme=Dark)\n\n[![Version](https://img.shields.io/static/v1?label=version\u0026message=2.0.0\u0026color=blue)](https://shields.io/)\n[![NPM](https://img.shields.io/static/v1?label=npm\u0026message=6.8.5\u0026color=blue)](https://shields.io/)\n[![NODE](https://img.shields.io/static/v1?label=node\u0026message=10.12.8\u0026color=success)](https://shields.io/)\n[![MYSQL](https://img.shields.io/static/v1?label=mysql\u0026message=8.0.10\u0026color=blueviolet)](https://shields.io/)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://shields.io/)\n\n### [🌐 Website](https://stackoverflow-clone-client.vercel.app)  |  [📹 Demo Video](https://www.youtube.com/watch?v=bUAAgfGOfYg)\n\n### API Hosted On\n- __[stackoverflow-clone-api.onrender.com](https://stackoverflow-clone-api.onrender.com) (Primary)__\n- __[stackoverflow-clone-backend.herokuapp.com](https://stackoverflow-clone-backend.herokuapp.com)__\n\n\n\nAs the name suggests, this project is a clone of a famous Q/A website for professional and enthusiast programmers built solely by me using a completely different stack.\n\nThis repo consists of the Backend code of the project, the backend code is in __[Stackoverflow-Clone-Frontend](https://github.com/Mayank0255/Stackoverflow-Clone-Frontend)__\n\n## My Tech Stack (MERN)\n\n#### Front-end\n\n- Front-end Framework: `React.js (with Redux)`\n- Styling: `SASS` and `BOOTSTRAP`\n\n#### Back-end\n\n- For handling index requests: `Node.js with Express.js Framework`\n- As Database: `MySQL with Sequelize`\n- API tested using: `POSTMAN`\n\n## Guidelines to setup\n\nThere are two ways to setup the project: manually or using the Dockerfile. Read below for more details:\n\n### Manual Setup\n\n1. Open your local CLI -\n\n   ```\n   mkdir Stackoverflow-Clone\n   cd Stackoverflow-Clone\n   ```\n\n2. Setup the backend code -\n\n   - Create a `.env` file and the format should be as given in `.env.example`.\n   - Clone the code \u0026 install the modules-\n\n     ```\n     git clone https://github.com/Mayank0255/Stackoverflow-Clone-Backend.git\n     cd Stackoverflow-Clone-Backend\n\n     npm install\n     ```\n\n   - Open your MySQL Client -\n\n     ```\n     CREATE DATABASE stack_overflow;\n     ```\n     NOTE: Don't forget to keep the database name same in the `.env` and here.\n\n   - Run the index `npm start`.\n\n3. Open a new CLI terminal and goto the root `Stackoverflow-Clone` folder you created in the first step.\n4. Setup the Frontend code -\n\n   - Clone the code \u0026 install the modules-\n\n     ```\n     git clone https://github.com/Mayank0255/Stackoverflow-Clone-Frontend.git\n     cd Stackoverflow-Clone-Frontend\n\n     npm install\n     ```\n\n   - Run the client index `npm start`.\n\n### Docker Setup\n\nThe back-end has support for Docker. So if you want to run the back-end in a container, you need do:\n\n- Setup environment variables in `.env` file. Note when you use Docker setup and run the database in localhost (host machine), you need to setup the environment variables for use correct IP of MySQL Database. Please, read [here](https://docs.docker.com/compose/environment-variables/) and [here](https://docs.docker.com/desktop/windows/networking/) for more details.\n\n- Build the Docker image:\n  ```\n  docker build -t stackoverflowclone .\n  ```\n- Run the container. For example, if you want to run the container in a new terminal, you can do:\n  ```\n  docker run -d -p 5000:5000 stackoverflowclone\n  ```\n\nThe default port of api is 5000. After running the container, you can access the api by typing:\n\n    http://localhost:5000/api/\u003cendpoint that you request - see next section\u003e\n\n_Follow the steps properly (manual or Docker) and you are good to go._\n\n## API Endpoints\n\nAPI is currently hosted on __[stackoverflow-clone-api.onrender.com](https://stackoverflow-clone-api.onrender.com)__ and __[stackoverflow-clone-backend.herokuapp.com](https://stackoverflow-clone-backend.herokuapp.com)__.\n\nYou can view and read the API endpoints samples [here](https://documenter.getpostman.com/view/10053385/UVC3kTiG#f02c9fce-5737-4cd6-9d8e-ad48233102c7). This is API documentation for the back-end.\n\nBut, if you want use Postman to test the API in local machine, you need to follow the steps below:\n\n- Get the Postman app from [here](https://www.getpostman.com/downloads/).\n- Download the Postman collection file in folder \"/data/postman_collection\"\n- Import the collection file in Postman\n- **Important:** will be necessary to setup the enviroment with the \"VARIABLE\"=urlAPI and \"INITIAL VALUE\"=http://localhost:5000, for example.\n- **Remember**: keep the Postman collection updated with the latest API endpoints.\n\n#### Base Url - `{API_URL}/api`\n\n#### Users\n\n- `GET /auth`\n- `POST /auth`\n- `POST /users/:id`\n- `GET /users`\n- `GET /users/:id`\n\n#### Posts\n\n- `GET /posts`\n- `GET /posts/top`\n- `GET /posts/tag/:tagname`\n- `GET /posts/:id`\n- `POST /posts/`\n- `DELETE /posts/:id`\n\n#### Answers\n\n- `GET /posts/answers/:id`\n- `POST /posts/answers/:id`\n- `DELETE /posts/answers/:id`\n\n#### Comments\n\n- `GET /posts/comments/:id`\n- `POST /posts/comments/:id`\n- `DELETE /posts/comments/:id`\n\n#### Tags\n\n- `GET /tags`\n- `GET /tags/:tag_name`\n\n## Contributing\n\n- Go to [Contributing.md](./CONTRIBUTING.md)\n\n## DEMO\n\n#### VIDEO - [Watch the video](https://www.youtube.com/watch?v=bUAAgfGOfYg)\n\n_Video Last Updated on 7th March, 2022_\n\n#### IMAGES\n\n\u003cimg src=\"/demo/images/1.png\" width=340px /\u003e\u003cimg src=\"/demo/images/2.png\" width=340px /\u003e\n\u003cimg src=\"/demo/images/3.png\" width=340px /\u003e\u003cimg src=\"/demo/images/4.png\" width=340px /\u003e\n\u003cimg src=\"/demo/images/5.png\" width=340px /\u003e\u003cimg src=\"/demo/images/6.png\" width=340px /\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmayank0255%2Fstackoverflow-clone-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmayank0255%2Fstackoverflow-clone-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmayank0255%2Fstackoverflow-clone-backend/lists"}