https://github.com/sharafatkarim/metro-api
Metro-API, a lightweight, user-friendly backend for handling user balances. Easily recharge, discharge, and manage user data with a powerful FastAPI framework.
https://github.com/sharafatkarim/metro-api
backend-api fastapi python
Last synced: 5 months ago
JSON representation
Metro-API, a lightweight, user-friendly backend for handling user balances. Easily recharge, discharge, and manage user data with a powerful FastAPI framework.
- Host: GitHub
- URL: https://github.com/sharafatkarim/metro-api
- Owner: SharafatKarim
- License: mit
- Created: 2024-10-13T08:45:57.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-11-26T15:56:02.000Z (over 1 year ago)
- Last Synced: 2025-01-16T20:48:22.785Z (over 1 year ago)
- Topics: backend-api, fastapi, python
- Language: C++
- Homepage:
- Size: 23.4 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# 🚇 Metro-API
Welcome to **Metro-API**, a lightweight, user-friendly backend for handling user balances. Easily recharge, discharge, and manage user data with a powerful FastAPI framework.



## 🚀 Features
- 📋 **User management**: Create, read, update, and delete users.
- 💰 **Balance management**: Recharge or discharge user balances with ease.
- 🔄 **SQLAlchemy Integration**: Seamlessly handle database operations.
- 🏗️ **FastAPI-based**: Blazing fast, easy-to-use REST API.
## ⚡ Quick Setup
### 1. Clone the Repo
```bash
git clone https://github.com/SharafatKarim/metro-api.git
```
### 2. Navigate to the directory
```bash
cd metro-api
```
### 3. Deploy on system (Linux)
```bash
bash setup.sh
```
#### 3.1 Manual Setup
If automatic setup (`setup.sh`), you can manually set up the project.
##### 3.1.1 Create a virtual environment
```bash
python -m venv .venv
```
##### 3.1.2 Activate the virtual environment
```bash
source .venv/bin/activate
```
##### 3.1.3 Install the required dependencies
```bash
pip install -r requirements.txt
```
##### 3.1.4 And run the server
```bash
uvicorn main:app --reload
```
### 4. Start the API
Once the setup is complete, the server will start automatically. Visit:
- (It will redirect to `/docs`)
> Or, check the video guide,
> [](https://youtu.be/UHvnPYXTJ3U)
## 📂 Endpoints Overview
- `GET /users/{id}` - Retrieve user balance
- `POST /users` - Create a new user
- `PUT /users/+/id` - Recharge balance
- `PUT /users/-/id` - Discharge balance
- `DELETE /users/{id}` - Delete a user
## 👥 Contributors
[](https://github.com/SharafatKarim)
[](https://github.com/sadman2084)
## 📜 License
This project is licensed under the [MIT License](LICENSE).
> Enjoy using Metro-API! ✨
> This `README.md` file is concise and highlights the essential aspects of the project, providing a smooth start for users. Let me know if you'd like to tweak anything!