Skip to content

Dream-Factory-T6/DreamFactory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

386 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CI

πŸ’­ Dream Factory β€” Backend API

Dream Factory is a RESTful API developed to manage users’ travel dreams. Each user can share their desired destinations, leave reviews, like other destinations, comunicate in live chat and interact with a secure and modern backend system. This backend project is built using Java, Spring Boot, and Spring Security. It implements authentication with JWT + Refresh Token, supports Cloudinary for image storage, and includes integrated email notifications, Web Socket for live chat. The system features reviews, likes/unlikes, and global exception handling to ensure a reliable and user-friendly API experience.

Index πŸ“‹

Key Features πŸ—

Security and Authentication πŸ”’

  • Authentication with JWT + Refresh Token

  • Route protection using JWT Bearer Token

  • User roles: USER and ADMIN

  • Implemented login, sign-up, and email notifications:

    Email confirmation upon registration

    Email notification upon submitting a review

Users πŸ™‹πŸ»β€β™€οΈ

  • User registration and login

  • Access to personal user data

  • Admin panel (for ADMIN users only):

  • View all registered users

  • Edit user roles and data

  • Delete users from the system

Destinations 🌍

  • CRUD operations for destinations (only for the user's own data)

  • Admins can manage all destinations

  • Destination images are stored using Cloudinary

  • Filter destinations by title or location

  • Pagination of destination list

  • Sort destinations so that user’s own entries appear first

Interaction with Destinations πŸ’Ÿ

  • Reviews: users can leave comments, with email notification sent to the author

  • Like / Unlike: authenticated users can like or unlike destinations

API Documentation β›“

  • Integrated with Swagger UI for API visualization and testing

Exception Handling ❗

  • Global exception handling using @ControllerAdvice (GlobalExceptionHandler)

  • Returns structured and informative error messages

Technologies Used πŸ‘©πŸ»β€πŸ’»

Java Spring Apache Maven GitHub Git Postman MySQL draw.io Cloudinary Swagger

Clone the Repository πŸ“

git clone https://github.com/Dream-Factory-T6/DreamFactory.git
cd DreamFactory

Run πŸƒπŸ»β€β™€οΈ

./mvnw spring-boot:run

or

mvn spring-boot:run

Alternative Way to Run the Application If you are using an IDE such as IntelliJ IDEA,VS Code etc, you can simply click the β€œRun” button or run the main application class directly (the one annotated with @SpringBootApplication). For example, in IntelliJ IDEA, right-click the main class and choose "Run 'DfApplication...main()'".

πŸ“š API Endpoints

Registration / Login

  • POST /api/register β€” Create a new user.
  • POST /api/auth/refresh β€” Refresh access token using refresh token.
  • POST /api/register/admin β€” Create new user by user with role ADMIN.

User

  • GET /api/users β€” Get all users.
  • GET /api/users/{id} β€” Get user by ID
  • PUT /api/users/{id} β€” Update user by user with role ADMIN.
  • DELETE /api/users/{id} β€” Delete user by ID

Destination

  • GET /api/destinations β€” Get all Destination.
  • GET /api/destinations/{id} β€” Get Destination by ID.
  • GET /api/destinations/filter β€” Get Destination by filter.
  • GET /api/destinations/my-destinations - Get Destination by username.
  • POST /api/destinations β€” Create new Destination.
  • PUT /api/destinations/{id} β€” Update Destination by ID
  • DELETE /api/cart/remove/{productId} β€” Delete Destination by product ID

Review

  • GET /api/reviews β€” Get all reviews by username from Authorization.
  • GET /api/reviews/destination/{id} β€” Get all reviews by Destination ID.
  • POST /api/reviews β€” Create new review.
  • PUT /api/reviews/{id} β€” Update review by ID.
  • DELETE /api/reviews/{id} β€” Delete review by ID.

Destination Like

  • POST /api/destinations/{id}/likes/toggle β€” For Like/UnLike.
  • GET /api/destinations/{id}/likes β€” Get all Likes by Destination ID.

Live Chat

  • GET /api/chat/room/{roomId}/messages β€” Get the latest messages from the room
  • GET /api/chat/roomsβ€” Get a list of available rooms
  • /chat.sendMessage β€” Send message
  • /chat.addUser β€” Add user to room
  • /chat.leaveRoom β€” Leave the room

Running Tests πŸƒπŸ»β€β™‚οΈ

temp-Imagen0jdwy.avif

EER Diagram

temp-Image-UYIh0o.avif

Chat Flow Diagram

Flow-D-Dream-Factory-1.jpg

Class Diagram

drem-factory-classes.jpg

Contributors πŸ‘©πŸ»β€πŸ’»

Paula Calvo Garcia GitHub icon

Nadiia Alaieva GitHub icon

Anna Nepyivoda GitHub icon

About

Backend part for project Femcoders 2025

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages