Skip to content

ranim-ben-amara/DistroPackageManager

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DistroPackageManager

A comprehensive full-stack application for managing Linux distribution packages across web and mobile platforms.

πŸ“‹ Project Overview

DistroPackageManager is a multi-platform package management system consisting of:

  • Backend API: RESTful API server for package management
  • Web Frontend: Modern React-based user interface
  • Mobile App: Flutter-based mobile application

The application enables users to manage, track, and distribute packages across different Linux distributions with a unified interface.

πŸ› οΈ Tech Stack

Backend

  • Runtime: Node.js
  • Framework: Express.js
  • Database: MongoDB
  • Authentication: JWT (JSON Web Tokens)
  • Security: bcrypt for password hashing
  • Task Scheduling: node-cron
  • HTTP Client: axios

Frontend

  • Framework: React 18
  • Language: TypeScript
  • Build Tool: Vite
  • UI/Styling: CSS
  • Internationalization: Multi-language support (Arabic, English, French)

Mobile App

  • Framework: Flutter
  • Language: Dart
  • Authentication: Firebase
  • Platforms: Android, iOS, Linux, macOS, Windows, Web

πŸ“ Project Structure

DistroPackageManager/
β”œβ”€β”€ backend/                    # Node.js Express API server
β”‚   β”œβ”€β”€ controllers/           # Business logic
β”‚   β”‚   β”œβ”€β”€ BackEndController.js
β”‚   β”‚   β”œβ”€β”€ NotificationController.js
β”‚   β”‚   β”œβ”€β”€ PackageController.js
β”‚   β”‚   β”œβ”€β”€ RepositoryController.js
β”‚   β”‚   └── UserController.js
β”‚   β”œβ”€β”€ models/               # MongoDB schemas
β”‚   β”‚   β”œβ”€β”€ BackEndModel.js
β”‚   β”‚   β”œβ”€β”€ CounterModel.js
β”‚   β”‚   β”œβ”€β”€ NotificationModel.js
β”‚   β”‚   β”œβ”€β”€ PackageModel.js
β”‚   β”‚   β”œβ”€β”€ RepositoryModel.js
β”‚   β”‚   β”œβ”€β”€ SettingsModel.js
β”‚   β”‚   └── UserModel.js
β”‚   β”œβ”€β”€ routes/               # API route definitions
β”‚   β”‚   β”œβ”€β”€ BackEndRoutes.js
β”‚   β”‚   β”œβ”€β”€ NotificationRoutes.js
β”‚   β”‚   β”œβ”€β”€ PackageRoutes.js
β”‚   β”‚   β”œβ”€β”€ RepositoryRoutes.js
β”‚   β”‚   └── UserRoutes.js
β”‚   β”œβ”€β”€ server.js             # Express server entry point
β”‚   └── package.json          # Dependencies
β”‚
β”œβ”€β”€ frontend/                  # React TypeScript web application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/       # Reusable React components
β”‚   β”‚   β”‚   β”œβ”€β”€ linkInput/
β”‚   β”‚   β”‚   └── sidebar/
β”‚   β”‚   β”œβ”€β”€ pages/            # Page components
β”‚   β”‚   β”‚   β”œβ”€β”€ backend-list/
β”‚   β”‚   β”‚   β”œβ”€β”€ dashboard/
β”‚   β”‚   β”‚   β”œβ”€β”€ homepage/
β”‚   β”‚   β”‚   β”œβ”€β”€ notifications-list/
β”‚   β”‚   β”‚   β”œβ”€β”€ package-list/
β”‚   β”‚   β”‚   β”œβ”€β”€ repository-list/
β”‚   β”‚   β”‚   β”œβ”€β”€ settings/
β”‚   β”‚   β”‚   β”œβ”€β”€ shell/
β”‚   β”‚   β”‚   └── stats/
β”‚   β”‚   β”œβ”€β”€ translations/     # i18n files (AR, EN, FR)
β”‚   β”‚   β”œβ”€β”€ utils/            # Utility functions
β”‚   β”‚   β”œβ”€β”€ App.tsx           # Main app component
β”‚   β”‚   └── main.tsx          # Entry point
β”‚   β”œβ”€β”€ vite.config.ts        # Vite configuration
β”‚   β”œβ”€β”€ tsconfig.json         # TypeScript configuration
β”‚   └── package.json
β”‚
β”œβ”€β”€ mobileapp/                 # Flutter mobile application
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ app/              # App configuration
β”‚   β”‚   β”‚   β”œβ”€β”€ AppColors.dart
β”‚   β”‚   β”‚   β”œβ”€β”€ AppConsts.dart
β”‚   β”‚   β”‚   β”œβ”€β”€ modules/
β”‚   β”‚   β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”‚   └── widgets/
β”‚   β”‚   β”œβ”€β”€ firebase_options.dart
β”‚   β”‚   └── main.dart
β”‚   β”œβ”€β”€ android/              # Android-specific files
β”‚   β”œβ”€β”€ ios/                  # iOS-specific files
β”‚   β”œβ”€β”€ windows/              # Windows-specific files
β”‚   β”œβ”€β”€ macos/                # macOS-specific files
β”‚   β”œβ”€β”€ linux/                # Linux-specific files
β”‚   β”œβ”€β”€ web/                  # Web-specific files
β”‚   β”œβ”€β”€ pubspec.yaml          # Flutter dependencies
β”‚   └── analysis_options.yaml
β”‚
β”œβ”€β”€ docker-compose.yml         # Docker Compose configuration
β”œβ”€β”€ Dockerfile                 # Docker image definition
└── README.md                  # This file

πŸš€ Getting Started

Prerequisites

  • Node.js (v16 or higher)
  • npm or yarn
  • MongoDB (local or Atlas)
  • Flutter SDK (for mobile app)
  • Docker & Docker Compose (optional, for containerized setup)

Backend Setup

  1. Navigate to the backend directory:

    cd backend
  2. Install dependencies:

    npm install
  3. Create a .env file in the backend directory with your MongoDB connection string:

    DBURI=mongodb+srv://username:password@cluster.mongodb.net/DistroPackageManager?retryWrites=true&w=majority
    PORT=5001
    
  4. Start the development server:

    npm run dev

    The backend will run on http://localhost:5001

Frontend Setup

  1. Navigate to the frontend directory:

    cd frontend
  2. Install dependencies:

    npm install
  3. Start the development server:

    npm run dev

    The frontend will run on http://localhost:5173 (default Vite port)

Mobile App Setup

  1. Navigate to the mobile app directory:

    cd mobileapp
  2. Install Flutter dependencies:

    flutter pub get
  3. Run the app:

    flutter run

Docker Setup (Optional)

To run the entire stack with Docker Compose:

docker-compose up

This will start:

  • Backend API on http://localhost:5001
  • MongoDB on http://localhost:27017

πŸ“‹ Available Features

Backend API

  • User Management: Registration, login, authentication
  • Package Management: Create, read, update, delete packages
  • Repository Management: Manage distribution repositories
  • Notifications: System notifications for users
  • Settings: Application configuration
  • Backend Information: System metrics and health checks

Web Frontend

  • Dashboard: Overview and statistics
  • Package List: Browse and manage packages
  • Repository Management: Manage package repositories
  • Notifications: View system notifications
  • Backend List: Monitor backend instances
  • Settings: User preferences and app settings
  • Multi-language Support: Available in Arabic, English, and French

Mobile Application

  • Firebase Integration: Authentication and cloud services
  • Cross-platform: Native support for Android, iOS, and web
  • Responsive UI: Adaptive layouts for different screen sizes

πŸ” Security Features

  • JWT Authentication: Secure token-based authentication
  • Password Hashing: bcrypt for secure password storage
  • CORS Support: Cross-Origin Resource Sharing configured
  • Environment Variables: Sensitive data stored in .env files

🌍 Internationalization

The frontend supports multiple languages:

  • English (en)
  • Arabic (ar)
  • French (fr)

Translation files are located in frontend/src/translations/

πŸ“± Database Models

  • User: User accounts and authentication
  • Package: Package information and metadata
  • Repository: Distribution repositories
  • Notification: User notifications
  • Settings: Application settings
  • BackEnd: Backend instance information
  • Counter: Counters for tracking

πŸ§ͺ Testing

Currently, no automated tests are configured. You can add tests using:

  • Backend: Jest or Mocha
  • Frontend: Vitest or Jest
  • Mobile: Flutter testing framework

πŸ“ API Endpoints

The backend provides REST endpoints for:

  • /api/users - User management
  • /api/packages - Package operations
  • /api/repositories - Repository management
  • /api/notifications - Notification handling
  • /api/backend - Backend information
  • /api/settings - Settings management

πŸ› οΈ Development Scripts

Backend Scripts

npm run dev    # Start development server with nodemon
npm run test   # Run tests (not yet configured)

Frontend Scripts

npm run dev    # Start development server
npm run build  # Build for production
npm run preview # Preview production build
npm run lint   # Run ESLint

Mobile

flutter run        # Run on connected device
flutter build apk  # Build Android APK
flutter build ios  # Build iOS app
flutter build web  # Build web version

πŸ› Troubleshooting

MongoDB Connection Issues

  • Ensure MongoDB is running and accessible
  • Verify the connection string in your .env file
  • Check network connectivity to MongoDB Atlas (if using cloud)

Port Already in Use

  • Backend default port: 5001
  • Frontend default port: 5173
  • MongoDB default port: 27017

Change ports in respective configuration files if needed.

CORS Errors

  • Ensure CORS is properly configured in the backend
  • Check that frontend and backend URLs match in backend configuration

πŸ“š Learning Resources

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘₯ Support

For issues and questions, please open an issue in the repository or contact the development team.

About

A comprehensive full-stack application for managing Linux distribution packages across web and mobile platforms.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages