Open ahsan2882 opened 11 months ago
The README is a work in progress, it is open for updates. Feel free to submit a Pull Request, or I will find time to update in chunks.
Welcome to the Inventory Management System API! This project is an Express server built with TypeScript, serving as the backend for an inventory management system. It allows users to log in or sign up, view their inventory, update items, and customize the structure of their inventory.
Before you begin, ensure you have the following installed:
Clone the Repository:
git clone <repository_url>
cd <repository_name>
Install Dependencies:
npm install
Build TypeScript:
npm run build
Set Environment Variables:
.env
file in the root directory.Add your Firebase credentials and other necessary environment variables.
FIREBASE_API_KEY=your_api_key
FIREBASE_AUTH_DOMAIN=your_auth_domain
FIREBASE_PROJECT_ID=your_project_id
Start the Server:
npm start
The project follows a modular structure to enhance organization and scalability. Here is a brief overview:
plaintext
src/
|-- controllers/
|-- middleware/
|-- models/
|-- routes/
|-- index.ts
controllers: Contains the business logic for each route. middleware: Middleware functions used in the Express app. models: Defines data models for Firestore. routes: Handles the routing for different API endpoints. index.ts: Entry point of the application.
Endpoint | Description | Method |
---|---|---|
/api/login |
User login | POST |
/api/signup |
User signup | POST |
/api/inventory |
Get user's inventory | GET |
/api/update-item |
Update an inventory item | PUT |
/api/modify-structure |
Modify inventory structure | POST |
The API uses token-based authentication. Upon successful login, a token is provided and must be included in subsequent requests in the Authorization header.
The server connects to Firebase Firestore for data storage. Ensure your Firestore rules are appropriately configured to restrict access based on your requirements.
Contributions are welcome! Please follow the contribution guidelines.
This project is licensed under the MIT License.
Describe the bug Update the README for a better documentation of the project