Skip to content

JeremyTremblay2/Junkorama

Repository files navigation

🗑️ Junkorama

We Sell Mistakes So You Don’t Have to Make Them.

Junkorama is an API and a web application designed to manage products and their reviews.

🚀 Features

  • 🛒 Product Management:
    • Add, edit, delete, and get products.
    • Add, edit and delete product images.
  • 📝 Review Management:
    • Add, edit, delete, and get reviews.
    • Manage helpful votes on reviews.
  • User management
    • Add, edit and delete users.
    • Auth mecanism using JWT.
  • Localisation mecanism to know the user localisation, perferct for delivery!
  • 📊 Integrated Swagger documentation to explore available routes.
  • 👤 User authentication and authorization using JWT tokens.

📱 Application

This web application let you see, navigate products and their reviews ! You can also edit and delete your reviews. You can search a product with its title or description. You have your account and you can create it or log in depending if it is your first time here or not, you can also customize your profil page.

Current preview of the Junkorama web application.

This API is used to manage products and their reviews in various contexts, such as online stores or inventory management systems.

Current preview of the Swagger documentation with available routes for managing products and reviews.

💻 Languages and Technologies Used

🏗️ Architecture implemented

We implemented a 3-tier architecture to ensure clear separation of concerns and scalability. The application is divided into:

  • Presentation layer: Handles HTTP requests and responses using Actix-Web, and contains the swagger documentation.
  • Logic layer: Contains the core business logic of the API.
  • Data layer: Manages communication with the PostgreSQL database using SQLx and the external API.

This structure improves maintainability and makes the codebase easier to test and extend.

📚 Prerequisites

To run the API locally, you need to install the following tools:

If you want to run the front locally as well, the following dependencies are required:

🏃‍♂️ How to Run the API

Locally with Cargo

  1. 📥 Clone the repository.

  2. 📦 Install dependencies with cargo build.

  3. 🛠️ Set up your PostgreSQL database and create a .env file at the root of the project to define your environment variables, for example:

     DATABASE_URL=postgres://postgres:password@localhost:5432/junkorama
     JWT_SECRET=your_jwt_secret
  4. 🚀 Run the SQL migrations with sqlx migrate run.

  5. 🌟 Start the server with cargo run.

  6. 📖 Access the Swagger documentation at: http://localhost:8080/swagger-ui/.

To run the test, you will also need to create the following environment variable:

  DATABASE_URL=postgres://postgres:password@localhost:5432/junkorama

Prefer use another database for the tests because they will clear your tables for testing needs.

Then execute in the src folder:

cargo test -- --test-threads=1

🏃‍♂️ How to Run the web app

You need to run the back-end for the front.

📦 Make sure you have npm installed and node.js > 20.x, and then at the client/ folder, run the following commands:

# Install the required dependencies, may take some time.
npm install

# Run the application locally.
npm run dev

📖 Access the web application at: http://localhost:80/.

Using Docker Compose

  1. 📥 Clone the repository.

  2. 🛠️ Create a .env file at the root of the project to define your environment variables, for example:

    POSTGRES_USER=postgres
    POSTGRES_PASSWORD=password
    POSTGRES_DB=junkorama
    JWT_SECRET=your_jwt_secret
  3. 🐳 Run the following command to start the services:

    docker compose up --build
  4. 📖 Access the Swagger documentation at: http://localhost:8080/swagger-ui/.

  5. 📖 Access the web application at: http://localhost:80/.

Note: The docker-compose.yml file is configured to set up both the API and a PostgreSQL database.

📖 Documentation

You can find the API documentation in the Postman collection available in the docs folder of the repository or use the Swagger UI at the following URL: http://localhost:8080/swagger-ui/.

🛠️ Testing

To run the tests, use the following command:

cargo test -- --test-threads=1

🤝 How to Contribute

  1. 🍴 Fork the repository.
  2. 🌿 Create a new branch for your feature.
  3. 💾 Commit your changes.
  4. 🚀 Push your branch.
  5. 📬 Create a pull request.

👥 Authors

TREMBLAY Jérémy

CROISIER Maxime

VALETTE Adrien

📝 License

This project is licensed under the MIT License. You are free to use, modify, and share it.

Read more about the MIT license.

If you use Junkorama in your projects, please cite our repository as follows:

@misc{junkorama2025,
  author = {Jérémy Tremblay, Maxime Croisier & Adrien Valette},
  title = {Junkorama: Product and Review Management},
  year = {2025},
  howpublished = {\url{https://github.com/JeremyTremblay2/stellar-api}},
  note = {Version 1.0}
}

About

We Sell Mistakes So You Don’t Have to Make Them.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •