DigitalCookBook — Desktop Recipe Manager (Java Swing)
DigitalCookBook is a small, modular Java desktop application that helps cooks, chefs and viewers manage recipes locally. It provides a Swing-based user interface for signing up and signing in users, adding and editing recipes, categorizing recipes, and marking favourites. The app uses JDBC for persistence and is organized with a clear package layout for dao, model, services, and ui layers.
This repository contains the full source code under src/ and is structured so it can be built and run with a standard Java toolchain (JDK 11+ recommended).
- Three types of users:
Admin,Chef, andViewer - Sign Up as a Chef or Viewer
- Login / Logout functionality with role-based access
- Secure credential storage and validation
- Add new recipes with:
- Title
- Ingredients
- Category (
Veg,Non-Veg,Dessert) - Image upload
- Step-by-step instructions
- Edit or Delete owned recipes
- View Admin Announcements in a dedicated announcement panel
- Browse all recipes
- Search recipes by title or filter by category (via dropdown)
- Mark recipes as Favourite / Unfavourite
- View all favourite recipes in a separate Favourites Section
- Browse Chef List and view all recipes by a particular chef
- Access Announcements made by the admin
- Manage users:
- View and Delete Chefs and their recipes
- View and Delete Viewers
- Announcement System:
- Create announcements for:
- Chefs
- Viewers
- Both
- Manage and remove announcements
- Create announcements for:
- Centralized dashboard to monitor all users and recipes
- Language: Java (JDK 11+)
- UI: Swing
- Database: JDBC-based persistence
- Architecture: Layered (
dao,model,service,ui) - Entry Point:
Main.java(launches the Swing UI)
digitalCookBook/
│
├── src/
│ ├── dao/
│ │ ├── dbConnection/
│ │ │ └── DBConnection.java
│ │ ├── RecipeDao.java
│ │ ├── UserDao.java
│ │ └── ...
│ │
│ ├── model/
│ │ ├── User.java
│ │ ├── Recipe.java
│ │ ├── Announcement.java
│ │ └── ...
│ │
│ ├── service/
│ │ ├── AuthService.java
│ │ ├── RecipeService.java
│ │ ├── AnnouncementService.java
│ │ └── ...
│ │
│ ├── ui/
│ │ ├── auth/
│ │ │ ├── LoginPage.java
│ │ │ ├── SignUpPage.java
│ │ │ └── ...
│ │ │
│ │ ├── admin/
│ │ │ ├── AdminDashboard.java
│ │ │ ├── AnnouncementPanel.java
│ │ │ └── ...
│ │ │
│ │ ├── chef/
│ │ │ ├── ChefDashboard.java
│ │ │ ├── AddRecipeForm.java
│ │ │ └── ...
│ │ │
│ │ ├── viewer/
│ │ │ ├── ViewerDashboard.java
│ │ │ ├── FavouritePanel.java
│ │ │ └── ...
│ │ │
│ │ └── Main.java
│ │
│ ├── util/
│ │ ├── LogoutAction.java
│ │ └── StyleActionBtn.java
│ │
│ └── resources/
│ ├── icons/
│ └── images/
│
├── README.md
└── .gitignore
Prerequisites:
- Java JDK 11 or later installed and available on your PATH. The project uses the Java module system and Swing.
Steps:
- Clone or download this repository.
- From the project root open a terminal/command prompt.
- Compile the sources. From the
srcfolder you can compile with javac or from the project root; examples below assume you are at the repository root and have a JDK installed.
Compile (from project root):
javac -d out --module-source-path src $(find src -name "*.java")This places compiled classes under out/ using the module source path. On Windows with Git Bash you may need to adjust the find command or provide a list of files.
Run the application using the Java module system. The project's module name is digitalCookBook (see src/module-info.java). The following runs the main class located in main.Main:
java --module-path out -m digitalCookBook/main.MainIf you prefer a simpler classpath run (for development), compile without modules and run the Main class directly. Example:
# compile (non-modular)
javac -d classes $(find src -name "*.java")
# run
java -cp classes main.MainNotes:
- The app expects a local JDBC connection handled by
dao/dbConnection/DBConnection.java. Configure any connection strings or embedded database files there if needed. - If you plan to package the app as a runnable JAR, create a manifest with the
Main-Class: main.Mainentry and include all compiled classes and resource files.
Contributions are welcome. Suggested workflow:
- Fork the repository.
- Create a feature branch (git checkout -b feature/your-feature).
- Make small, focused commits.
- Run and manually test the app locally.
- Open a pull request describing the change.
When contributing, please:
- Follow the existing package structure and naming conventions.
- Add unit tests where appropriate (this project is Swing-heavy and may require integration tests).
- Keep UI changes incremental and documented.
This project is provided under the MIT License. You can copy, modify and distribute the code. Replace this block with a different license if you prefer.