https://github.com/mohyour/bucketlist-api
Bucket list api using flask
https://github.com/mohyour/bucketlist-api
api bucketlist flask flask-api python
Last synced: 2 months ago
JSON representation
Bucket list api using flask
- Host: GitHub
- URL: https://github.com/mohyour/bucketlist-api
- Owner: mohyour
- Created: 2018-06-03T18:44:01.000Z (about 7 years ago)
- Default Branch: develop
- Last Pushed: 2018-07-01T21:00:48.000Z (almost 7 years ago)
- Last Synced: 2025-02-08T19:36:16.303Z (4 months ago)
- Topics: api, bucketlist, flask, flask-api, python
- Language: Python
- Homepage: https://moi-bucket-list-api.herokuapp.com
- Size: 39.1 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bucket List API
A bucket list is a list of things you intend to achieve or experience.
### Technologies
- Python3
- Flask
- Flask-API
- SQLAlchemy
- autoenv### Setup
- Create a virtual environent using python3 and activate it
- create a `.env` to have your app configurations like thisexport FLASK_APP="manage.py"
export SECRET=""
export APP_SETTINGS="development"
export DATABASE_URL="postgres://localhost/"Activate your .env file by typing `source .env` in the commandline
- Install requirements.txt `pip install -r requirements.txt`
- Ensure your postgres is running on the right port(5432 by default). Create test and development database using `createdb database-name`### Database
- Run `python manage.py db init` to create a migrations folder
- Run `python manage.py db migrate` to create migrations
- Run `python manage.py db upgrade` to apply the migrations to databaseYou can seed data into the database by running `python manage.py seed_db`. Ensure the required data has been included in the .env file as follows
export PASSWORD=""
export EMAIL="your-email"
export BUCKETLIST=""Type `source .env` in the commandline to activate
### Starting application
- Run app with `flask run` or `python manage.py runserver`
- Navigate to `http://localhost:5000/` or `http://127.0.0.1:5000/` to use api### Testing
- Run tests with `python manage.py test`. This makes use of the testing environment### API Endpoints
Bucketlist:| Endpoints | Methods |Description|
| ------------- | ------------- | -----|
|/auth/signup | POST | Create a new user |
|/auth/signin | POST | Sign in a user |
|/lists/ |GET | Get all bucketlists|
|/lists/ |POST | Add bucketlist |
|/lists/:id |GET | Get a single bucketlist |
|/lists/:id |PUT | Update a single bucketlist |
|/lists/:id |DELETE| Delete a single bucketlist |Authentication:
- Create a user from the auth/signup route
- Sign in from the auth/sign in route
- Put token generated in the header with key `Authorization`. Token should be in this format:
`Bearer `
```
Bearer jyFghGsvdfDDf636svkltdEmjfvuydrgchtsds43BsfvNKsfdsKKOHshds
```