1- # Apex Grid
1+ # 🚀 Apex Grid
22
3- ## Live app
3+ ## 🌐 Live app
44
55- Production (deployed): < https://apex-grid-transformer-tracker.vercel.app/ >
6- - Want to run everything locally? Use the below instructions
6+ - Want to run everything locally? Check the local branch
77
8- Next.js App Router frontend with a Spring Boot backend (preferred). Legacy Next.js API + Prisma/SQLite remains available for local only.
9-
10- - Frontend: Next.js (App Router), React, Tailwind
11- - Backend: Spring Boot (Web, Data JPA, Security), postgres
12-
13- ## Prerequisites
14-
15- - Frontend
16- - Node.js 18+ (20+ recommended)
17- - pnpm (preferred). One-time install: ` npm i -g pnpm `
18- - Backend (Spring Boot)
19- - Java 21
20- - Maven 3.9+
21-
22- ## Run locally (Spring backend + Next.js frontend)
23-
24- Make sure the database is running and accessible. Schema is given below
25-
26- ``` sql
27-
28- create table public .inspections (
29- id text not null ,
30- transformer_id text not null ,
31- inspectionnumber text not null ,
32- inspecteddate text null ,
33- maintainancedate text null ,
34- branch text null ,
35- status text null ,
36- imageurl text null ,
37- weather text null ,
38- lastanalysisweather text null ,
39- uploadedby text null ,
40- imageuploadedby text null ,
41- imageuploadedat timestamp with time zone null ,
42- favourite boolean not null default false,
43- boundingboxes text null ,
44- faulttypes text null ,
45- faulttypehistory text null ,
46- boundingboxhistory text null ,
47- annotatedby text null ,
48- annotatedbyhistory text null ,
49- severity text null ,
50- timestamphistory text null ,
51- timestamp timestamp with time zone null ,
52- severityhistory text null ,
53- constraint inspections_pkey primary key (id),
54- constraint inspections_inspectionnumber_key unique (inspectionnumber),
55- constraint fk_inspections_transformer foreign KEY (transformer_id) references transformers (id) on delete CASCADE
56- )
57-
58- create index IF not exists idx_inspections_transformer_id on public .inspections using btree (transformer_id) TABLESPACE pg_default;
59-
60- create table public .transformers (
61- id text not null ,
62- region text null ,
63- transformernumber text not null ,
64- polenumber text null ,
65- type text null ,
66- location text null ,
67- sunnyimage text null ,
68- cloudyimage text null ,
69- windyimage text null ,
70- uploadedby text null ,
71- sunnyimageuploadedby text null ,
72- cloudyimageuploadedby text null ,
73- windyimageuploadedby text null ,
74- sunnyimageuploadedat timestamp with time zone null ,
75- cloudyimageuploadedat timestamp with time zone null ,
76- windyimageuploadedat timestamp with time zone null ,
77- favourite boolean not null default false,
78- constraint transformers_pkey primary key (id),
79- constraint transformers_transformernumber_key unique (transformernumber)
80- )
81-
82- CREATE TABLE public .users (
83- id CHARACTER VARYING NOT NULL ,
84- username CHARACTER VARYING NOT NULL UNIQUE,
85- passwordhash TEXT NOT NULL ,
86- createdat TIMESTAMP WITH TIME ZONE NOT NULL ,
87- image TEXT ,
88- CONSTRAINT users_pkey PRIMARY KEY (id)
89- );
90-
91- CREATE TABLE public .ai_model_parameters (
92- param_key text not null ,
93- param_value double precision not null ,
94- updated_at timestamp with time zone not null default now(),
95- constraint ai_model_parameters_pkey primary key (param_key)
96- ) TABLESPACE pg_default;
97-
98- CREATE TABLE public .ai_tuning_feedback (
99- id uuid not null default gen_random_uuid (),
100- inspection_id text not null ,
101- ai_box_count integer not null ,
102- user_box_count integer not null ,
103- box_diff integer not null ,
104- created_at timestamp with time zone not null default now(),
105- previous_snapshot text null ,
106- final_snapshot text null ,
107- previous_faults text null ,
108- final_faults text null ,
109- previous_annotated text null ,
110- final_annotated text null ,
111- notes text null ,
112- constraint ai_tuning_feedback_pkey primary key (id)
113- ) TABLESPACE pg_default;
114-
115- ```
116-
117- ### Recommended method: Use Docker for the backend
118-
119- 1 . Create a ` .env ` file in the ` backend/ ` directory based on ` .env.example ` with your DB credentials.
120-
121- 2 . Build and run the Docker container
122-
123- ``` powershell
124- # from the project root
125- cd backend
126- docker pull warrensjk/transformer-tracker:latest
127- docker run -d --env-file .env -p 8080:8080 --name transformer-tracker warrensjk/transformer-tracker:latest
128- ```
129-
130- ### Alternative method: Run the backend directly with Maven
131-
132- 1 . Install python dependencies for the AI model
133-
134- ``` powershell
135- # from the project root
136- cd backend/AI
137- pip install -r requirements.txt
138- ```
139-
140- 2 . Start the backend (port 8080)
141-
142- ``` powershell
143- # from the project root
144- cd backend
145- mvn clean install
146-
147- $env:DB_URL="<your-database-url>"
148- $env:DB_USERNAME="<your-database-username>"
149- $env:DB_PASSWORD="<your-database-password>"
150-
151- mvn spring-boot:run
152-
153- ```
154-
155- - API base: < http://localhost:8080 >
156-
157- ### Start the frontend
158-
159- 1 . Start the frontend (port 3000)
160-
161- ``` powershell
162- # from the project root (new terminal)
163- cd frontend
164- $env:DB_URL="<backend-url>" # optional:localhost:8080 is default
165- pnpm install
166- pnpm run dev
167- ```
168-
169- 2 . Open the app at < http://localhost:3000 >
170-
171- ## Auth
8+ ## 🔐 Auth
1729
17310- Log in with ` user1 ` ..` user5 ` using the same value as the password (e.g., ` user3 ` /` user3 ` ).
17411
175- ## Features
12+ ## ✨ Features
17613
17714- Transformers and Inspections CRUD
17815- Image uploads stored as base64 in the DB; baseline images can be added/removed
@@ -185,8 +22,11 @@ pnpm run dev
18522 - Adding Transformers: client-side check to ensure ` transformerNumber ` is unique
18623- Cascade delete: deleting a Transformer removes its Inspections
18724- AI model can be used to analyze thermal images of transformers (see ` backend/AI/README.md ` for details)
25+ - Persistance of AI annotated images
26+ - Users also may edit annotations or add their own annotations
27+ - Export of metadata and images as a ZIP file
18828
189- ## Project structure (high level)
29+ ## 🗂️ Project structure (high level)
19030
19131- ` frontend/ ` — Next.js frontend
19232 - ` app/ ` — App Router pages
@@ -196,32 +36,25 @@ pnpm run dev
19636 - ` prisma/ ` — Prisma schema, migrations, and the SQLite DB file
19737 - ` types/ ` — shared TypeScript types
19838- ` backend/ ` — Spring Boot app (controllers, entities, repos, config)
39+ - ` src/main/java/com/apexgrid/transformertracker/ ` — Java source code
40+ - ` src/main/resources/ ` — application config, including ` application.yml `
41+ - ` AI/ ` — AI model and related files
19942
200- ## Project Description
43+ ## 📝 Project Description
20144
20245- The project has 2 main pages: transformers and inspections.
20346- The transformers page allows users to create, read, update, and delete (CRUD) transformer records.
204- ![ Screenshot of transformer page] ( transformer_page .png)
47+ ![ Screenshot of transformer page] ( transformers_page .png)
20548- The inspections page allows users to view and manage inspection records.
206- ![ Screenshot of inspections page] ( inspection_page .png)
49+ ![ Screenshot of inspections page] ( inspections_page .png)
20750- Details pertaining to a particular transformer can be viewed in a user friendly interface.
208- ![ Screenshot of transformer detail] ( transformer_detail.png )
51+ ![ Screenshot of inspection details page] ( inspection_details.png )
52+ - Details pertaining to a particular inspection can be viewed in a user friendly interface.
53+ ![ Screenshot of transformer detail] ( transformer_details.png )
20954- An AI model can be used to analyze and generate insights from the thermal images of transformers.
210- ![ Screenshot of AI inference page] ( ai_inference.png )
211-
212- ## Troubleshooting
213-
214- - Windows PowerShell: to start with a custom backend URL temporarily, run
215-
216- ` $env:NEXT_PUBLIC_BACKEND_URL = "http://localhost:8080"; pnpm dev `
217-
218- Or put the value in ` .env.local ` to make it persistent.
219-
220- - Backend port in use (8080): stop the process using the port, or temporarily change ` server.port ` in ` backend/src/main/resources/application.yml ` .
221- - H2 console won’t connect: verify JDBC URL is ` jdbc:h2:file:./db/transformerdb ` , user ` sa ` , and empty password.
222- - DB file not created: ensure the backend is running and you’ve performed at least one API action (the file appears on first write).
55+ ![ Screenshot of AI inference page] ( ai_inference.png )
22356
224- ## For Improvements
57+ ## 🛠️ For Improvements
22558
22659- Feel free to open issues or submit PRs for any bugs, improvements, or new features.
22760- For your own use, you are free to customize the project as needed.
0 commit comments