Store Management System is a web application that allows store owners to manage their stores and customers to search for stores.
To run this project locally, follow these steps:
-
Clone the repository to your local machine:
git clone https://github.com/htnphu/StoreManagementSystem.git
-
Install the project dependencies (if missing):
npm install
-
Update database config at db.config.js: Open the
db.config.js
file and make the necessary changes to the database configuration, including thedatabase
,username
, andpassword
fields. For example:// db.config.js const dbConfig = { host: 'your-host', username: 'your-database-username', password: 'your-database-password', database: 'your-database-name', dialect: 'postgres', operatorsAliases: false, pool: { max: 5, min: 0, acquire: 30000, idle: 10000, }, };
-
Start server:
yarn start
-
Start in the development environemtn:
yarn dev
-
Register as a Store Owner: Store owners can register by sending a POST request to
/api/owners/register
. The request body should include details like full name, phone number, email, etc.Example JSON request body:
{ "fullName": "John Anderson", "phoneNumber": "0123456789", "email": "johnanderson@examplegmail.com", "dateOfBirth": "1997-08-09", "avatar": "johnanderson.jpg", "gender": "Male" }
-
Register a Store: After registration, store owners can send a POST request to
/api/stores/register
to create a new store.Example JSON request body:
{ "name": "Toslie Dress", "logo": "store_logo.jpg", "address": "4087 Geraldine Lane, Pontotoc City, Texas State, United States", "phoneNumber": "333-444-5555", "email": "tosliedress@info.com", "ownerId": "{existed owner-id}" }
-
Find Stores by Owner ID: Users can find stores by sending a GET request to
/api/stores/{ownerId}
, where{ownerId}
is the ID of the store owner.