Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tyronejosee/project_drop_dash_api
Drop Dash (API): A home delivery platform that allows users to search for and purchase products from local restaurants near their homes, place orders, and schedule deliveries. Provides access to restaurants to manage their menus, receive orders, and handle their meals through the platform. Inspired by platforms like Rappi and Uber Eats
https://github.com/tyronejosee/project_drop_dash_api
black digitalocean django django-rest-framework djoser docker docker-compose drf drf-spectacular flake8 github-actions jwt nginx oauth2 postgresql python redis s3-bucket sqlite swagger
Last synced: 4 days ago
JSON representation
Drop Dash (API): A home delivery platform that allows users to search for and purchase products from local restaurants near their homes, place orders, and schedule deliveries. Provides access to restaurants to manage their menus, receive orders, and handle their meals through the platform. Inspired by platforms like Rappi and Uber Eats
- Host: GitHub
- URL: https://github.com/tyronejosee/project_drop_dash_api
- Owner: tyronejosee
- License: apache-2.0
- Created: 2024-04-08T18:43:58.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-08-28T23:11:48.000Z (3 months ago)
- Last Synced: 2024-08-29T22:56:05.365Z (3 months ago)
- Topics: black, digitalocean, django, django-rest-framework, djoser, docker, docker-compose, drf, drf-spectacular, flake8, github-actions, jwt, nginx, oauth2, postgresql, python, redis, s3-bucket, sqlite, swagger
- Language: Python
- Homepage: https://project-dropdash.vercel.app/
- Size: 3.74 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This API simulates a home delivery platform that allows users to search for and purchase products from local restaurants near their homes, place orders, and schedule deliveries. Similarly, restaurants can manage their menus, receive orders, and handle their meals through the platform. The API is inspired by platforms like Rappi, Uber Eats, PedidosYa, and Glovo.## ⚙️ Installation
Clone the repository.
```bash
git clone [email protected]:tyronejosee/project_drop_dash_api.git
```Create a virtual environment (Optional, only if you have Python installed).
```bash
python -m venv env
```Activate the virtual environment (Optional, only if you have Python installed).
```bash
env\Scripts\activate
```> Notes: `(env)` will appear in your terminal input.
Install dependencies for your local environment, for testing, linter and pre-commit configs, etc. (Optional, only if you have Python installed).
```bash
pip install -r requirements/local.txt
```Create a copy of the `.env.example` file and rename it to `.env`.
```bash
cp .env.example .env
```**Update the values of the environment variables (Important).**
> Note: Make sure to correctly configure your variables before building the container.
## 🐳 Docker
Build your container; it will take time the first time, as Docker needs to download all dependencies and build the image.
Use the `-d` (detached mode) flag to start your containers in the background.
Use the `--build` flag if you have changes and need to rebuild.```bash
docker compose up
docker compose up -d
docker compose up --build
```Stop the running containers (does not remove them).
```bash
docker compose stop
```Start previously created and stopped containers.
```bash
docker compose start
```Show container logs in real-time.
```bash
docker compose logs -f
```Restart a service with issues (Replace ``).
```bash
docker compose restart
```Remove your container.
```bash
docker compose down
```## 🐍 Django
Access the `web` service console that runs Django.
```bash
docker compose exec web bash
```Inside the Django console, create the migrations.
```bash
python manage.py makemigrations
```Run the migrations.
```bash
python manage.py migrate
```If you need to be more specific, use:
```bash
python manage.py migrate
```List all available migrations and their status.
```bash
python manage.py showmigrations
```> Note: Manually create the migration if Django skips an app; this happens because Django did not find the `/migrations` folder.
Create a superuser to access the entire site without restrictions.
```bash
python manage.py createsuperuser
```Log in to `admin`:
```bash
http://127.0.0.1:8200/admin/
```Access Swagger or Redoc.
```bash
http://127.0.0.1:8200/api/schema/swagger/
http://127.0.0.1:8200/api/schema/redoc/
```## 🚨 Important Notes
Check the creation of migrations before creating them.
```bash
docker compose exec web python manage.py makemigrations users
```> Note: Checking migrations before their creation is necessary to avoid inconsistencies in user models.
## 🐘 PostgreSQL
Access the PostgreSQL console.
```bash
docker compose exec db psql -U -d
```List all the tables in the database.
```bash
\dt
```Show the detailed structure of a specific table.
```bash
\d
```Create a backup of your database (Optional).
```bash
docker compose exec web python manage.py dumpdata > backup.json
```Load the created backup if needed (Optional).
```bash
docker compose exec web python manage.py loaddata
```## 🟥 Redis
Access the Redis console.
```bash
docker compose exec redis redis-cli
```Retrieve all keys.
```bash
KEYS *
```Delete a key from cache.
```bash
DEL
```Delete all keys.
```bash
FLUSHALL
```## ⚖️ License
This project is under the [Apache-2.0 license](https://github.com/tyronejosee/project_drop_dash_api/blob/main/LICENSE).