Users will be able to register, login, out, to attend to events, and to unattend to events. Events CRUD API Flask-python3
Find a file
2024-01-09 11:22:53 +02:00
middlewares dding event_user table 2024-01-08 12:19:55 +02:00
migrations added notifyer 2024-01-09 11:01:39 +02:00
routes added update to user 2024-01-09 11:22:53 +02:00
services added update to user 2024-01-09 11:22:53 +02:00
.gitignore first commit - CRUD python API for Events 2024-01-04 14:21:37 +02:00
app.py adding a single user GET 2024-01-09 11:17:01 +02:00
config.py add users table + authentication 2024-01-07 13:28:49 +02:00
models.py added notifyer 2024-01-09 11:01:39 +02:00
README.md added update to user 2024-01-09 11:22:53 +02:00
requirements.txt removed unused packages 2024-01-09 11:06:43 +02:00

Flask-API managing Users And Events

A RESTful API that manages events, offering users the ability to schedule, retrieve, update, delete, and be reminded of events with additional advanced features.

Flask-API - Interface

  • The User Will be able to retrieve upcomming event/s

    • sort by
      • popularity
      • date
    • filter by:
      • location
  • The User will be abale to create/update a new event

  • The User will be able to login/out

  • The Anonymous User will be able to create a new user

  • Event:

    • (Auth Users) An event is an upcomming Party/Concert/Sport event/etc. It is tied to a user that created this event.
  • Authentication:

    • The User will be able to login:
      • The API will generate a JWT token and set the userId inside the Flask session.
      • The API will return the JWT token in the response cookie header.

Backend-reminder

  • The Users will be able to be reminded of upcoming events.
  • The backend will Send reminders 30 minutes before the event's scheduled time based on there location and the event location.

Database

  • Sqlite(for simplicity use)

Schema

  • User -

    • Id (UUID, primary key)
    • Name (string, required)
    • Email (string, required, unique)
    • Password_hash (string, required)
    • location (string, required)
  • Event

    • Id (int, primary key)
    • Title (string, required)
    • Description (string, required)
    • Location (string, required)
    • Deleted (bool, required)
    • DueDate (string, required)
    • User_id (string, required, foreign key)
  • User Event Association (Many to Many) - this table will hold the notifyed users to the event

    • User_id (string, required, foreign key, primary key)
    • Event_id (Integer, required, foreign key, primary key)

API EndPoints

  • GET /events (Optional: ?['location' = String, 'sort_by' = Enum('date'/'popularity'/'creation' ) ])

  • GET /events/{id} - returns a single event

  • POST /events - create a new event (Auth)

  • PUT /events/{id} - update an event (Auth + authorized)

  • DELETE /events/{id} - (Soft)delete an event (Auth + authorized)

  • GET /user - returns all users

  • GET /user/{id} - returns a single user

  • POST /user - create a new user

  • PUT /user/{id} - update an user (Auth + authorized)

  • DELETE /user/{id} - (Soft)delete an user (Auth + authorized)

Application init flow

  • init schaduler
  • run the flask app

how to run?

  • pip install -r requirements.txt
  • flask db upgrade
  • flask run