BiteByte is a react web app powered by a Spring AI and MongoDB.
- AI Recipe Customization using OpenAI
- Add and View Recipes
- Participate in Live Cooking Classes
- User Authentication and Authorization
- Dark and Light Theme Toggle
The project is divided into two main parts:
-
Backend: A modular monolithic Spring Boot application that handles the API and business logic. The backend is divided into the following modules:
- ai: Handles AI-related functionalities using OpenAI.
- common: Contains common utilities and configurations used across other modules.
- livecooking: Manages live cooking classes.
- recipe: Manages recipe-related functionalities.
- security: Handles user authentication and authorization.
- user: Manages user-related functionalities.
- util: Contains utility classes and methods.
-
Frontend: A React application that provides the user interface.
-
Backend:
- Java (Amazon Corretto)
- Spring Boot
- Spring AI
- MongoDB
- OpenAI API
-
Frontend:
- React
- Vite
-
Clone the repository:
git clone https://github.com/yourusername/BiteByte.git cd BiteByte
-
Navigate to the backend directory:
cd src/main/java/com/main/bitebyte
-
Build the project using Gradle:
./gradlew build
-
Run the Spring Boot application:
./gradlew bootRun
-
Configure the application properties file:
spring.data.mongodb.uri=mongodb+srv://<username>:<password>@<cluster>.umrcw.mongodb.net/?retryWrites=true&w=majority&appName=bitebyte spring.data.mongodb.database=bitebyte spring.data.mongodb.auto-index-creation=false spring.ai.openai.api-key= <OpenAI Key> spring.ai.openai.model=gpt-4o spring.ai.openai.urls.base=https://api.openai.com spring.ai.openai.urls.chat-completion=/v1/chat/completions # JWT Configuration jwt.secret= <JWT> jwt.expiration=86400000 jwt.expiration.ms=3600000 # Add this line app.jwtSecret=${jwt.secret} # Server configuration server.port=8080 # Disable context path server.servlet.context-path= # Vector store configuration spring.ai.vectorstore.name=vector_store
-
Navigate to the client directory:
cd client
-
Install the dependencies:
npm install
-
Start the development server:
npm start
- Open your browser and navigate to
http://localhost:3000
. - Sign up or sign in to your account.
- Use the navigation bar to access different features like adding recipes, viewing recipes, and participating in live cooking classes.
- Customize recipes using the AI Recipe Customization feature.
POST /api/auth/signup
- Sign up a new userPOST /api/auth/signin
- Sign in an existing user
GET /api/recipes
- Get all recipesGET /api/recipes/{id}
- Get a specific recipe by IDPOST /api/recipes
- Add a new recipe (Admin only)PUT /api/recipes/{id}
- Update a recipe (Admin only)DELETE /api/recipes/{id}
- Delete a recipe (Admin only)
GET /api/live-classes
- Get all live cooking classesPOST /api/live-classes
- Add a new live cooking class (Admin only)
POST /api/ai-customization
- Customize a recipe using AI
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature
). - Make your changes.
- Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/your-feature
). - Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.