The Nexforce case study involves developing a full-stack application to manage an inventory system. This application includes a backend built with Node.js and Express, a frontend developed in React.js, and a Python script for data analysis. This project aims to demonstrate my ability to integrate multiple technologies and follow agile development principles.
The project is divided into three main components:
- Backend: Node.js server with Express.
- Frontend: React.js application.
- Python Script: For analyzing inventory data.
- Node.js: Runtime environment for server-side code.
- Express.js: Web framework for building APIs.
- PostgreSQL: Database system.
- Sequelize: ORM for database interactions.
- Nodemon: Tool for auto-reloading during development.
- React.js: JavaScript library for building user interfaces.
- Vite: Build tool and development server.
- Axios: HTTP client for making API requests.
- CSS Modules: For component-scoped styles.
- Python: Programming language for data analysis.
Ensure you have the following installed:
- Node.js (v16 or later)
- Python (v3.8 or later)
- PostgreSQL (v16 or later)
-
Navigate to the backend directory:
cd backend
-
Install dependencies:
npm install
-
Set up environment variables: Copy the
.env.example
file to a new file named.env
in thebackend
directory and fill in your environment variables:cp .env.example .env
Edit the
.env
file with your actual values:PORT=3000 POSTGRES_USER=your_database_user POSTGRES_PASSWORD=your_database_password POSTGRES_DB=your_database_name POSTGRES_HOST=your_database_host POSTGRES_PORT=your_database_port
-
Start the server:
npm run dev
-
Run migrations and seeders:
npx sequelize-cli db:migrate npx sequelize-cli db:seed:all
-
Navigate to the frontend directory:
cd frontend
-
Install dependencies:
npm install
-
Set up environment variables: Copy the
.env.example
file to a new file named.env
in thefrontend
directory and edit it if needed:cp .env.example .env
-
Start the development server:
npm run dev
-
Open your browser and go to view the application.
-
Navigate to the Python script directory:
cd scripts
-
Run the script:
python analyze_inventory.py --help usage: inventory_analysis.py [-h] --type {lowest_stock,highest_stock} [--num_records NUM_RECORDS] Analyze product inventory. options: -h, --help show this help message and exit --type {lowest_stock,highest_stock} Type of analysis: 'lowest_stock' for products with the lowest stock, 'highest_stock' for products with the highest stock --num_records NUM_RECORDS Number of records to include in the report
- GET /api/products: Retrieve a list of products.
- POST /api/products: Create a new product.
- PUT /api/products/:id: Update an existing product.
- DELETE /api/products/:id: Delete a product.
- GET /api/categories: Retrieve a list of product categories.
- Home: Displays the list of products.
- CreatePage: Form to add a new product.
- UpdatePage: Form to edit an existing product.
- Category: View products by category.
- Data Analysis: Analyzes inventory data to identify products with the lowest and highest stock.
- Report Generation: Outputs results in CSV.
I used the Trello for managing project tasks, organizing sprints, and tracking progress: link.