Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
275 changes: 125 additions & 150 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,96 @@
main
# Frostiq BakeryBackend

## Overview
Frostiq's BakeryBackend is a FastAPI-based backend service for managing user favorites in a bakery application. It supports adding, listing, and deleting favorite items for users, with robust validation and access control.

## Features
- Add, list, and delete user favorites
- Duplicate detection to prevent redundant entries
- Input validation for item names
- Resource-level authorization for deletion
- SQLite database (file always stored in `BakeryBackend/`)
- Ready for unit/integration testing with pytest

## Setup Instructions
1. **Clone the repository:**
```bash
git clone <your-repo-url>
cd frostiq
```
2. **Install dependencies:**
```bash
pip install -r requirements.txt
```
3. **Run the application:**
```bash
uvicorn BakeryBackend.main:app --reload
```
The API will be available at [http://127.0.0.1:8000](http://127.0.0.1:8000)
# 🍰 Frostiq BakeryBackend

## 🧩 Overview

**Frostiq BakeryBackend** is a FastAPI-based backend service for managing user favorites in the Frostiq Bakery ecosystem.
It provides APIs to **add**, **list**, and **delete** favorite items for users, with validation, duplication checks, and secure access control.
This backend is a part of the **FrostIQ monorepo**, which hosts multiple interlinked projects such as the frontend and other web apps.

---

## 🚀 Features

* Add, list, and delete user favorites
* Prevent duplicate entries
* Validate item names before insertion
* Secure deletion via resource-level authorization
* SQLite database (auto-created in `BakeryBackend/`)
* Fully testable with `pytest` (unit + integration)

---

## Prerequisites
- Git
- Node.js (v14 or higher) - for most subprojects
- Python (if any subproject requires it)
- Docker (optional, for containerized deployment)


## ⚙️ Setup Instructions

### 1. Clone the Repository

If you are working within the FrostIQ monorepo:

```bash
git clone --recurse-submodules https://github.com/indra7777/frostiq.git
cd frostiq/BakeryBackend
```

If you've already cloned without submodules:
```bash
git submodule update --init --recursive
```

If you are working on this backend alone:

```bash
git clone https://github.com/RoshanAli339/BakeryBackend.git
cd BakeryBackend
```

### 2. Install Dependencies

```bash
pip install -r requirements.txt
```

### 3. Run the Application

```bash
uvicorn BakeryBackend.main:app --reload
```

**API Base URL:** [http://127.0.0.1:8000](http://127.0.0.1:8000)

## 🔗 API Endpoints

| Method | Endpoint | Description |
| ---------- | -------------------------------------- | ------------------------------ |
| **POST** | `/favorites/` | Add a favorite item |
| **GET** | `/favorites/{user_id}` | List all favorites for a user |
| **DELETE** | `/favorites/{favorite_id}?user_id=...` | Delete a favorite (owner only) |


---

## 🧪 Running Tests

1. Ensure pytest is installed:

## Running Tests
1. **Ensure pytest is installed:**
```bash
pip install pytest
```
2. **Run the tests:**
2. Run test suite:

```bash
pytest BakeryBackend/routers/test_favorites.py
```

## Project Structure
---

## 📁 Project Structure

```
frostiq/
├── BakeryBackend/
Expand All @@ -54,27 +106,10 @@ frostiq/
└── README.md
```

## API Endpoints
- `POST /favorites/` — Add a favorite
- `GET /favorites/{user_id}` — List favorites for a user
- `DELETE /favorites/{favorite_id}?user_id=...` — Delete a favorite (only by owner)

## Notes
- The database file is always created in the `BakeryBackend` directory for consistency.
- The codebase is structured for easy extension and testing.
FrostIQ is a monorepo containing multiple independent projects:

---

Made with ❤️
=======
# FrostIQ

A collection of collaborative projects featuring various web applications and platforms.

## 📋 Project Structure

FrostIQ is a monorepo containing multiple independent projects:

1. **BakeryBackend** - Backend services for bakery management system
- GitHub: [RoshanAli339/BakeryBackend](https://github.com/RoshanAli339/BakeryBackend)

Expand All @@ -87,131 +122,71 @@ FrostIQ is a monorepo containing multiple independent projects:
4. **Torto-Forto** - Web application project
- GitHub: [kvnrajasekhar/torto-forto](https://github.com/kvnrajasekhar/torto-forto)

## 🚀 Getting Started

### Prerequisites
- Git
- Node.js (v14 or higher) - for most subprojects
- Python (if any subproject requires it)
- Docker (optional, for containerized deployment)

### Installation

1. **Clone the repository with submodules**
```bash
git clone --recurse-submodules https://github.com/yourusername/frostiq.git
cd frostiq
```

If you've already cloned without submodules:
```bash
git submodule update --init --recursive
```

2. **Set up individual projects**
Each subproject is independent and has its own setup instructions. Navigate to each project's directory and follow their respective README files:

```bash
# Example for BakeryBackend
cd BakeryBackend
# Follow README instructions in that directory

# Similarly for other projects
cd ../bakery
# Follow README instructions
```

### Running the Applications

Each subproject has its own setup and running instructions. Please refer to their respective README files for the most accurate information. Here's a general overview:

#### BakeryBackend
```bash
cd BakeryBackend
# Check the project's README for specific setup instructions
# Typically involves installing dependencies and starting the server
# Example (may vary):
# npm install
# npm start
```

#### Bakery Frontend
```bash
cd bakery
# Check the project's README for specific setup instructions
# Typically involves installing dependencies and starting the development server
# Example (may vary):
# npm install
# npm run dev
```

#### Hackmela & Torto-Forto
Navigate to each directory and follow their respective README files for specific instructions.
### Subproject-Specific Contributions
Each subproject may have its own contribution guidelines. Please check the `CONTRIBUTING.md` or `README.md` in each subproject directory for specific instructions.

## 🛠️ Technologies Used
---

Each subproject may use different technologies. Here are the main technologies used across the projects:
## 🧠 Notes

- **BakeryBackend**:
- Backend framework (Node.js/Express, Python/Flask, etc.)
- Database (MongoDB, PostgreSQL, etc.)
- API standards (REST/GraphQL)
* The SQLite database file is always created inside `BakeryBackend/` for consistency.
* The architecture supports easy expansion for authentication, analytics, or multi-DB support.
* Built following clean coding and testing standards.

- **Bakery Frontend**:
- Frontend framework (React, Vue, Angular, etc.)
- State management (Redux, Context API, etc.)
- Styling (CSS, SASS, Tailwind, etc.)
---

- **Hackmela & Torto-Forto**:
- Check respective READMEs for specific technologies
## 🤝 Contributing

**Common Tools**:
- Git for version control
- npm/yarn for package management
- Docker (if containerization is used)
We welcome contributions to improve BakeryBackend!

## 🤝 Contributing
### Steps to Contribute

We welcome contributions to any of the subprojects! Here's how you can contribute:
1. **Fork the repository** a button on the top right side and clone it locally:

### General Guidelines
1. Fork the main repository and clone it with submodules:
```bash
git clone --recurse-submodules git@github.com:yourusername/frostiq.git
```
2. **Create a new branch:**

2. Create a new branch for your feature/fix:
```bash
git checkout -b feature/your-feature-name
```
3. **Make your changes** in the appropriate subproject (e.g., `BakeryBackend/`).
4. **Commit changes** using conventional commits:

3. Make your changes in the appropriate subproject directory

4. Commit your changes with a clear message:
```bash
git commit -m "feat(subproject): brief description of changes"
git commit -m "feat(backend): add new validation for favorites"
```
5. **Push and open a Pull Request.**

5. Push your changes and create a Pull Request
> Each subproject (like BakeryBackend) may have its own guidelines. Check for `CONTRIBUTING.md` or the project’s README before submitting PRs.

### Subproject-Specific Contributions
Each subproject may have its own contribution guidelines. Please check the `CONTRIBUTING.md` or `README.md` in each subproject directory for specific instructions.
---

### Code Style
- Follow the coding style of each subproject
- Write clear commit messages following conventional commits
- Include relevant documentation updates with your changes
- Add tests for new features when possible
## 🛠️ Technologies Used

* **Backend:** FastAPI (Python 3.9+)
* **Database:** SQLite
* **Testing:** Pytest
* **Server:** Uvicorn

## 📄 License
---

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## 📜 License

## 📞 Contact
This project is licensed under the **MIT License**.
See the [LICENSE](../LICENSE) file for more information.

---

## 💬 Contact

For questions, issues, or suggestions, please open an issue in the [FrostIQ main repository](https://github.com/indra7777/frostiq/issues).

---

For any questions or feedback, please open an issue in the repository.
**Made with ❤️ by the FrostIQ Team**

---

*Note: This README is a template. Please update the sections with actual project-specific information.*
main
Would you like me to make it slightly more “contributor-friendly” (with badges, quick-start code block, and setup troubleshooting) or keep it in this professional-clean format that matches the maintainer’s style?