{"id":26926571,"url":"https://github.com/danieldev219/social-media-api-nodejs","last_synced_at":"2025-04-02T03:33:28.234Z","repository":{"id":283446598,"uuid":"951799866","full_name":"danieldev219/social-media-api-nodejs","owner":"danieldev219","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-20T09:09:09.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T09:41:50.945Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danieldev219.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2025-03-20T09:07:17.000Z","updated_at":"2025-03-20T09:09:12.000Z","dependencies_parsed_at":"2025-03-21T13:31:56.773Z","dependency_job_id":null,"html_url":"https://github.com/danieldev219/social-media-api-nodejs","commit_stats":null,"previous_names":["danieldev219/social-media-api-nodejs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieldev219%2Fsocial-media-api-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieldev219%2Fsocial-media-api-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieldev219%2Fsocial-media-api-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieldev219%2Fsocial-media-api-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danieldev219","download_url":"https://codeload.github.com/danieldev219/social-media-api-nodejs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246752088,"owners_count":20827981,"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":"2025-04-02T03:33:27.672Z","updated_at":"2025-04-02T03:33:28.229Z","avatar_url":"https://github.com/danieldev219.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Social Media API\r\n\r\nA social media API built with Node.js, Express.js, and MongoDB. This API is built for developers to use in their projects. It is not meant to be used as a standalone social media platform. This API is still in development and is not ready for production use.\r\n\r\n## Table of Contents\r\n\r\n- [Social Media API](#social-media-api)\r\n  - [Table of Contents](#table-of-contents)\r\n  - [Features](#features)\r\n  - [Upcoming Features](#upcoming-features)\r\n  - [Getting Started](#getting-started)\r\n    - [Prerequisites](#prerequisites)\r\n    - [Installation](#installation)\r\n    - [Configuration](#configuration)\r\n    - [Database Setup](#database-setup)\r\n    - [Running the Application](#running-the-application)\r\n  - [API Documentation](#api-documentation)\r\n    - [Authentication](#authentication)\r\n    - [Endpoints](#endpoints)\r\n      - [Auth](#auth)\r\n      - [Post](#post)\r\n  - [Deployment](#deployment)\r\n  - [Technologies Used](#technologies-used)\r\n  - [Contributing](#contributing)\r\n  - [License](#license)\r\n  - [Sponsor Me](#sponsor-me)\r\n  - [Connect With Me](#connect-with-me)\r\n  - [Activities](#activities)\r\n\r\n## Features\r\n\r\n- User authentication and authorization.\r\n- CRUD operations for users, posts, and notifications.\r\n- JWT-based authentication for secure API access.\r\n- RESTful API design.\r\n- Written in TypeScript for enhanced maintainability and type safety.\r\n\r\n## Upcoming Features\r\n\r\n- Personal Chat\r\n- Group Chat\r\n- End-To-End Encryption in Chat\r\n\r\n## Getting Started\r\n\r\nYou can follow these instructions to get the project up and running on your local machine.\r\n\r\n### Prerequisites\r\n\r\nYou need to have the following software installed on your computer:\r\n\r\n- [Bun](https://bun.sh/) (v1.1.0 or later) or [Node.js](https://nodejs.org/) (LTS version recommended)\r\n- [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [Yarn](https://yarnpkg.com/) or [Bun](https://bun.sh/) package manager\r\n\r\n### Installation\r\n\r\n1. Star the repository.\r\n\r\n2. Clone this repository to your local machine using the following command:\r\n\r\n   ```bash\r\n   git clone https://github.com/danieldev219/social-media-api-nodejs.git\r\n   ```\r\n\r\n3. Navigate to the project directory:\r\n\r\n   ```bash\r\n   cd social-media-api-nodejs\r\n   ```\r\n\r\n4. Install the project dependencies:\r\n\r\n   If you're using npm:\r\n\r\n   ```bash\r\n   npm install\r\n   ```\r\n\r\n   If you're using pnpm:\r\n\r\n   ```bash\r\n   pnpm install\r\n   ```\r\n\r\n   If you're using Yarn:\r\n\r\n   ```bash\r\n   yarn install\r\n   ```\r\n\r\n   If you're using bun:\r\n\r\n   ```bash\r\n   bun install\r\n   ```\r\n\r\n### Configuration\r\n\r\nBefore running the application, you need to configure the environment variables. Copy the `.env.example` file to `.env.local` and fill in the necessary values.\r\n\r\n```bash\r\ncp .env.example .env.local\r\n```\r\n\r\n### Database Setup\r\n\r\nMake sure you have a database configured and running. Update the database connection details in the `.env.local` file.\r\n\r\n### Running the Application\r\n\r\nOnce the dependencies are installed and the configuration is set up, you can start the application by running:\r\n\r\n```bash\r\nnpm run dev\r\n#or\r\npnpm run dev\r\n# or\r\nyarn dev\r\n# or\r\nbun run dev\r\n```\r\n\r\nBy default, the application will run on port `3000`. You can change the port by modifying the `PORT` environment variable in the `.env.local` file.\r\n\r\n## API Documentation\r\n\r\n### Authentication\r\n\r\nThe API uses JWT (JSON Web Tokens) for authentication. To authenticate, send a POST request to `/api/v2/auth/login` with a JSON payload containing the user's email and password.\r\n\r\n```json\r\n{\r\n  \"email\": \"user@example.com\",\r\n  \"password\": \"password\"\r\n}\r\n```\r\n\r\nIf the credentials are valid, the API will respond with a JWT token, which should be included in subsequent requests as an Authorization header:\r\n\r\n```json\r\nAuthorization: Bearer \u003ctoken\u003e\r\n```\r\n\r\n### Endpoints\r\n\r\n#### Auth\r\n\r\n- **POST /api/v2/auth/register**: Create a new account.\r\n- **POST /api/v2/auth/login**: Login to the account.\r\n- **GET /api/v2/auth/me**: Get profile details.\r\n\r\n#### Post\r\n\r\n- **GET /api/v2/post/create**: Create a new post.\r\n- **GET /api/v2/post/feed**: Get post feed.\r\n\r\n## Deployment\r\n\r\nThis API can be deployed using various platforms such as Heroku, AWS, Google Cloud Platform, or your own server infrastructure. Here are some general steps to deploy the API:\r\n\r\n1. **Prepare your environment**: Ensure that your deployment environment meets the requirements specified in the Prerequisites section.\r\n\r\n2. **Build the application**: If necessary, build the TypeScript code into JavaScript. You can do this by running:\r\n\r\n   ```bash\r\n   npm run build\r\n   ```\r\n\r\n   or\r\n\r\n   ```bash\r\n   yarn build\r\n   ```\r\n\r\n   or\r\n\r\n   ```bash\r\n   bun run build\r\n   ```\r\n\r\n3. **Configure environment variables**: Set up environment variables similar to how it's done in the local setup. Ensure that you provide appropriate values for your deployment environment.\r\n\r\n4. **Deploy the application**: Deploy the built application to your chosen platform. Each platform may have its own deployment process. Refer to the documentation of your chosen platform for detailed instructions.\r\n\r\n5. **Start the application**: Once deployed, start the application in your deployment environment. This might involve running a command similar to `npm start` or `yarn start`, depending on your setup.\r\n\r\n6. **Monitor the deployment**: Monitor the deployed application for any issues. Make sure that it's running smoothly and handle any errors or performance issues as needed.\r\n\r\n## Technologies Used\r\n\r\n- Node.js\r\n- Express.js\r\n- Bun\r\n- TypeScript\r\n- MongoDB\r\n\r\n## Contributing\r\n\r\nIf you would like to contribute to this project, feel free to fork the repository, make your changes, and submit a pull request. Please follow the guidelines in the [CONTRIBUTING.md](CONTRIBUTING.md) file.\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n## Sponsor Me\r\n\r\nBy sponsoring my efforts, you're not merely contributing to the development of my projects; you're investing in its growth and sustainability.\r\n\r\nYour support empowers me to dedicate more time and resources to improving the project's features, addressing issues, and ensuring its continued relevance in the rapidly evolving landscape of technology.\r\n\r\nYour sponsorship directly fuels innovation, fosters a vibrant community, and helps maintain the project's high standards of quality. Together, we can shape the future of the projects and make a lasting impact in the open-source community.\r\n\r\nThank you for considering sponsoring my work!\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanieldev219%2Fsocial-media-api-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanieldev219%2Fsocial-media-api-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanieldev219%2Fsocial-media-api-nodejs/lists"}