8000 GitHub - xbyit/UploadX
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

xbyit/UploadX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

# File and Post Management API

This is a Flask-based API that allows users to manage file uploads, and handle user authentication and authorization. The application includes features such as user registration, login, and file/post management.

## Features

- **User Registration and Login**: Users can register, log in, and log out. Passwords are hashed for security.
- **Role-Based Access Control (RBAC)**: Admins have special privileges, while regular users can perform limited actions.
- **File Upload**: Users can upload files, and all files are stored in an SQLite database.
- **Post Management**: Users can create, edit, and delete posts.

## Installation

1. Clone the repository:

   ```bash
   git clone https://github.com/xghostxdz/UploadX
   cd UploadX
  1. Set up a virtual environment and install dependencies:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
    pip install -r requirements.txt
  2. Set up the database:

    flask db init
    flask db migrate -m "Initial migration."
    flask db upgrade
  3. Run the Flask application:

    flask run

    The app will be running at http://127.0.0.1:5000/.

Endpoints

User Authentication

  • /register (POST): Register a new user.
  • /login (POST): Log in a user.
  • /logout (GET): Log out the current user.

File Management

  • /upload (GET/POST): Upload a new file.
  • /files (GET): View all uploaded files.
  • /raw/<file_id> (GET): View the raw content of a file.

Error Handling

  • 403 Forbidden: Returned when a user tries to access a restricted route.
  • 404 Not Found: Returned when a file or post is not found.

Technologies Used

  • Flask: Python web framework.
  • Flask-SQLAlchemy: ORM for database management.
  • Flask-Login: User session management.
  • Werkzeug: Password hashing for secure login.
  • SQLite: Simple database for development purposes.
  • HTML: Basic templates for views.

Future Enhancements

  • Add support for file downloads.
  • Add pagination for posts and file listings.
  • Improve the UI with a dedicated frontend framework (e.g., Bootstrap).
  • Implement token-based authentication for an API-first approach.

License

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0