Skip to content

samuelfsilva/inventory-management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Inventory Management

License Last Commit

A modern full-stack inventory management system built with TypeScript, Express, SQL Server, and Next.js.

Inventory Management System

🚀 Features

  • ✅ Product management with real-time inventory tracking
  • ✅ Category organization system
  • ✅ User authentication and role-based access control
  • ✅ Responsive Material UI interface
  • ✅ Complete API documentation with Swagger
  • ✅ Containerized with Docker for easy deployment

🛠️ Tech Stack

Backend

  • Framework: Node.js with Express
  • Language: TypeScript
  • ORM: TypeORM
  • Database: SQL Server
  • Documentation: Swagger
  • Testing: Vitest

Frontend

  • Framework: Next.js 15
  • UI Library: Material UI 6
  • State Management: React Hooks
  • API Client: Axios

DevOps

  • Containerization: Docker & Docker Compose
  • CI/CD: GitHub Actions
  • Linting: ESLint
  • Development: Nodemon, TypeScript

📋 Prerequisites

🔧 Installation

  1. Clone the repository
git clone https://github.com/samuelfsilva/inventory-management.git
cd inventory-management
  1. Set up environment variables
cp .env.example .env
  1. Start with Docker
docker-compose up -d
  1. Access the application

💻 Development

Backend

cd backend
npm install
npm run dev         # Start development server
npm run swagger     # Generate API docs
npm test           # Run tests

Frontend

cd frontend
npm install
npm run dev        # Start development server
npm run build      # Build for production

Database Migrations

# Generate migration
npm run homologation:migrate:generate ./src/database/migrations/MigrationName

# Apply migrations
npm run homologation:migrate

# Revert migrations
npm run homologation:migrate:revert

📊 Project Structure

inventory-management/
├── backend/            # Express API with TypeORM
│   ├── src/
│   │   ├── database/      # DB connections & migrations
│   │   ├── entities/      # TypeORM entities
│   │   ├── middleware/    # Middleware
│   │   ├── migration/     # TypeORM migrations
│   │   ├── routes/        # API routes
│   │   ├── schema/        # Joi validation schemas
│   │   ├── test/          # Unit tests
│   │   ├── index.ts       # Entry point
│   │   ├── server.ts      # Express server
│   │   ├── swagger.ts     # Swagger setup
│   │   └── vite.config.ts # Vite configuration
├── database/           # SQL Server setup
├── frontend/           # Next.js application
│   ├── src/
│   │   ├── app/        # Main
│   │   ├── components/ # UI components
│   │   ├── pages/      # Pages
│   │   ├── services/   # API services
│   │   └── utils/      # Utilities
├── .dockerignore
├── .env.example
├── .gitignore
├── LICENSE
├── README.md
└── docker-compose.yml

⚙️ Environment Variables

# Frontend
NEXT_PUBLIC_API_URL=http://localhost:3333

# Backend
API_PORT=3333
FRONTEND_URLS=http://localhost:3000

# Database
DB_HOST=sqlserver
DB_PORT=1433
DB_USERNAME=sa
DB_PASSWORD=YourStrongPassword
DB_DATABASE=inventory

# Docker
DOCKER_FRONTEND_PORT=3000

📌 API Endpoints

Method Endpoint Description
GET /category Get all categories
GET /category/:id Get category by ID
POST /category Create a category
PUT /category/:id Update a category
DELETE /category/:id Delete a category
GET /product Get all products
GET /product/:id Get product by ID
GET /product/active Get all active products
POST /product Create a product
PUT /product/:id Update a product
DELETE /product/:id Delete a product
GET /user Get all users
GET /user/:id Get user by ID
GET /user/firstName/:firstName Get user by first name
GET /user/active Get all active users
POST /user Create a user
PUT /user/:id Update a user
DELETE /user/:id Delete a user
... ... ...

Full API documentation is available at /doc when running the application.

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the ISC License - see the LICENSE file for details.

🙏 Acknowledgements

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages