The Cookbooked API is a backend service designed specifically to support the Cookbooked application. It provides structured endpoints for managing user data, recipes, and ingredients, ensuring data integrity and secure management for the application’s functionalities.
- User Registration and Authentication: Secure user spaces, protecting culinary secrets.
- Manage Recipes: Organize, store, and retrieve your cherished recipes.
- Ingredient Management: Log and categorize essential cooking components.
- Searching: Filter and Search recipes and ingredients.
- Go: For scalable and efficient application development.
- GORM: Ensuring smooth database interactions.
- Fiber: A web framework for Go, utilized for efficient API development.
- Goose: A database migration tool, managing schema changes and versioning.
- PostgreSQL: Offering a reliable, open-source database system.
- Docker: Guaranteeing consistent API functionality across various computing environments.
- Railway: Deploying the API to the cloud.
- Swagger: Documenting the API endpoints.
- Go 1.21+
- PostgreSQL
- Docker (optional)
- Clone this repository:
git clone https://github.com/fseda/cookbooked-api.git
- Install dependencies:
go mod download
- Create a PostgreSQL database:
createdb [your_db_name] or create a remote psql database
- Create a
.env
file in the root directory of the project and add the following environment variables:PGUSER=[your_db_username] PGPASSWORD=[your_db_password] PGDATABASE=[your_db_name] PGHOST=[localhost|your_db_host] PGPORT=[5432|your_db_port] DATABASE_URL=[your_db_url] PORT=[3000|your_port] JWT_SECRET_KEY=[your_jwt_secret_key] GO_ENV=[development|production] (optional)
- Run the migrations:
goose -dir internal/infra/database/migrations postgres "[you_database_url]" up
- Run the app:
go run cmd/http/main.go
API documentation is available at CookBooked API. Or in your localhost if you are running the app locally.
Contributions are warmly welcomed! If you'd like to contribute, please follow these steps:
- Fork the Repository
- Create your Feature Branch
git switch -c feature/your-feature
- Commit your Changes
git commit -m 'Add some feature/your-feature'
- Push to the Branch
git push origin feature/your-feature
- Open a Pull Request and Describe the Changes you Made
Your pull request will be reviewed, and we appreciate your patience in waiting for that review.