# 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
-
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
-
Set up the database:
flask db init flask db migrate -m "Initial migration." flask db upgrade
-
Run the Flask application:
flask run
The app will be running at
http://127.0.0.1:5000/
.
/register
(POST): Register a new user./login
(POST): Log in a user./logout
(GET): Log out the current user.
/upload
(GET/POST): Upload a new file./files
(GET): View all uploaded files./raw/<file_id>
(GET): View the raw content of a file.
- 403 Forbidden: Returned when a user tries to access a restricted route.
- 404 Not Found: Returned when a file or post is not found.
- 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.
- 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.
This project is licensed under the MIT License. See the LICENSE file for details.