Skip to content

An interactive dashboard developed with React.js that visualizes sales data through various charts and graphs. It uses Apollo Client for GraphQL queries to a backend server that provides mock sales and category data.

Notifications You must be signed in to change notification settings

evanigwilo/sales-analytics-dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

React Sales Analytics Dashboard (RSAD)

TypeScript React Sales Analytics Dashboard GraphQL

React Sales Analytics Dashboard (RSAD) is an interactive dashboard developed with React.js that visualizes sales data through various charts and graphs. It uses Apollo Client for GraphQL queries to a backend server that provides mock sales and category data.

Features

  • Dashboard Layout: A clean and intuitive layout with placeholders for charts and data controls.
  • Data Visualization:
    • Line chart for sales trends.
    • Bar chart comparing sales across product categories.
    • Pie chart showing regional sales contributions.
  • Filter Controls: Filters for date ranges and product categories.
  • Real-time Updates: Charts update in real-time when filters are applied.
  • Responsiveness: Adapts to various screen sizes.
  • Error Handling: Graceful handling of no data and other edge cases.
  • Performance Optimization: Uses React performance techniques like memoization and lazy loading.
  • Testing: Using React Testing Library to ensure components render correctly.
  • Mock Data: Backend server provides mock sales and category data through a GraphQL API.

Architecture

High-level Architecture

  • Frontend: React.js application that queries the backend server using Apollo Client.
  • Backend: Simple GraphQL server built with Apollo Server, providing mock sales and category data.

Technologies Used

GraphQL Resolvers

Resolvers Description
getSales Retrieves sales data, including trends and figures..
getCategories Retrieves available product categories for filtering.

Project Setup

Prerequisites

Clone the Repository

# Change to the desired directory
$ cd <desired-directory>

# Clone the repo
$ git clone https://github.com/evanigwilo/sales-analytics-dashboard.git

# Change to the project directory
$ cd sales-analytics-dashboard

Frontend Setup

  1. Environment variables:

    In the frontend directory, change environmental variables file name from .env.example to .env, configuring necessary environment variables.

  2. Run the Development Server in a container environment:

    docker-compose --env-file .env -p sales-analytics-dashboard-dev-stack -f docker-compose.dev.yml up --build -d 
  3. Run Tests (optional):

    docker-compose --env-file .env -p sales-analytics-dashboard-dev-stack -f docker-compose.test.yml up --build -d 
  4. The web-app will be running at http://localhost:3000.

Backend Setup

  1. Environment variables:

    In the backend directory, change environmental variables file name from .env.example to .env, configuring necessary environment variables.

  2. Run the Development Server in a container environment:

    docker-compose --env-file .env -p sales-analytics-dashboard-dev-stack -f docker-compose.yml up --build -d 
  3. The api-server will be running at http://localhost:4000/v1.

Useful Commands

  • Frontend Commands:
    • npm run compose-dev-up: Start frontend development containers.
    • npm run compose-dev-down: Stop frontend development containers.
    • npm run compose-test-up: Start frontend test containers.
    • npm run compose-test-down: Stop frontend test containers.
  • Backend Commands:
    • npm run compose-dev-up: Start backend development containers.
    • npm run compose-dev-down: Stop backend development containers.

References

About

An interactive dashboard developed with React.js that visualizes sales data through various charts and graphs. It uses Apollo Client for GraphQL queries to a backend server that provides mock sales and category data.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published