Skip to content

Daniyal117/Stock-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stock Management System

This project is a simple stock management system built with Django. It helps users manage stock data, view transactions, and get stock prices quickly using Redis caching. The application has a clear API structure and is easy to deploy with Docker.


Table of Contents

  1. Project Overview
  2. Features
  3. Installation
  4. Usage
  5. API Endpoints
  6. Caching with Redis
  7. Docker Setup
  8. Contributing
  9. License

Project Overview

This application allows users to:

  • Register and manage their accounts.
  • View stock information like prices and trading volume.
  • Buy and sell stocks.
  • See a history of their transactions.

It uses Redis to store frequently accessed data, making it faster to retrieve information.


Features

  • User registration and account management.
  • Adding and viewing stock information.
  • Keeping track of user transactions.
  • Fast data retrieval using Redis caching.
  • Documentation for APIs.
  • Easy deployment with Docker.

Installation

1. Clone the Repository

Use this command to clone the project:

git clone https://github.com/Daniyal117/Stock-Management-System.git
cd Stock-Management-System

2. For Windows:

python3 -m venv env
. env\scripts\activate 

3. For macOS/Linux:

python3 -m venv env
source env/bin/activate

4.pip install -r requirements.txt

pip install -r requirements.txt

5. Apply Migrations

python3 manage.py makemigrations
python3 manage.py migrate

6. Run the Server

python3 manage.py runserver

You can access the app at http://127.0.0.1:8000.

5. USAGE

API Documentation: Access the API documentation at http://127.0.0.1:8000/swagger/ to see available endpoints.

API Endpoints

Here are some important API endpoints:

Method Endpoint Description
POST /users/ Register a new user
GET /users/{username}/ Get user data
DELETE /users/{username}/ Delete a user
POST /stocks/ Add stock data
GET /stocks/ Get all stocks
POST /transactions/ Create a new transaction
GET /transactions/{username}/ Get all transactions for a user

Docker Setup:

To make it easier to deploy this project, we use Docker. Here’s how to set it up

Build the Docker Image

Run this command to build the Docker image:

docker build -t app .

Run the Docker Container

Use this command to start the application in a Docker container:

docker-compose up --build

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published