A multi-tenant SaaS application for businesses to track, manage, and report on fixed assets with depreciation calculations and financial projections.
- Backend: NestJS (Node.js, TypeScript)
- Frontend: Next.js (React, TypeScript)
- Database: PostgreSQL
- Authentication: JWT-based auth
- Styling: Tailwind CSS (Frontend)
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
- Node.js 18+ and npm/yarn
- PostgreSQL 12+
- Clone the repository:
git clone <repository-url>
cd fixedassets- Install dependencies:
npm install- Backend (.env):
cp backend/.env.example backend/.env
# Edit backend/.env with your database credentials- Frontend (.env.local):
cp frontend/.env.example frontend/.env.local
# Usually no changes needed for local development- Create PostgreSQL database:
createdb fixedassets_dev- Run migrations:
npm run db:migrate- (Optional) Seed database:
npm run db:seednpm run dev- Backend: http://localhost:3000
- Frontend: http://localhost:3001
Backend:
npm run backend:devFrontend:
npm run frontend:devnpm run dev- Run both backend and frontend in development modenpm run build- Build both backend and frontend for productionnpm run lint- Lint code in both projectsnpm run test- Run backend testsnpm run db:migrate- Run database migrationsnpm run db:seed- Seed the database
npm run backend:dev- Start backend in watch modenpm run backend:build- Build backendnpm run backend:start- Start built backendnpm run backend:test- Run testsnpm run backend:lint- Lint code
npm run frontend:dev- Start frontend dev servernpm run frontend:build- Build frontend for productionnpm run frontend:start- Start production servernpm run frontend:lint- Lint code
- Tenant isolation at database level
- Role-Based Access Control (RBAC) - Admin, Manager, Viewer
- User invitation system via email
- Email/password authentication with JWT tokens
- Password reset via email
- Session management with access & refresh tokens
- CRUD operations for assets
- Asset categories and departments
- Bulk import/export (CSV/Excel)
- Asset search and filtering
- File attachments support
- Straight-Line depreciation method
- Declining Balance method
- Units of Production method
- Asset revaluation support
- Depreciation schedule generation
- Summary cards (total assets, values, depreciation)
- Charts and visualizations
- Department and category breakdowns
- Customizable filters
- Asset Register Report
- Depreciation Schedule Report
- Asset Valuation Report
- Disposal Register
- Export to PDF, Excel, CSV
- Bulk asset import with validation
- Bulk export capabilities
- Backup/restore functionality
- Custom fields framework
- 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
- 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
- Password hashing with bcryptjs
- SQL injection prevention (ORM)
- CSRF protection
- XSS protection
- HTTPS enforcement in production
- API rate limiting
- Audit logging
- Code Style: Run
npm run lintbefore committing - Type Safety: Always provide TypeScript types
- Testing: Write tests for critical functionality
- Documentation: Update comments for complex logic
- Database Changes: Create migrations for schema changes
Update production environment variables:
- Backend:
NODE_ENV=production, database credentials, JWT secrets - Frontend:
NEXT_PUBLIC_API_URLpointing to production backend
npm run buildBackend:
npm run backend:startFrontend:
npm run frontend:start- Verify PostgreSQL is running
- Check DB credentials in
.env - Ensure database exists
- Change
APP_PORTin backend.env - Change port in
frontend/next.config.jsor use-pflag
- Run
npm installin the root directory - Check import paths match tsconfig aliases
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
ISC
For issues or questions, please create an issue in the repository.