Skip to content

Rajath2005/SmartCityApp

Repository files navigation

Smart City Guide Banner

πŸ™οΈ Smart City Guide

Your intelligent companion to explore, navigate, and discover the city


Java MySQL CLI License PRs Welcome Contributors


πŸš€ Get Started Β |Β  ✨ Features Β |Β  πŸ—οΈ Architecture Β |Β  🀝 Contributing Β |Β  πŸ—ΊοΈ Roadmap


πŸ“Œ Overview

Smart City Guide is an interactive, console-based Java application that helps residents and tourists discover, search, and navigate city attractions with ease. It acts as an intelligent city companion with a complete role-based system for both regular users and administrators.

Whether you're looking for the best restaurant downtown or managing the city's attraction database as an admin β€” this app has you covered.

⚠️ Note: The application uses a MySQL Database for persistent storage. You will need to set up a local database before running the app. See the Database Setup section below.


✨ Features

πŸ‘€ User Features

Feature Description
πŸ” Register & Login Secure account creation and authentication.
πŸ—ΊοΈ View Attractions Browse a curated list of city places.
πŸ” Search by Category Find places by type β€” Restaurant, Park, Hotel, Museum.
πŸ“ Search by Location Find places in specific areas like Downtown or Main Street.
πŸš— Navigation Simulated access to directions and nearby services.

πŸ› οΈ Admin Features

Feature Description
βž• Add Place Add new city attractions to the database.
✏️ Update Place Edit details of existing places.
❌ Delete Place Remove outdated or incorrect entries.
πŸ“Š System Monitoring View system logs and user activity (Simulated).

πŸ—οΈ Architecture & Project Structure

The application currently follows a monolithic architecture built around a centralized controller (SmartCityApp.java), making it an excellent starting point for beginners to understand Java control flows and JDBC. We are actively looking for contributors to help us refactor this into a Layered Architecture (MVC).

SmartCityGuide/
β”‚
β”œβ”€β”€ πŸ“ Assets/
β”‚   └── SmartCity.drawio.png        # Architecture diagram
β”‚
β”œβ”€β”€ πŸ“ src/
β”‚   └── com/
β”‚       └── smartcity/
β”‚           β”œβ”€β”€ πŸ“ main/
β”‚           β”‚   └── SmartCityApp.java    # Main entry point, controller & UI logic
β”‚           β”œβ”€β”€ πŸ“ model/
β”‚           β”‚   β”œβ”€β”€ Place.java           # City place data model (POJO)
β”‚           β”‚   └── User.java            # User data model & roles (POJO)
β”‚           └── πŸ“ db/
β”‚               └── DBConnection.java    # JDBC MySQL Connection Manager
β”‚
β”œβ”€β”€ db_setup.sql                    # SQL script to initialize the database
β”œβ”€β”€ README.md
β”œβ”€β”€ CONTRIBUTING.md                 # Contribution guidelines
β”œβ”€β”€ CODE_OF_CONDUCT.md              # Community standards
└── .gitignore

πŸš€ Getting Started

βœ… Prerequisites

Make sure you have the following installed:

  • β˜• Java JDK 8 or higher β†’ Download here
  • 🐬 MySQL Server β†’ Download here
  • πŸ’» Terminal / IDE β†’ VS Code, IntelliJ IDEA, or Eclipse
  • πŸ“¦ MySQL JDBC Driver β†’ Ensure mysql-connector-java.jar is in your project's classpath.

πŸ’Ύ Database Setup

Before running the application, you must initialize the MySQL database.

  1. Open your MySQL client (e.g., MySQL Workbench or CLI).
  2. Run the provided SQL script:
    mysql -u root -p < db_setup.sql
    (This creates the smart_city_guide database and the users and places tables).

⚑ Quick Start

# 1. Clone the repository
git clone https://github.com/Rajath2005/SmartCityApp.git

# 2. Navigate into the project
cd SmartCityApp/src

# 3. Compile the application (Make sure to include the MySQL JDBC Driver in your classpath)
javac com/smartcity/main/SmartCityApp.java

# 4. Run the application
java com.smartcity.main.SmartCityApp

πŸ’‘ Tip for beginners: If you're using an IDE like IntelliJ or Eclipse, import the project and run SmartCityApp.java directly. Ensure the MySQL connector library is added to your project structure.


🐳 Run with Docker

No local Java or MySQL install needed β€” everything runs in containers.

Prerequisites: Docker + Docker Compose.

# 1. Clone the repository
git clone https://github.com/Rajath2005/SmartCityApp.git
cd SmartCityApp

# 2. Build and start the app (attached to your terminal, since it's a CLI app)
docker compose run --rm app

This spins up a MySQL container (auto-seeded with db_setup.sql) and runs the app against it. docker compose run keeps stdin/stdout attached so menu prompts work interactively.

Useful commands:

# Start just the database in the background
docker compose up -d mysql-db

# Rebuild the app image after code changes
docker compose build app

# Reset the database (wipes all data, re-seeds on next run)
docker compose down -v

# Stop everything
docker compose down

Default DB credentials (override via DB_PASSWORD env var before running compose): user root, password root, database smart_city_guide.


πŸ› οΈ Technology Stack

Layer Technology
Language Java β˜•
Interface Command Line Interface (CLI)
Data Storage MySQL Database 🐬
Architecture Monolithic (Role-Based)

🀝 Contributing

We ❀️ contributions β€” whether you're fixing a bug, adding a feature, or improving docs! This project is highly focused on being a welcoming space for beginner Java developers.

🌱 Ready to Contribute?

Please read our Contributing Guidelines to learn how to get started. We have specifically outlined Good First Issues (like refactoring to DAOs and fixing resource leaks) in the CONTRIBUTING.md file.

Please also review our Code of Conduct before participating.


πŸ‘₯ Contributors

A huge shoutout to everyone who has contributed to this project! πŸ™Œ

Rajath2005
Rajath Kiran A
alexanderliberacion-cmd
alexanderliberacion-cmd
shikha033
Shikha Singh
sshrrutiiii
Shruti Dixit
rajibul004
Rajibul Mondal
cordeirops
Pedro Sbaraini Cordeiro
JhansiOruganti-43
Jhansi Oruganti
Julito-Dev
Julito-Dev
Nishcahy
Nishchay

Want to see your face here? Check out our Contribution guide!


πŸ—ΊοΈ Roadmap

Here's what's coming next. Check our Issues tab to claim one!

  • πŸ—οΈ Architecture Refactor β€” Migrate SQL logic from SmartCityApp to DAO (Data Access Object) classes.
  • πŸ” Security β€” Hash user passwords (e.g., BCrypt).
  • 🌐 REST API β€” Expose features via a Spring Boot REST API.
  • πŸ–₯️ GUI Interface β€” Build a JavaFX or Swing-based graphical UI.
  • ⭐ Ratings & Reviews β€” Let users rate and review places.
  • πŸ§ͺ Unit Tests β€” Add JUnit tests for all core classes.

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


Made with ❀️ by Rajath2005 and the community

Part of the Creative Coding Progress Series


Back to Top

About

πŸ™οΈ A console-based Java app to explore, search & manage city attractions β€” with role-based access for Users & Admins. Beginner-friendly & open for contributions!

Topics

Resources

License

Code of conduct

Contributing

Stars

8 stars

Watchers

0 watching

Forks

Contributors