This file contains the Supabase configuration for the ISEL APP project.
tables.sql: Defines the database schema and table structures.dummy_pop.sql: Contains SQL statements to populate the database with dummy data for testing.full_truncate.sql: Includes SQL commands to truncate all tables, useful for resetting the database.
The database schema consists of the following tables:
servico: Represents services with their acronym, name, location, and URL.edificio: Stores information about buildings, including their acronym, latitude, longitude, icon, and description.acesso_rapido: Contains quick access links with an icon, title, translation, and URL.conteudo: Stores content details such as date, URL, image, alt text, title, text, type, and location.contacto: Represents contact information for services, including address and contact type.departamento: Stores department details with their acronym, name, and associated building.curso: Represents courses with their acronym, name, code, and associated department.sala: Stores information about rooms, including the building, floor, number, latitude, longitude, acronym, and description.atendimento: Contains attendance information with an ID, acronym, day of the week, and hours.disciplina: Represents disciplines with their code, name, and acronym.utilizador: Stores user information, including their institutional code, user type, email, name, gender, identification number, associated course, department, building, floor, and room.conversa: Represents conversations with an ID, conversation ID, name, type, and associated user.mensagem: Stores messages with an ID, creation date, conversation reference, text, editable flag, and the user who sent it.evento: Represents events with an ID, title, description, date, time, duration, type, associated user, and discipline.aula: Stores class information, including the ID, day of the week, start time, duration, associated discipline, professor, and user.plano_curricular: Represents the curricular plan with discipline code, course acronym, branch code, ECTS credits, period, area, translation, optional flag, option group, year, and ID.inscricao: Stores enrollment information with an ID, academic year, enrollment date, status, associated discipline, final grade, and user.ruc: Represents the "Responsável da UC" with the academic year, period, course acronym, discipline code, ID, and the "regente".notificacao: Stores notifications with an ID, type, date and time, message, recipient user, and image.
- Go to Supabase and sign in or create an account.
- Click "New Project" and follow the prompts to set up your project.
- Navigate to the SQL Editor in your Supabase dashboard.
- Execute the SQL files in the following order:
- `tables.sql`
- `dummy_pop.sql` (optional, for testing)
To reset the database:
- Execute
full_truncate.sql
Supabase automatically generates API endpoints for your tables. To use them:
- Go to the API Docs section in your Supabase dashboard.
- Find your table and copy the generated API code snippets for various operations.
To create serverless functions:
- Go to the Functions section.
- Click "Create a new function" and follow the prompts.
- Deploy your function using the Supabase CLI.
To set up database triggers:
- Use the SQL Editor to create triggers or go to the Triggers section (next to the Functions section).
- Define the trigger function in your SQL.
This project is licensed under the MIT License - see the LICENSE file for details.

