- To run this project, first run
$ pipenv install flask-sqlalchemy
to initialize flask-sqlalchemy. - Next, run
$ pipenv run python index.py
- Demo user has username
jen
and passwordP3nnLabs!
, enjoy!
- Utilize a SQL database for data management and persistent storage.
- Database contains two tables, a 'clubs' table and a 'users' table for user and club objects.
- Users table contains a username, hashed password, and list of favorited clubs.
- Clubs table contains a club name, tags, description, and number of "favorites".
- Implementation of user sessions
- User registration, login, and logout features all fully functional and consistent with maintaining unique user sessions.
- Only users that are logged in are able to 'favorite' a club
- API Features fully functional
-
/api/clubs
GET
Returns a JSON of all of the attributes of every club -
/api/clubs
POST
Allows for the addition of new clubs. Navigate tolocalhost:5000/club_form
to test out the submission of a new club with tags via a dynamic form. Click on individual tags to remove them. -
/api/user/<username>
GET
returns a JSON of the specified user - (NO LONGER WORKS) []
/api/favorite
POST
allows for a user to favorite a club if not done before. Test this out by logging in and favoriting a club. Try doing so with multiple accounts
-
- Scraping
- All web-scraping functions work, and add unique clubs to the database upon first initialization of the application.
- Frontend
- Developed a basic Bootstrap frontend to test functionality: registration, login, logout, club-homepage, favoriting clubs, adding new clubs
- Modification of user and club objects.
- While not explicitly written into frontend functionality, through the
modify
function indb_func.py
a user or club object can have any value (bar the unique ID) modified.
- While not explicitly written into frontend functionality, through the
- Use of JavaScript, JQuery, and AJAX to update values
- The dynamic club-form requires AJAX and JQuery to send a POST-request to the new club information to the server.
- Favoriting clubs also uses AJAX POST-request methods.
- See the static folder for JS, AJAX, and JQuery files