Skip to content

Mikhail11235/fishy_wishes

Repository files navigation

𓇼 ⋆.˚ 𓆉 𓆝 𓆡⋆.˚ 𓇼 Wishlist Project 𓇼 ⋆.˚ 𓆉 𓆝 𓆡⋆.˚ 𓇼

A simple solution for keeping track of all your gift desires. Whether you're planning your next big gift or just organizing your personal wish list, this project has got you covered. Dive into the details and see how you can make your wishlist both stylish and functional.

📸 Screenshots

🖥️ Admin

Admin

Screenshot of the Django admin interface where you can manage users and wishlist items.

👤 Unauthenticated User

Unauthenticated User

How the site appears to users who are not logged in.

📱 Mobile View

Mobile View

Example of how the wishlist looks on a mobile device.

🚀 Quick Start
  1. Clone the repository, navigate to the project directory, and create a prod.env file:

    git clone https://github.com/Mikhail11235/fishy_wishes.git
    cd fishy_wishes

    Create a prod.env file with the necessary environment variables. Example:

    HOST=YOUR_HOST
    PGNAME=YOUR_DB_NAME
    PGUSER=YOUR_DB_USER
    PGPASSWORD=YOUR_DB_PASSWORD
    PGHOST=db
    PGPORT=5432
    DJANGO_SUPERUSER_USERNAME=YOUR_DJANGO_SUPERUSER_USERNAME
    DJANGO_SUPERUSER_EMAIL=YOUR_DJANGO_SUPERUSER_EMAIL
    DJANGO_SUPERUSER_PASSWORD=YOUR_DJANGO_SUPERUSER_PASSWORD
  2. Start Docker Compose:

    • To start the application with Docker Compose, use:
    docker-compose --env-file prod.env up -d --build
    • For local development with debugging enabled, modify the local.env:
    HOST=*
    PGHOST=localhost

    Set DEBUG=True LOCAL=TRUE in settings.py

    Then start the application:

    python3 manage.py runserver
  3. Run database migrations, collect static files, and compile messages:

    docker-compose exec web python manage.py wishlist makemigrations
    docker-compose exec web python manage.py migrate
    docker-compose exec web python manage.py collectstatic
    docker-compose exec web django-admin compilemessages
🌐 How to Use
  1. Open your browser and go to: http://your_domain

  2. Browse your wishlist, add and remove items as you like.

  3. Add a separate user for gift booking:

    • Log in to the Django admin interface using your superuser credentials.
    • Go to the "Users" section and click "Add User".
    • Enter a username and password for the new user, then click "Save".

    This new user will now be able to manage gift bookings. 🎁

🛠️ Setting Up a System Service
  1. Create a systemd service file:

    sudo nano /etc/systemd/system/wishlist.service

    Add the following content to the file:

    [Unit]
    Description=Wishlist Service
    After=network.target
    
    [Service]
    Type=simple
    WorkingDirectory=/path/to/your_project
    ExecStart=/usr/local/bin/restart-wishlist.sh
    ExecReload=/usr/local/bin/restart-wishlist.sh
    Restart=on-failure
    RestartSec=120
    User=your_user
    Group=your_group
    
    [Install]
    WantedBy=multi-user.target

    Replace /path/to/your_project, /usr/local/bin/restart-wishlist.sh, your_user, and your_group with the appropriate values for your setup.

  2. Create the restart script:

    sudo nano /usr/local/bin/restart-wishlist.sh

    Add the following content to the script:

    #!/bin/bash
    
    cd /path/to/your_project
    
    /usr/local/bin/docker-compose --env-file prod.env down
    
    /usr/local/bin/docker-compose --env-file prod.env up -d --build

    Make the script executable:

    sudo chmod +x /usr/local/bin/restart-wishlist.sh
  3. Reload systemd and start the service:

    sudo systemctl daemon-reload
    sudo systemctl enable wishlist.service
    sudo systemctl start wishlist.service
  4. Check the status of your service:

    sudo systemctl status wishlist.service

This project is licensed under the MIT License. If you have ideas for improvements or want to help with development, feel free to create a Pull Request or open an Issue.