8000 GitHub - colrium/fixedassets: A multi-tenant SaaS application for businesses to track, manage, and report on fixed assets with depreciation calculations and financial projections. · GitHub
[go: up one dir, main page]

Skip to content

About

A multi-tenant SaaS application for businesses to track, manage, and report on fixed assets with depreciation calculations and financial projections.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Fixed Assets Management System

A multi-tenant SaaS application for businesses to track, manage, and report on fixed assets with depreciation calculations and financial projections.

Tech Stack

  • Backend: NestJS (Node.js, TypeScript)
  • Frontend: Next.js (React, TypeScript)
  • Database: PostgreSQL
  • Authentication: JWT-based auth
  • Styling: Tailwind CSS (Frontend)

Project Structure

fixedassets/
├── backend/                 # NestJS API Server
│   ├── src/
│   │   ├── app.module.ts
│   │   ├── app.controller.ts
│   │   ├── app.service.ts
│   │   ├── config/          # Configuration files
│   │   ├── modules/         # Feature modules
│   │   └── common/          # Shared utilities, guards, interceptors
│   ├── package.json
│   └── tsconfig.json
│
├── frontend/                # Next.js Web Application
│   ├── src/
│   │   ├── app/            # Next.js App Router
│   │   ├── components/     # React components
│   │   ├── hooks/          # Custom hooks
│   │   ├── services/       # API clients
│   │   ├── store/          # Zustand stores
│   │   ├── types/          # TypeScript types
│   │   └── utils/          # Utility functions
│   ├── package.json
│   └── tsconfig.json
│
├── package.json             # Monorepo root
└── README.md

Getting Started

Prerequisites

  • Node.js 18+ and npm/yarn
  • PostgreSQL 12+

Installation

  1. Clone the repository:
git clone <repository-url>
cd fixedassets
  1. Install dependencies:
npm install

Environment Setup

  1. Backend (.env):
cp backend/.env.example backend/.env
# Edit backend/.env with your database credentials
  1. Frontend (.env.local):
cp frontend/.env.example frontend/.env.local
# Usually no changes needed for local development

Database Setup

  1. Create PostgreSQL database:
createdb fixedassets_dev
  1. Run migrations:
npm run db:migrate
  1. (Optional) Seed database:
npm run db:seed

Running Locally

Option 1: Run both services together

npm run dev

Option 2: Run services separately

Backend:

npm run backend:dev

Frontend:

npm run frontend:dev

Available Scripts

Root Scripts

  • npm run dev - Run both backend and frontend in development mode
  • npm run build - Build both backend and frontend for production
  • npm run lint - Lint code in both projects
  • npm run test - Run backend tests
  • npm run db:migrate - Run database migrations
  • npm run db:seed - Seed the database

Backend Scripts

  • npm run backend:dev - Start backend in watch mode
  • npm run backend:build - Build backend
  • npm run backend:start - Start built backend
  • npm run backend:test - Run tests
  • npm run backend:lint - Lint code

Frontend Scripts

  • npm run frontend:dev - Start frontend dev server
  • npm run frontend:build - Build frontend for production
  • npm run frontend:start - Start production server
  • npm run frontend:lint - Lint code

Core Features (MVP)

Multi-Tenancy & Access Control

  • Tenant isolation at database level
  • Role-Based Access Control (RBAC) - Admin, Manager, Viewer
  • User invitation system via email

Authentication & Authorization

  • Email/password authentication with JWT tokens
  • Password reset via email
  • Session management with access & refresh tokens

Asset Management

  • CRUD operations for assets
  • Asset categories and departments
  • Bulk import/export (CSV/Excel)
  • Asset search and filtering
  • File attachments support

Depreciation Engine

  • Straight-Line depreciation method
  • Declining Balance method
  • Units of Production method
  • Asset revaluation support
  • Depreciation schedule generation

Dashboard & Analytics

  • Summary cards (total assets, values, depreciation)
  • Charts and visualizations
  • Department and category breakdowns
  • Customizable filters

Reporting System

  • Asset Register Report
  • Depreciation Schedule Report
  • Asset Valuation Report
  • Disposal Register
  • Export to PDF, Excel, CSV

Data Management

  • Bulk asset import with validation
  • Bulk export capabilities
  • Backup/restore functionality
  • Custom fields framework

Architecture Notes

Backend (NestJS)

  • Modular architecture with feature modules
  • TypeORM for database management
  • JWT authentication with Passport
  • Global validation pipes
  • Custom decorators and guards
  • Database migrations with TypeORM CLI

Frontend (Next.js)

  • App Router for file-based routing
  • Zustand for state management
  • Axios for API calls with interceptors
  • React Hook Form for form handling
  • Tailwind CSS for styling
  • TypeScript for type safety

Security Features

  • Password hashing with bcryptjs
  • SQL injection prevention (ORM)
  • CSRF protection
  • XSS protection
  • HTTPS enforcement in production
  • API rate limiting
  • Audit logging

Development Guidelines

  1. Code Style: Run npm run lint before committing
  2. Type Safety: Always provide TypeScript types
  3. Testing: Write tests for critical functionality
  4. Documentation: Update comments for complex logic
  5. Database Changes: Create migrations for schema changes

Deployment

Environment Variables

Update production environment variables:

  • Backend: NODE_ENV=production, database credentials, JWT secrets
  • Frontend: NEXT_PUBLIC_API_URL pointing to production backend

Building for Production

npm run build

Running in Production

Backend:

npm run backend:start

Frontend:

npm run frontend:start

Troubleshooting

Database connection issues

  • Verify PostgreSQL is running
  • Check DB credentials in .env
  • Ensure database exists

Port already in use

  • Change APP_PORT in backend .env
  • Change port in frontend/next.config.js or use -p flag

Module not found errors

  • Run npm install in the root directory
  • Check import paths match tsconfig aliases

Contributing

  1. Create a feature branch
  2. Make your changes
  3. Run tests and linting
  4. Submit a pull request

License

ISC

Support

For issues or questions, please create an issue in the repository.

About

A multi-tenant SaaS application for businesses to track, manage, and report on fixed assets with depreciation calculations and financial projections.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0