ChefShare is a backend application for sharing recipes between chefs and food enthusiasts. The platform allows users to create, discover, and interact with recipes in a social cooking community.
Status: Work In Progress 🚧
-
User Management
- Registration and authentication with JWT
- Email verification system
- Password reset with OTP
- Profile management
-
Recipe Management
- Create, read, update, delete (CRUD) operations
- Categorization and tagging system
- Difficulty levels (easy, medium, hard)
- Detailed recipe information (prep time, cook time, serving size)
-
Social Features
- Reviews and ratings
- Bookmarking favorite recipes
- Like/unlike recipes
-
API Security
- JWT-based authentication
- Token refresh mechanism
- Token blacklisting for logout
- Rate limiting for sensitive operations
- Language: Go 1.24+
- Web Framework: Gin - High-performance web framework
- Database: PostgreSQL with migrations using Goose
- Authentication: JWT (JSON Web Tokens) with refresh token mechanism
- Documentation: Swagger/OpenAPI
- Email Service: Resend.com for transactional emails
- Infrastructure: Docker for containerization
chefshare_be/
├── api/ # HTTP handlers for API endpoints
├── app/ # Application setup and configuration
├── docs/ # Auto-generated Swagger documentation
├── internal/ # Core business logic and domain models
├── middleware/ # HTTP middleware (auth, rate limiting, etc.)
├── migrations/ # Database migrations managed by Goose
├── routes/ # API route definitions
├── services/ # Business service implementations
├── store/ # Database access and repository layer
└── utils/ # Helper utilities and common functions
- Go 1.24+
- PostgreSQL
- Docker and Docker Compose (for local development)
- Clone the repository
git clone https://github.com/dapoadedire/chefshare_be.git
cd chefshare_be- Install dependencies
go mod download- Set up environment variables
cp .env.example .env
# Edit .env with your configuration- Start the PostgreSQL database using Docker
make docker-up- Run the application
make run- Access the API at
http://localhost:8080/api/v1 - Access Swagger documentation at
http://localhost:8080/swagger/index.html
API endpoints are available at /api/v1
POST /api/v1/auth/register- Register a new userPOST /api/v1/auth/login- Login and get JWT tokenPOST /api/v1/auth/token/refresh- Refresh access tokenPOST /api/v1/auth/logout- Logout and invalidate tokensPOST /api/v1/auth/verify-email/confirm- Verify email addressPOST /api/v1/auth/password/reset/request- Request password reset
GET /api/v1/auth/me- Get authenticated user profile
GET /api/v1/recipes- List all recipesGET /api/v1/recipes/:id- Get a specific recipePOST /api/v1/recipes- Create a new recipePUT /api/v1/recipes/:id- Update a recipeDELETE /api/v1/recipes/:id- Delete a recipe
GET /api/v1/health- Check API and database health
make generate-swagger-docs# Start PostgreSQL container
make docker-up
# Stop and remove containers
make docker-downMIT