How akumaaaaaa/fe-sistem-informasi-capex works
Project type and purpose
• This is a full-stack CAPEX Management System, albeit this repo contains only the React/Vite front-end.
• Purpose: Provide a web-based interface for users (admins, karyawan) to log in, perform CRUD on CAPEX records, manage users/accounts, and export reports to PDF.
File structure
• Top-level config files:
• .eslintrc.cjs, vite.config.js – front-end linting & build config
• package.json / package-lock.json – npm dependencies & scripts
• Public entrypoint: index.html
• Source code under src/:
• main.jsx – React app bootstrap (Vite)
• App.jsx – root component & router container
• assets/ – static images/fonts (probably empty here)
• components/ – all UI components (dashboards, modals, forms, sidebar, etc.) each with its CSS
• index.css – global styles
README for additional insights
• Features require authentication, role-based CRUD, PDF export
• Figma link for use-case & wireframes
a. Main components:
• Client (Browser) running the React SPA
• Front-end App (React/Vite)
• API Server (Node.js + Express)
• Database (MongoDB)
• External Tools/Services: Figma (design), Postman (API testing), PDF export library or microservice
b. Relationships & interactions:
1. User interacts with React SPA in browser.
2. SPA makes REST API calls (HTTPS) to Express endpoints for auth, CAPEX data, user management.
3. API Server reads/writes to MongoDB.
4. PDF export: front-end or back-end invokes PDF generation library or external service, returns file.
c. Architectural patterns & design principles:
• Single Page Application (SPA) pattern for front-end.
• MVC-style layering in Node/Express (controllers for routes, services for business logic, models for data).
• Separation of concerns: UI vs API vs data store.
• Role-based access control enforced at API layer.
d. Key technologies/frameworks:
• Front-end: React, Vite, JSX, CSS modules (per component)
• API: Node.js, Express
• Database: MongoDB (likely via Mongoose)
• Auth: JWT or session cookies
• PDF Export: jsPDF or server-side library
Detailed capture of essential architectural elements
• Major React components (e.g., AdminDashboard, KaryawanDashboard, Sidebar, CRUD modals) grouped under “React Application.”
• On the API side, show routes for /auth, /capex, /users, /summaries.
• Session or token flow: login → token issuance → protected API calls.
• Distinguish data flows:
1. User logs in → POST /auth/login → token returned
2. User fetches CAPEX list → GET /capex → JSON payload
3. User triggers PDF export → GET /capex/export → PDF file