Coder Social home page Coder Social logo

uni_store's Introduction

Automated University Store System

This is an Automated University Store System built with Node.js, Express, and PostgreSQL. The system includes user management, store management, order processing, and reporting functionalities.

Table of Contents

Features

User Management

  • Registration: Users can register with a username, password, email, and role (student, staff, admin).
  • Login: Users can log in with a username and password.
  • Password Recovery: Users can recover their password via email.

Store Management

  • Product Catalog: View all products with details like name, description, price, and quantity.
  • Inventory Management: Manage product inventory and check product quantities.

Order Processing

  • Order Creation: Users can place orders for products.
  • Order Confirmation: Users receive order confirmation notifications.

Reporting and Analytics

  • Sales Reports: Generate sales reports by date with total sales.
  • Inventory Reports: Generate inventory reports for product quantities.

Installation

  1. Clone the repository:
    git clone https://github.com/yourusername/university-store.git
    cd university-store
    Sure, here is a README file for the Automated University Store System application:
# Automated University Store System

This is an Automated University Store System built with Node.js, Express, and PostgreSQL. The system includes user management, store management, order processing, and reporting functionalities.

## Table of Contents

- [Features](#features)
- [Installation](#installation)
- [Database Setup](#database-setup)
- [Environment Variables](#environment-variables)
- [API Endpoints](#api-endpoints)
- [Running the Application](#running-the-application)
- [License](#license)

## Features

### User Management

- **Registration**: Users can register with a username, password, email, and role (student, staff, admin).
- **Login**: Users can log in with a username and password.
- **Password Recovery**: Users can recover their password via email.

### Store Management

- **Product Catalog**: View all products with details like name, description, price, and quantity.
- **Inventory Management**: Manage product inventory and check product quantities.

### Order Processing

- **Order Creation**: Users can place orders for products.
- **Order Confirmation**: Users receive order confirmation notifications.

### Reporting and Analytics

- **Sales Reports**: Generate sales reports by date with total sales.
- **Inventory Reports**: Generate inventory reports for product quantities.

## Installation

1. **Clone the repository**:
   ```bash
   git clone https://github.com/yourusername/university-store.git
   cd university-store
   ```
  1. Install dependencies:
    npm install

Database Setup

  1. Create the PostgreSQL database:

    CREATE DATABASE university_store;
    \c university_store
    
    CREATE TABLE users (
      id SERIAL PRIMARY KEY,
      username VARCHAR(255) NOT NULL,
      password VARCHAR(255) NOT NULL,
      email VARCHAR(255) NOT NULL,
      role VARCHAR(50) NOT NULL
    );
    
    CREATE TABLE products (
      id SERIAL PRIMARY KEY,
      name VARCHAR(255) NOT NULL,
      description TEXT,
      price FLOAT NOT NULL,
      quantity INTEGER NOT NULL
    );
    
    CREATE TABLE orders (
      id SERIAL PRIMARY KEY,
      user_id INTEGER REFERENCES users(id),
      product_id INTEGER REFERENCES products(id),
      quantity INTEGER NOT NULL,
      total FLOAT NOT NULL,
      order_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP
    );
    
    CREATE TABLE inventory (
      product_id INTEGER PRIMARY KEY REFERENCES products(id),
      quantity INTEGER NOT NULL
    );

Environment Variables

Create a .env file in the root directory and add the following environment variables:

DATABASE_URL=postgresql://username:password@localhost:5432/university_store
JWT_SECRET=your_jwt_secret_key

API Endpoints

User Management

  • Register: POST /users
    • Data: { "username": "string", "password": "string", "email": "string", "role": "string" }
  • Login: POST /login
    • Data: { "username": "string", "password": "string" }
  • Password Recovery: POST /password-recovery
    • Data: { "email": "string" }

Store Management

  • Get Products: GET /products
  • Get Inventory: GET /inventory

Order Processing

  • Create Order: POST /orders
    • Data: { "user_id": "integer", "product_id": "integer", "quantity": "integer", "total": "float" }

Reporting and Analytics

  • Get Sales Reports: GET /sales-reports
  • Get Inventory Reports: GET /inventory-reports

Running the Application

  1. Start the application:
    npm run dev

The server will start on port 3000 by default. You can change the port by setting the PORT environment variable in the .env file.

License

This project is licensed under the MIT License. See the LICENSE file for more details.


This README file includes a detailed description of the project, its features, installation steps, database setup instructions, API endpoints, and how to run the application. Adjust the GitHub repository link and other specific details as needed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.