Skip to content

Jaden38/LibMa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

147 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LibMa

Library management tool

Project Structure

/
├── frontend/     # Next.js frontend application
└── backend/      # Flask backend application

Backend Setup

  1. Navigate to backend directory:
cd backend
  1. Install backend dependencies:
pip install -r requirements.txt
  1. Configure environment variables: Create a .env file in the backend directory with the following structure:
MYSQL_USER=your_username
MYSQL_PASSWORD=your_password
MYSQL_HOST=localhost
MYSQL_DATABASE=library_db
MYSQL_PORT=3306
FLASK_DEBUG=1
FLASK_PORT=5000

For example:

MYSQL_USER=root
MYSQL_PASSWORD=password123
MYSQL_HOST=localhost
MYSQL_DATABASE=library_db
MYSQL_PORT=3306
FLASK_DEBUG=1
FLASK_PORT=5000
  1. Initialize the database (optional - if you want to create fresh tables):
flask init-db
  1. Run the backend application:
python run.py

The backend API will be available at http://localhost:5000

To check database status:

flask db-status

Frontend Setup

  1. Navigate to frontend directory:
cd frontend
  1. Install frontend dependencies:
npm install
  1. Run the development server:
npm run dev

The frontend application will be available at http://localhost:3000

Development

To work on the full application, you'll need to run both the frontend and backend servers:

  1. Terminal 1 - Backend:
cd backend
python run.py
  1. Terminal 2 - Frontend:
cd frontend
npm run dev

Requirements

Backend

  • Python 3.8+
  • MySQL installed and running
  • Required Python packages listed in backend/requirements.txt

Frontend

  • Node.js 18+
  • npm or yarn
  • Required npm packages listed in frontend/package.json

Environment Variables

Backend Variables

  • MYSQL_USER: MySQL username
  • MYSQL_PASSWORD: MySQL password
  • MYSQL_HOST: MySQL host address
  • MYSQL_PORT: MySQL port (default: 3306)
  • MYSQL_DATABASE: Database name
  • FLASK_DEBUG: Debug mode (1 for development, 0 for production)
  • FLASK_PORT: Port for Flask application (default: 5000)

Note

Make sure you have MySQL installed and running on your machine before starting the backend application.

About

Library management tool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •