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-10 09:37:05 +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 fixed major issue 2024-01-10 09:37:05 +02:00
.gitignore first commit - CRUD python API for Events 2024-01-04 14:21:37 +02:00
app.py changing the interval to 5 min + add a try except to the email sending method 2024-01-09 18:25:18 +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 better README.md 2024-01-09 11:27:53 +02:00
requirements.txt removed unused packages 2024-01-09 11:06:43 +02:00

Flask-API for Managing Users and Events

This Flask-based RESTful API provides functionality for managing and interacting with events. It offers users the capability to schedule, retrieve, update, and delete events. Additionally, it features user authentication and event reminders.

Flask-API - Interface

The API allows interaction through the following features:

  • Retrieval of Upcoming Events:

    • Sort by:
      • Popularity
      • Date
    • Filter by:
      • Location
  • Event Management:

    • Users can create and update events.
  • User Authentication:

    • Users can log in and out.
    • Anonymous users can register.
  • Event Details:

    • Events include parties, concerts, sports events, etc., and are linked to the user who created them.
  • Authentication Mechanism:

    • Logging in generates a JWT token stored in the Flask session.
    • The JWT token is returned in the response cookie header.

Backend Reminder System

  • Users receive reminders for upcoming events.
  • The backend sends reminders 30 minutes prior to the event, considering user and event locations.

Database Configuration

  • Database Used: SQLite (for simplicity)
  • 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):
      • User_id (string, foreign key, primary key)
      • Event_id (int, foreign key, primary key)

API Endpoints

  • GET /events (Optional: location, sort_by (date/popularity/creation))
  • GET /events/{id} - Retrieve a single event
  • POST /events - Create a new event (Auth required)
  • PUT /events/{id} - Update an event (Auth + authorization required)
  • DELETE /events/{id} - Soft delete an event (Auth + authorization required)
  • User management endpoints (/user), including creation, retrieval, update, and deletion (with appropriate authentication and authorization).

Application Initialization Flow

  • Initialize scheduler.
  • Run the Flask application.

How to Run?

  1. Install dependencies: pip install -r requirements.txt
  2. Upgrade the database: flask db upgrade
  3. Start the Flask application: flask run