amit08255 / solar-terminal

ReactJS NextJS dashboard for solar farm monitoring

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Solar Terminal

Solar panel monitoring application built on top of React

Solar terminal is a monitoring dashboard built over React to monitor status of panels in farm. It uses Next.js API routes for providing API for updates.

📖 Table of Contents

-----------------------------------------------------

➤ Table of Contents

-----------------------------------------------------

➤ Walkthrough

Built With

File Structure

src/
 ├──app/                   * Next.js app router folder. It contains pages
 │   |--layout.tsx         * Defines shared layout for routes
 │   |--page.tsx           * Main dashboard page
 │   │──providers.tsx      * Set up Chakra UI theme
 │   │
 │──components/            * Contains app components
 │   ├──Overview/          * Overview dashboard component
 │   └──SolarGrid/         * Component to display panels in grid
 |──hooks/                 * Contains React hook for fetching grid data updates
 │
 |──pages/                 * Contains Next.js API routes for providing panel data updates
 │
 |──public/                * Contains public assets
 │
 |──test/                  * Jest configuration for testing application
 |
 └──utilities/             * Utilities for generating data for panels

Testing Setup

This is our testing stack:

  • React Testing Library
  • Jest
  • Cypress
  • Eslint

To run unit and integration tests, type npm test in the terminal. To run E2E tests, type npm run test:e2e in the terminal.

-----------------------------------------------------

➤ Getting Started

Dependencies

Tools needed to run this app:

  • node and npm

Install Node.js

Node.js is an environment that can run JavaScript code outside of a web browser and is used to write and run server-side JavaScript apps. Node.js installation includes npm, the package manager that allows you to install NPM modules from your terminal. You can download an installer from the Node.js homepage.

Check your Node.js installation

Check that you have the minimum required version installed by running the following command:

node -v

You should see a version larger than Node 18.

node -v
v18.19.0

Solar terminal minimum supported Node.js version is Node 18, but more recent versions will work as well.

Installing

  • clone this repo
  • npm install to install dependencies

Once all dependencies are installed, husky will setup Git hooks which will automatically execute build and testing on commit to make sure everything is working.

Running the App

After you have installed all dependencies, you may run the app. Running npm run dev will launch a development server, and watch all files. The port will be displayed in the terminal.

Tasks

Here's a list of available tasks:

  • npm run lint
    • runs linting with Eslint to verify code styles and formatting.
  • npm run dev
    • starts a dev server via Next.js.
  • npm run build
    • builds production build of the application.
  • npm run export Builds and exports static version of the application.
  • npm start
    • runs the production build of the application.
  • npm test
    • runs the testing.
  • npm run test:e2e
    • runs the E2E testing with Cypress.

About

ReactJS NextJS dashboard for solar farm monitoring


Languages

Language:TypeScript 55.7%Language:JavaScript 40.6%Language:CSS 3.6%