Skip to main content

πŸ—‚οΈ Database Documentation

This document outlines the database modeling for the platform, focusing on user (student) profiles, companies, job postings, and additional relationships such as applications, professional experiences, and extracurricular activities.

The database of the Next Generation of Lawyers platform is structured to connect young legal talents with companies and career opportunities. It supports student and company profiles, as well as their relationships with work experiences, awards, extracurricular activities, job postings, and applications.


1. Database Structure​

  • Users (Students): Personal accounts containing basic, academic, and professional data, including interests, career goals, hobbies, biography, and optional fields such as scholarship type and current occupation. Students can also add experiences, awards, and extracurricular activities to their profiles.

  • Companies: Institutional profiles with fields such as name, email, logo, mission, values, and description. Companies can create and manage job postings.

  • Jobs: Internship, employment, or development opportunities with details such as requirements, legal area, benefits, compensation, and a reference to the responsible company.

  • Applications: Records of student applications to job postings, including status and application date.

  • Experiences: The student's work history, detailing role, company, period, and additional notes.

  • Awards: Academic or professional achievements, such as scholarships, competitions, or institutional recognition.

  • Extracurricular Activities: Participation in student organizations, projects, or social initiatives.


2. ERD Diagram​

Below is the ERD diagram using dbdiagram.io:

Database


πŸ§‘β€πŸŽ“ User​

FieldTypeDescription
idIntUnique identifier
full_nameStringFull name
emailStringUser email (unique)
passwordStringEncrypted password
next_yearInt?Year of participation in the NEXT program
universityString?Current university
graduation_yearInt?Expected graduation year
profile_photoString?Profile picture URL
linkedin_urlString?LinkedIn profile URL
interestsString[]Areas of interest
career_goalsString?Career goals
hobbiesString[]Personal hobbies
bioString?Biography / professional summary
current_jobString?Current role (if any)
scholarship_typeString?Type of scholarship (full/partial)
created_atDateTimeCreation date
updated_atDateTimeLast updated

Relationships:

  • 1:N with Experience, Award, Extracurricular, Application.

πŸ§ͺ Experience​

FieldTypeDescription
user_idIntReference to the user
roleStringJob title
companyStringCompany name
start_dateDateTimeStart date
end_dateDateTimeEnd date
descriptionString?Additional description
created_atDateTimeCreation date
updated_atDateTimeLast updated

πŸ… Award​

FieldTypeDescription
user_idIntReference to the user
titleStringName of the award/scholarship
institutionStringGranting institution
yearIntYear of the award
created_atDateTimeCreation date
updated_atDateTimeLast updated

πŸŽ“ Extracurricular​

FieldTypeDescription
user_idIntReference to the user
activityStringActivity name
organizationStringOrganizing institution
yearIntYear of participation
created_atDateTimeCreation date
updated_atDateTimeLast updated

🏒 Company​

FieldTypeDescription
idIntUnique identifier
nameStringCompany name
emailStringCorporate email (unique)
passwordStringEncrypted password
descriptionString?Company description
logoString?Logo URL
missionString?Company mission
valuesString?Company values
created_atDateTimeCreation date
updated_atDateTimeLast updated

Relationships:

  • 1:N with Job.

πŸ“„ Job​

FieldTypeDescription
idIntUnique identifier
titleStringJob title
descriptionStringJob description
requirementsStringApplication requirements
areaStringLegal practice area
salaryString?Salary range
benefitsString?Offered benefits
locationString?Job location
company_idIntReference to the company
created_atDateTimeCreation date
updated_atDateTimeLast updated

Relationships:

  • 1:N with Application.

πŸ“¬ Application​

FieldTypeDescription
idIntUnique identifier
user_idIntReference to the student
job_idIntReference to the job
statusStringApplication status ("Applied", "Interview", "Offer")
applied_atDateTimeApplication date

πŸ”— Relationships​

User 1 β€” N Experience
User 1 β€” N Award
User 1 β€” N Extracurricular
User 1 β€” N Application
Company 1 β€” N Job
Job 1 β€” N Application

☁️ Database Hosting β€” AWS RDS (PostgreSQL)​

πŸ“Œ Overview​

The Next Generation of Lawyers database is hosted on Amazon Web Services (AWS) using the RDS (Relational Database Service) with PostgreSQL 15. Hosting on AWS provides high availability, automated backups, scalability, and robust security.

βš™οΈ Instance Configuration​

ParΓ’metroValor
Nome da instΓ’ncianext-db
RegiΓ£ous-east-1 (Norte da VirgΓ­nia)
VersΓ£o do PostgreSQL15
Conectividade pΓΊblicaAtivada (com regras no Security Group)
Endpointdatabase-1.cfssllf0qlz6.us-east-1.rds.amazonaws.com
Porta5432
Backup automΓ‘ticoAtivado
UsuΓ‘rio principalpostgres
Banco inicialnext_db

πŸ” Secure Access​

βœ… Configure VPC Security Group to allow inbound connections on port 5432 from:

  • Your IP address (for local development)
  • Your backend hosting provider (e.g., Vercel, Railway, Render)

πŸ”— Connection URL​

DATABASE_URL="postgresql://postgres:<password>@database-1.cfssllf0qlz6.us-east-1.rds.amazonaws.com:5432/next_db"

πŸ› οΈ Prisma Migrations​

After setting up the connection, execute:

npx prisma migrate resolve --applied "*"
npx prisma migrate deploy

βœ… Conclusion​

The database architecture and hosting ensure data security, reliability, scalability, and easy integration with the Next Gen Lawyers platform services.