An open API service indexing awesome lists of open source software.

https://github.com/gigili/did-you-buy-it-api

"Did you buy it?" is a shopping list app designed to help people keep track of stuff they need to buy and to be able to share those lists with other users.
https://github.com/gigili/did-you-buy-it-api

did-you-buy-it hacktoberfest php postgresql shopping

Last synced: about 1 month ago
JSON representation

"Did you buy it?" is a shopping list app designed to help people keep track of stuff they need to buy and to be able to share those lists with other users.

Awesome Lists containing this project

README

        

# Did You Buy It?

[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)

![Repo size badge](https://img.shields.io/github/repo-size/gigili/did-you-buy-it-api?style=for-the-badge)
![Open issues badge](https://img.shields.io/github/issues/gigili/did-you-buy-it-api?style=for-the-badge)
![Licence badge](https://img.shields.io/github/license/gigili/did-you-buy-it-api?style=for-the-badge)
![Forks badge](https://img.shields.io/github/forks/gigili/did-you-buy-it-api?style=for-the-badge)

"Did You Buy It?" is a shopping list app designed to help people keep track of stuff they need to buy.

# Local setup

To get started on developing this project firs you need to do

```shell
git clone https://github.com/gigili/did-you-buy-it-api
cd did-you-buy-it-api
composer install
```

Then rename `.env.example` into `.env` file and fill in all the values.

## To run the app:

* Start up docker containers

```shell
docker-compose up
```

# Migrations

To run the migration you need the `byjg/migration` and/or `byjg/migration-cli` package which gets installed when you
run `composer install`.

To set up your database to handle migrations check the [install](#Install-migrations) section below, or if you need to
reset the migrations table check the [Reset section](#Reset-migration)

## Install migrations

```shell
php vendor/bin/migrate install
```

## Reset migrations

```shell
php vendor/bin/migrate reset
```

## Migrate up

```shell
php vendor/bin/migrate up
```

## Migrate down

```shell
php vendor/bin/migrate down
```

### Note

On Windows machines you **need** the `php` prefix before calling the `vendor/bin/migrate`. You might also need to pass
in the `postgres` connection string in your command which looks like:

```
pgsql://postgres:postgres@localhost/dybi -vvv
```

where `-vvv` indicates verbose output of the migrate command.

# Tests

//TODO

# Notes

* I've set up a virtual host on my machine to be able to easily run the app

## Virtual Host Example:

```apacheconf

ServerAdmin [email protected]
DocumentRoot "/Projects/did-you-buy-it-api"
ServerName dybi.local
ServerAlias www.dybi.local
ErrorLog "/Projects/did-you-buy-it-api/logs/error.log"
CustomLog "/Projects/did-you-buy-it-api/logs/access.log" common

Options Indexes FollowSymLinks
AllowOverride All
Require all granted

```

Don't forget to add

```apacheconf
127.0.0.1 dybi.local
127.0.0.1 www.dybi.local
```

this to your hosts file

* `/etc/hosts` on Linux / OSx and
* `C:\Windows\System32\drivers\etc\hosts` on Windows

# Features

* [x] Login
* [x] Register
* [x] Send an activation email
* [x] Activate user account
* [x] Lists
* [x] Create list
* [x] Update list
* [x] Delete list
* [X] List users that have access to the list
* [x] Allow other users access to the list
* [x] Remove users from the list
* [x] Autocomplete endpoint for when adding users ?
* [ ] List items
* [x] Add list item
* [x] Add images
* [x] Update list item
* [x] Mark item as bought
* [ ] Send notification to other users of the list
* [x] Delete list item
* [x] Add / remove images
* [x] User profile
* [x] Edit profile
* [x] Delete profile
* [x] Send an email notification that the account has been closed
* [x] Reset password

# Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):



Sebastian

⚠️

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!