{"id":28362939,"url":"https://github.com/potakaaa/car-dealership-backend","last_synced_at":"2025-07-04T19:36:24.850Z","repository":{"id":288366815,"uuid":"967809387","full_name":"potakaaa/car-dealership-backend","owner":"potakaaa","description":"A RESTful API for a car e-commerce platform built with FastAPI with SQLAlchemy, supporting car listings, buying, and selling features with a clean, scalable project structure.","archived":false,"fork":false,"pushed_at":"2025-04-20T11:29:04.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-04T21:21:10.671Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/potakaaa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-17T03:22:22.000Z","updated_at":"2025-04-20T11:29:08.000Z","dependencies_parsed_at":"2025-06-17T03:31:53.291Z","dependency_job_id":null,"html_url":"https://github.com/potakaaa/car-dealership-backend","commit_stats":null,"previous_names":["potakaaa/car-dealership-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/potakaaa/car-dealership-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potakaaa%2Fcar-dealership-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potakaaa%2Fcar-dealership-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potakaaa%2Fcar-dealership-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potakaaa%2Fcar-dealership-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/potakaaa","download_url":"https://codeload.github.com/potakaaa/car-dealership-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potakaaa%2Fcar-dealership-backend/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261243140,"owners_count":23129585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-28T16:16:44.405Z","updated_at":"2025-07-04T19:36:24.845Z","avatar_url":"https://github.com/potakaaa.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Car Dealership Backend\n\nThis is the backend for the **Car Dealership** web app. The backend is built using **FastAPI** and connects to a **PostgreSQL** database and a **Redis** instance. Docker is used to containerize the app for easy setup and deployment.\n\n## Table of Contents\n- [Technologies Used](#technologies-used)\n- [Setup](#setup)\n  - [Setting Up the Backend with Docker](#setting-up-the-backend-with-docker)\n  - [Local Setup (without Docker)](#local-setup-without-docker)\n- [Environment Variables](#environment-variables)\n- [Usage](#usage)\n- [License](#license)\n\n---\n\n## Technologies Used\n\n- **FastAPI** – Web framework for building APIs.\n- **PostgreSQL** – Relational database for storing car dealership data.\n- **Redis** – In-memory data store (used as cache).\n- **Docker** – Containerization for easy app setup and deployment.\n- **Uvicorn** – ASGI server to serve the FastAPI app.\n- **Python 3.11** – Programming language used to develop the app.\n\n---\n\n## Setup\n\n### Setting Up the Backend with Docker\n\nFollow these steps to set up the backend with Docker. This will automatically handle all dependencies, including **PostgreSQL** and **Redis**.\n\n1. **Clone the repository**\n\n   ```bash\n   git clone https://github.com/your-username/car-dealership-backend.git\n   cd car-dealership-backend\n   ```\n\n2. **Create an `.env` file** for environment variables\n\n   In the root directory of the project, create a `.env` file and add the following:\n\n   ```env\n   POSTGRES_USER=your_postgres_user\n   POSTGRES_PASSWORD=your_postgres_password\n   POSTGRES_DB=car_dealer\n   REDIS_HOST=localhost\n   REDIS_PORT=6379\n   ```\n\n3. **Build and start the Docker containers**\n\n   Run the following command to build and start the Docker containers:\n\n   ```bash\n   docker-compose up --build\n   ```\n\n   This command will:\n   - Build the FastAPI app container.\n   - Pull the `PostgreSQL` and `Redis` images from Docker Hub.\n   - Set up a **PostgreSQL** database and a **Redis** instance.\n   - Expose **PostgreSQL** on port `5433` and **FastAPI** on port `8000`.\n\n4. **Access the app**\n\n   Once the Docker containers are running, you can access the backend via:\n\n   - FastAPI: [http://localhost:8000](http://localhost:8000)\n   - PostgreSQL: `localhost:5433` (using the credentials you set in the `.env` file)\n   - Redis: `localhost:6379`\n\n### Local Setup (without Docker)\n\nIf you prefer to run the app without Docker, follow these steps to set it up locally.\n\n1. **Install dependencies**\n\n   First, create a virtual environment and install the required dependencies.\n\n   ```bash\n   python3 -m venv venv\n   source venv/bin/activate  # On Windows, use 'venv\\Scripts\\activate'\n   pip install -r requirements.txt\n   ```\n\n2. **Set up PostgreSQL**\n\n   Make sure you have **PostgreSQL** running on your machine. You can use the following command to start the PostgreSQL service:\n\n   ```bash\n   sudo service postgresql start  # On Linux/macOS\n   ```\n\n   Create a new database, user, and set the password for your PostgreSQL instance.\n\n   ```bash\n   psql -U postgres\n   CREATE DATABASE car_dealer;\n   CREATE USER your_postgres_user WITH PASSWORD 'your_postgres_password';\n   ALTER ROLE your_postgres_user SET client_encoding TO 'utf8';\n   ALTER ROLE your_postgres_user SET default_transaction_isolation TO 'read committed';\n   ALTER ROLE your_postgres_user SET timezone TO 'UTC';\n   GRANT ALL PRIVILEGES ON DATABASE car_dealer TO your_postgres_user;\n   ```\n\n3. **Set up Redis**\n\n   Make sure you have **Redis** running on your machine.\n\n   ```bash\n   redis-server\n   ```\n\n4. **Run the app**\n\n   Start the FastAPI app using `uvicorn`:\n\n   ```bash\n   uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload\n   ```\n\n   This will run the FastAPI app on port 8000.\n\n---\n\n## Environment Variables\n\nThe app uses the following environment variables. Set these up in your `.env` file:\n\n- `POSTGRES_USER` – PostgreSQL username\n- `POSTGRES_PASSWORD` – PostgreSQL password\n- `POSTGRES_DB` – Name of the PostgreSQL database\n- `REDIS_HOST` – Redis server host (default: `localhost`)\n- `REDIS_PORT` – Redis server port (default: `6379`)\n\n---\n\n## Usage\n\nOnce the app is running, you can:\n\n- Access the FastAPI documentation at [http://localhost:8000/docs](http://localhost:8000/docs)\n- Test endpoints with Postman or curl.\n\n---\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotakaaa%2Fcar-dealership-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpotakaaa%2Fcar-dealership-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotakaaa%2Fcar-dealership-backend/lists"}