Git Product home page Git Product logo

bored-web-app's Introduction

Bored.

Project Idea

A web application for when you're bored and looking for something to do. Getting data from the Bored API, Bored lets you find random activities and save them for later (and mark them as completed too).

The project is built using Python (Flask), HTML and CSS, and interacts with the Bored API and a database.

Environment Setup & Dependencies

Use the package manager pip to install all dependencies required for development using the requirements.txt file in the project's root folder:

pip install -r requirements.txt

It is recommended to use a virtual environment to isolate from other projects.

Making database migrations using SQLAlchemy ORM

NOTE: A database connection string is required as an environment variabled, set as an environment variable by typing into command line:

set DB_LINK=mysql://username:password@server:post_number/database_name

Create an initial migration file to translate the classes in models.py to SQL that will generate corresponding tables

python manage.py db migrate

Run the migration to upgrade the database with the tables described in the prior step

python manage.py db upgrade

How To Use The Web App

When opened, the web app will take you to the Home page, where you can see a randomly selected activity (below is a short description of the app). From here, you can save the activity for later but you'll need to register/login with an account. Don't worry, if you're taken to login or register, when you come back, you'll see the same activity that you saw before registering/logging in. On the Saved Activities page, you can see all the activities you have saved. Here you can complete the ones you have done or remove them if you want to.

As at 13/09/2020, the web app can be accessed here.

Running the API locally

Set database connection string as an environment variable, as in the Making database migrations using SQLAlchemy ORM section.

Execute the following bash command from the project root folder to start the API server on localhost:5000/. Note you need to have Python and all dependencies installed first.

python app.py

Screen Captures

Home page: Home page

Saved activities page: Saved activities

Login page: Login

Register page: Register

bored-web-app's People

Contributors

jsaji avatar

Watchers

 avatar

Forkers

tu-code

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.