Git Product home page Git Product logo

motorola-solutions-app's Introduction

My Motorola Solutions Application

Overview

This project is a full-stack application for managing orders and products. It uses a React frontend and an Express backend, both containerized with Docker. This README provides setup instructions, Docker configurations, and an overview of the project structure.

Table of Contents

Getting Started

To get started with this project, follow these steps:

  1. Clone the Repository

    git clone https://github.com/Alasgaroff/motorola-solutions-app.git
    cd motorola-solutions-api
  2. Install Dependencies Ensure you have Docker and Docker Compose installed. You can get Docker from Docker's official website.

Folder Structure

Here is the main folder structure of the project:

.
├── backend
│   ├── Dockerfile
│   ├── index.js
│   ├── models
│   ├── routes
├── frontend
│   ├── Dockerfile
│   ├── public
│   ├── src
├── docker-compose.yml
└── nginx.conf

Key Folders and Files

  • backend: Contains the Express backend application.

    • Dockerfile: Defines the backend Docker image.
    • index.js: The main entry point of the backend application.
    • models/: Contains database models.
    • routes/: Contains API route handlers.
  • frontend: Contains the React frontend application.

    • Dockerfile: Defines the frontend Docker image.
    • public/: Static assets and configuration files.
    • src/: Source code for React components and application logic.
  • docker-compose.yml: Defines the Docker Compose configuration for managing multi-container Docker applications.

  • nginx.conf: Nginx configuration file for serving the frontend.

Docker Setup

Build and Run Docker Containers

  1. Build and Run the Containers

    docker compose up --build
    docker compose build --no-cache

    Build without cache and Run the Containers

    docker compose build --no-cache
    docker compose up
  2. Stop and Remove Containers

    docker compose down

Test

Run Tests with Docker Compose

docker compose run test

Important Docker-Specific Configurations

  • Volume Mappings: Ensure persistent data is handled properly by configuring volume mappings in the docker-compose.yml file if needed.
  • Network Configurations: The docker-compose.yml file handles network configurations to allow communication between frontend and backend services.

API Documentation

Endpoints

  • Login

    • POST /login: Authenticates a user and returns a JWT token.
    • Request Body: { "username": "string", "password": "string" }
    • Response: { "token": "string" }
  • Orders

    • GET /orders: Fetches all orders.
    • POST /orders: Creates a new order.
    • Request Body: { "customerName": "string", "products": [{ "productId": "number", "quantity": "number" }], "destination": "string" }
  • Products

    • GET /products: Fetches all products.
    • POST /products: Creates a new product.
    • Request Body: { "name": "string", "price": "number" }

Styling and Functionality

App Component

  • Displays navigation buttons for different pages.
  • Requires login before accessing other functionalities.
  • Once logged in, all navigation buttons become visible.

Authentication Handling

The application includes functionality to manage authentication states, hide or show navigation buttons based on the login status, and display appropriate messages.

motorola-solutions-app's People

Contributors

alasgaroff avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.