ποΈ 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:
π§βπ User
β
Field | Type | Description |
---|---|---|
id | Int | Unique identifier |
full_name | String | Full name |
String | User email (unique) | |
password | String | Encrypted password |
next_year | Int? | Year of participation in the NEXT program |
university | String? | Current university |
graduation_year | Int? | Expected graduation year |
profile_photo | String? | Profile picture URL |
linkedin_url | String? | LinkedIn profile URL |
interests | String[] | Areas of interest |
career_goals | String? | Career goals |
hobbies | String[] | Personal hobbies |
bio | String? | Biography / professional summary |
current_job | String? | Current role (if any) |
scholarship_type | String? | Type of scholarship (full/partial) |
created_at | DateTime | Creation date |
updated_at | DateTime | Last updated |
Relationships:
- 1:N with
Experience
,Award
,Extracurricular
,Application
.
π§ͺ Experience
β
Field | Type | Description |
---|---|---|
user_id | Int | Reference to the user |
role | String | Job title |
company | String | Company name |
start_date | DateTime | Start date |
end_date | DateTime | End date |
description | String? | Additional description |
created_at | DateTime | Creation date |
updated_at | DateTime | Last updated |
π
Award
β
Field | Type | Description |
---|---|---|
user_id | Int | Reference to the user |
title | String | Name of the award/scholarship |
institution | String | Granting institution |
year | Int | Year of the award |
created_at | DateTime | Creation date |
updated_at | DateTime | Last updated |
π Extracurricular
β
Field | Type | Description |
---|---|---|
user_id | Int | Reference to the user |
activity | String | Activity name |
organization | String | Organizing institution |
year | Int | Year of participation |
created_at | DateTime | Creation date |
updated_at | DateTime | Last updated |
π’ Company
β
Field | Type | Description |
---|---|---|
id | Int | Unique identifier |
name | String | Company name |
String | Corporate email (unique) | |
password | String | Encrypted password |
description | String? | Company description |
logo | String? | Logo URL |
mission | String? | Company mission |
values | String? | Company values |
created_at | DateTime | Creation date |
updated_at | DateTime | Last updated |
Relationships:
- 1:N with
Job
.
π Job
β
Field | Type | Description |
---|---|---|
id | Int | Unique identifier |
title | String | Job title |
description | String | Job description |
requirements | String | Application requirements |
area | String | Legal practice area |
salary | String? | Salary range |
benefits | String? | Offered benefits |
location | String? | Job location |
company_id | Int | Reference to the company |
created_at | DateTime | Creation date |
updated_at | DateTime | Last updated |
Relationships:
- 1:N with
Application
.
π¬ Application
β
Field | Type | Description |
---|---|---|
id | Int | Unique identifier |
user_id | Int | Reference to the student |
job_id | Int | Reference to the job |
status | String | Application status ("Applied", "Interview", "Offer") |
applied_at | DateTime | Application 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Γ’metro | Valor |
---|---|
Nome da instΓ’ncia | next-db |
RegiΓ£o | us-east-1 (Norte da VirgΓnia) |
VersΓ£o do PostgreSQL | 15 |
Conectividade pΓΊblica | Ativada (com regras no Security Group) |
Endpoint | database-1.cfssllf0qlz6.us-east-1.rds.amazonaws.com |
Porta | 5432 |
Backup automΓ‘tico | Ativado |
UsuΓ‘rio principal | postgres |
Banco inicial | next_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.