Stock is an inventory control and management system developed with a separate Backend and Frontend architecture. The application allows the management of products, users, stock movements (inputs and outputs) and access authentication.
- Framework: Python with FastAPI.
- Database: SQLite (
db.sqlite3/stock.sql) via SQLAlchemy / ORM. - Data Validation: Pydantic (Schemas).
- Authentication: JWT (JSON Web Tokens) and Passlib for password hashing.
- Framework: Next.js (React) with App Router.
- Language: TypeScript.
- Styling: Tailwind CSS (
globals.css/ PostCSS). - Route Guard: Client-side Route Guards (
authGuard.tsx).
- Python (v3.10 or higher)
- Node.js (v18 or higher) and npm / yarn
-
Navigate to the backend folder:
cd Stock/backend -
Create and activate a virtual environment (optional, but recommended):
python -m venv venv venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run the migrations or create the database (if you do not use pre-existing SQLite):
python app/database/create_db.py
-
Start the FastAPI server:
uvicorn main:app --reload
The API will be accessible at
http://localhost:8000and the Swagger documentation athttp://localhost:8000/docs.
-
Navigate to the frontend folder in another terminal:
cd Stock/frontend -
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Access the application in the browser at
http://localhost:3000.