https://github.com/techmannih/social-media
https://github.com/techmannih/social-media
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/techmannih/social-media
- Owner: techmannih
- Created: 2024-03-16T16:38:16.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-03-17T03:35:50.000Z (about 2 years ago)
- Last Synced: 2025-02-14T05:15:28.972Z (over 1 year ago)
- Language: JavaScript
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Social Networking API with MongoDB
This project implements a RESTful API for a basic social networking application using Node.js and MongoDB. It supports user profiles, posts, and the ability to follow other users.
## Features
- **User Profiles:** Create, update, view, and delete user profiles with details like username, bio, and profile picture URL. Use UUID for user IDs.
- **Authentication:** Implement JWT-based authentication for signing up, logging in, and performing actions on user profiles.
- **Posts:** Allow users to create, view, update, and delete their posts. Each post includes text content, a timestamp, and the ID of the user who created it.
- **Following Mechanism:** Enable users to follow and unfollow other users. Provide endpoints to retrieve the list of users a user is following and who is following them.
- **Efficient Data Retrieval:** Use MongoDB's aggregation framework to implement efficient queries for the social feed, displaying posts from users that a given user follows, sorted by most recent.
- **Data Modeling:** Design MongoDB schemas for users, posts, and follows. Consider references or embedded documents for optimal performance.
- **Security and Validation:** Implement input validation to prevent injection attacks and rate limiting to protect against brute force attacks.
- **Testing:** Write integration tests to ensure API endpoints work as expected and handle errors gracefully.
- **Documentation:** Provide comprehensive API documentation detailing endpoint descriptions, request/response formats, and example use cases.
## Getting Started
1. Clone this repository to your local machine.
2. Install dependencies using `npm install`.
3. Ensure MongoDB is running locally or provide a connection URI to a remote MongoDB instance.
4. Set up environment variables as specified in `.env.example`.
5. Run the application using `npm start`.
6. Run integration tests using `npm test` to verify the functionality of the API endpoints.
7. Refer to the API documentation for detailed usage instructions and examples.
## API Documentation
The API documentation provides comprehensive information about all endpoints, including their descriptions, request/response formats, and example use cases.
## Technologies Used
- Node.js
- Express.js
- MongoDB
- JWT for authentication
## Contribution Guidelines
Contributions are welcome! Please follow these guidelines when contributing:
- Fork the repository and create a new branch for your feature/bug fix.
- Ensure your code follows the established coding style and conventions.
- Write clear, concise commit messages and comments.
- Test your changes thoroughly before submitting a pull request.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.