A robust Go-based REST API for managing community notes and user interactions.
🌐 Website: crediblemandela.xyz
- User authentication and authorization
- Community notes management (CRUD operations)
- Like/Unlike functionality
- User-specific note retrieval
- Advertisement management system
- MongoDB integration
- Docker support
- Implement pagination for all list endpoints
- Add rate limiting for API endpoints
- Implement caching layer with Redis
- Add search functionality for community notes
- Create API documentation with Swagger/OpenAPI
- Add unit tests and integration tests
- Implement user roles and permissions
- Go 1.22.3+
- MongoDB
- Docker & Docker Compose
- Gin Web Framework
- JWT Authentication
- Go 1.22.3 or higher
- Docker and Docker Compose
- MongoDB
POST /api/auth/register
- Register new userPOST /api/auth/login
- Login user
GET /api/community-notes
- Get all community notesGET /api/community-notes/:id
- Get specific community notePOST /api/community-notes
- Create new community noteDELETE /api/community-notes/:id
- Delete community notePOST /api/community-notes/like/:id
- Like a community notePOST /api/community-notes/unlike/:id
- Unlike a community noteGET /api/community-notes/user/:username
- Get user's community notesGET /api/community-notes/user/me
- Get current user's notes
GET /api/ads
- Get all advertisementsGET /api/ads/:id
- Get specific advertisement by IDGET /api/ads/user/:address
- Get all advertisements by user addressGET /api/ads/user/me
- Get current user's advertisementsPOST /api/ads
- Publish new advertisementPUT /api/ads/:id
- Update advertisementDELETE /api/ads/:id
- Delete advertisement
credible-mandela-api/
├── config/ # Configuration management
├── controllers/ # Request handlers
├── middlewares/ # Custom middleware
├── models/ # Data models
├── routers/ # Route definitions
├── services/ # Business logic
├── utils/ # Helper functions
├── docker-compose.yaml
├── go.mod
├── go.sum
└── main.go
- JWT-based authentication with ECDSA signing
- Elliptic Curve Digital Signature Algorithm (ECDSA) for cryptographic operations
- CORS configuration
- Request validation
- Secure environment variable management
- Public/private key pair authentication using ECDSA P-256 curve
Key dependencies include:
- Gin Web Framework
- MongoDB Go Driver
- JWT Go
- Viper
- CORS middleware
For a complete list, see go.mod
.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Your Name (@yourusername)
- Thanks to all contributors
- Inspired by community note-sharing platforms
This README provides:
- Clear installation instructions
- API endpoint documentation
- Project structure overview
- Security features
- Contributing guidelines
- License information
You may want to customize:
- The repository URL
- Author information
- License details
- Any specific deployment instructions for your environment
- Add any additional features or requirements specific to your implementation
Would you like me to modify any section or add more specific details to any part?