1# Jobrapido Frontend
23Vue.js frontend for the Jobrapido job platform.
45## Components
13## Integration with Backend
1415The frontend communicates with the Django backend through REST API endpoints:
1617- Authentication: `/api/login/`, `/api/register/`, etc.
18- Profile management: `/api/profile/`, `/api/upload-documents/`
1920## Development
funappRegisterForm.vue2 matches
8081try {
82const res = await fetch('http://localhost:8000/api/register/', {
83method: 'POST',
84headers: { 'Content-Type': 'application/json' },
109110try {
111const res = await fetch('http://localhost:8000/api/send-verification-code/', {
112method: 'POST',
113headers: { 'Content-Type': 'application/json' },
funappLoginForm.vue2 matches
1<template>
2<div class="container mt-5 text-center">
3<h2 class="mb-4">Login to Jobrapido</h2>
4<form @submit.prevent="handleLogin" class="text-start">
5<div class="mb-3">
38async handleLogin() {
39try {
40const response = await fetch('http://localhost:8000/api/login/', {
41method: 'POST',
42headers: { 'Content-Type': 'application/json' },
1# Jobrapido Backend
23Django backend for the Jobrapido job platform.
45## Setup
214. Run migrations:
22```
23python manage.py makemigrations api
24python manage.py migrate
25```
37## Project Structure
3839- `jobrapido/` - Django project settings
40- `api/` - Main Django app
41- `models.py` - Database models
42- `views.py` - API and template views
43- `serializers.py` - REST API serializers
44- `urls.py` - URL routing
45- `templates/` - Django HTML templates
54- `VerificationCode` - Email verification codes
5556## API Endpoints
5758### Authentication
59- `POST /api/login/` - User login
60- `POST /api/logout/` - User logout
61- `POST /api/register/` - User registration
62- `POST /api/send-verification-code/` - Send verification code for registration
63- `POST /api/forgot-password/` - Request password reset
64- `POST /api/reset-password/` - Reset password with verification code
6566### Profile
67- `GET /api/profile/` - Get user profile
68- `PUT /api/profile/` - Update user profile
69- `POST /api/upload-documents/` - Upload user documents
7071## Template Pages
1# Jobrapido - Job Platform
23A job platform connecting job seekers and employers in Burundi and beyond.
89- **Frontend**: Vue.js application
10- **Backend**: Django REST API with Django templates
1112## Backend Setup
335. Run migrations:
34```
35python manage.py makemigrations api
36python manage.py migrate
37```
72- Different user roles (job seeker, worker seeker, partner)
7374## API Endpoints
7576### Authentication
77- `POST /api/login/` - User login
78- `POST /api/logout/` - User logout
79- `POST /api/register/` - User registration
80- `POST /api/send-verification-code/` - Send verification code for registration
81- `POST /api/forgot-password/` - Request password reset
82- `POST /api/reset-password/` - Reset password with verification code
8384### Profile
85- `GET /api/profile/` - Get user profile
86- `PUT /api/profile/` - Update user profile
87- `POST /api/upload-documents/` - Upload user documents
8889## Template Pages
1"""
2URL configuration for jobrapido project.
3"""
4from django.contrib import admin
10urlpatterns = [
11path('admin/', admin.site.urls),
12path('', include('api.urls')), # Include API URLs at the root
13]
14
11path('complete-profile/', views.CompleteProfileTemplateView.as_view(), name='complete-profile'),
12
13# API endpoints
14path('api/login/', views.LoginView.as_view(), name='login'),
15path('api/logout/', views.LogoutView.as_view(), name='logout'),
16path('api/register/', views.RegisterView.as_view(), name='register'),
17path('api/send-verification-code/', views.SendVerificationCodeView.as_view(), name='send-verification-code'),
18path('api/forgot-password/', views.ForgotPasswordView.as_view(), name='forgot-password'),
19path('api/reset-password/', views.ResetPasswordView.as_view(), name='reset-password'),
20
21# Profile API endpoints
22path('api/profile/', views.UserProfileView.as_view(), name='api-profile'),
23path('api/upload-documents/', views.DocumentUploadView.as_view(), name='upload-documents'),
24]
8from django.utils.decorators import method_decorator
9from rest_framework import status, generics, permissions
10from rest_framework.views import APIView
11from rest_framework.response import Response
12from rest_framework.decorators import api_view, permission_classes
13from rest_framework.permissions import IsAuthenticated, AllowAny
14from .models import UserProfile, VerificationCode, Document, Education
137138139class LoginView(APIView):
140"""API view for user login"""
141permission_classes = [AllowAny]
142
178179180class LogoutView(APIView):
181"""API view for user logout"""
182permission_classes = [IsAuthenticated]
183
188189190class SendVerificationCodeView(APIView):
191"""API view to send verification code for registration"""
192permission_classes = [AllowAny]
193
219220221class RegisterView(APIView):
222"""API view for user registration"""
223permission_classes = [AllowAny]
224
234235236class ForgotPasswordView(APIView):
237"""API view for password reset"""
238permission_classes = [AllowAny]
239
274275276class ResetPasswordView(APIView):
277"""API view to reset password with verification code"""
278permission_classes = [AllowAny]
279
318319320class UserProfileView(APIView):
321"""API view for user profile management"""
322permission_classes = [IsAuthenticated]
323
339340341class DocumentUploadView(APIView):
342"""API view for document uploads"""
343permission_classes = [IsAuthenticated]
344
funappprofile.html1 match
1{% extends 'base.html' %}
23{% block title %}Jobrapido - Your Profile{% endblock %}
45{% block content %}
funappcomplete_profile.html1 match
1{% extends 'base.html' %}
23{% block title %}Jobrapido - Complete Your Profile{% endblock %}
45{% block content %}