Skip to content

adrian1715/desempregados.com

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

81 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’Ό desempregados.com

Desempregados.com Banner

A support platform for unemployed professionals in Brazil

"Welcome, unemployed! How can we help you today?"

Live Demo GitHub Stars GitHub Issues License Language

🌐 Live Demo β€’ πŸ“ Report Bug β€’ ✨ Request Feature

Note: This project was originally developed in Portuguese for the Brazilian market. The platform interface is in Portuguese (pt-BR).


πŸ“‹ Table of Contents


🎯 About the Project

desempregados.com (literally "Unemployed.com" in Portuguese) is a full-stack web platform built with Node.js, Express, and MongoDB for the Brazilian job market.

πŸ’‘ Why This Project?

This platform provides:

  • 🎯 Career Guidance - Resources and guides for job placement
  • πŸ“š Career Pages - Dynamic career information and resources
  • 🀝 Community Platform - Connection between candidates and companies
  • πŸ’Ό Job Listings - Post and browse job opportunities
  • πŸ‘₯ Dual User Roles - Separate interfaces for candidates and companies

🌍 Localization

Designed specifically for the Brazilian market:

  • πŸ‡§πŸ‡· Interface entirely in Brazilian Portuguese (pt-BR)
  • πŸ“ Focus on Brazilian labor market regulations
  • πŸ’° Salary information in Brazilian Real (BRL)
  • πŸ“‹ Compliance with Brazilian labor laws and LGPD
  • 🏒 Tailored for Brazilian employment culture

✨ Key Features

πŸ” Authentication System

  • Email-based login with Passport.js
  • Dual user roles: Candidates and Companies
  • Session management with express-session

πŸ‘€ User Profiles

  • Separate models for Candidates and Companies
  • Profile creation and management
  • Admin role support

πŸ’Ό Job Management

  • Create, read, update, and delete job listings
  • Company-specific job postings
  • Job search and filtering

πŸ“„ Career Pages

  • Dynamic career resource pages
  • Content management system
  • Educational materials and guides

πŸ“Έ Image Upload

  • Cloudinary integration for file storage
  • Profile pictures and company logos
  • Optimized image handling

🎨 Responsive UI

  • Bootstrap 5 framework
  • Bootstrap Icons
  • Mobile-friendly design
  • Custom CSS styling

πŸ”” Flash Messages

  • Success and error notifications
  • User feedback system

πŸ“ Logging System

  • Request logging with UUID
  • Error tracking and monitoring

πŸ› οΈ Tech Stack

🎨 Frontend

  • Template Engine - EJS (Embedded JavaScript)
  • Layout Engine - EJS-Mate
  • CSS Framework - Bootstrap 5
  • Icons - Bootstrap Icons
  • Styling - Custom CSS3
  • JavaScript - Vanilla JS

βš™οΈ Backend

  • Runtime - Node.js
  • Framework - Express.js
  • Template Engine - EJS
  • Session Store - express-session
  • Flash Messages - connect-flash
  • HTTP Method Override - method-override

πŸ—„οΈ Database & ODM

  • Database - MongoDB
  • ODM - Mongoose
  • Schema Models:
    • User (with role-based profiles)
    • Candidate
    • Company
    • Job
    • Career
    • CareerPage

πŸ” Authentication

  • Strategy - Passport.js
  • Plugin - passport-local-mongoose
  • Method - Email-based authentication (custom strategy)
  • Session Management - express-session with cookies

☁️ File Upload & Storage

  • Cloud Storage - Cloudinary
  • Upload Middleware - Multer
  • Storage - multer-storage-cloudinary
  • Supported Formats - JPEG, JPG, PNG

πŸ› οΈ Utilities & Helpers

  • Environment Variables - dotenv
  • Date Formatting - date-fns
  • Unique IDs - uuid
  • Async Handling - express-async-handler

πŸš€ Infrastructure & Deployment

  • Hosting - Render.com
  • Database Hosting - MongoDB Atlas
  • SSL - Automatic HTTPS (Render)
  • Process Manager - nodemon (development)

πŸ“¦ Development Tools

  • Version Control - Git / GitHub
  • Package Manager - npm
  • Development Server - nodemon

πŸš€ Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v14.x or higher)

    node --version
  • npm (comes with Node.js)

    npm --version
  • MongoDB (local or Atlas account)

  • Cloudinary Account (for image uploads)

Installation

  1. Clone the repository

    git clone https://github.com/adrian1715/desempregados.com.git
    cd desempregados.com
  2. Install dependencies

    npm install
  3. Set up environment variables

    Create a .env file in the project root:

    touch .env

    Add the following variables (see Environment Variables section for details)

  4. Set up MongoDB

    Option A: Local MongoDB

    # Start MongoDB service
    mongod
    
    # The connection will be:
    # DB_URL=mongodb://localhost:27017/desempregados

    Option B: MongoDB Atlas

    • Create a cluster on MongoDB Atlas
    • Get your connection string
    • Replace <password> and database name in the connection string
  5. Start the development server

    npm start

    This will start nodemon on port 3000 (or your specified PORT)

  6. Open in browser

    Navigate to http://localhost:3000

Environment Variables

Create a .env file in the project root with the following variables:

# Node Environment
NODE_ENV=development

# Server Configuration
PORT=3000

# MongoDB Database
DB_URL=mongodb://localhost:27017/desempregados
# For MongoDB Atlas, use:
# DB_URL=mongodb+srv://<username>:<password>@cluster.mongodb.net/desempregados?retryWrites=true&w=majority

# Session Secret (use a strong random string)
SESSION_SECRET=your_super_secret_session_key_here_change_in_production

# Cloudinary Configuration (for image uploads)
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_KEY=your_cloudinary_api_key
CLOUDINARY_SECRET=your_cloudinary_api_secret

Getting Your Credentials

MongoDB Atlas:

  1. Create account at MongoDB Atlas
  2. Create a cluster (free tier available)
  3. Click "Connect" β†’ "Connect your application"
  4. Copy the connection string
  5. Replace <password> with your database user password

Cloudinary:

  1. Sign up at Cloudinary
  2. Go to Dashboard
  3. Copy your Cloud Name, API Key, and API Secret
  4. Paste into .env file

Session Secret:

  • Generate a strong random string:
    node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

πŸ’» Usage

For Candidates (Job Seekers)

  1. Register

    • Go to /cadastro (Registration)
    • Select "Candidate" role
    • Fill in your information
    • Create account
  2. Browse Jobs

    • Navigate to /vagas (Jobs)
    • Filter by category, location, or company
    • View job details
  3. Apply for Jobs

    • Click on job listing
    • View requirements and description
    • Apply directly through the platform
  4. Manage Profile

    • Update your information
    • Upload profile picture
    • Track your applications

For Companies (Employers)

  1. Register

    • Go to /cadastro (Registration)
    • Select "Company" role
    • Fill in company details
    • Create account
  2. Post Jobs

    • Navigate to /vagas/new (New Job)
    • Fill in job details
    • Publish listing
  3. Manage Listings

    • View all your job postings
    • Edit or delete jobs
    • Track applications
  4. Company Profile

    • Update company information
    • Upload company logo
    • Manage job listings

For Admins

  • Access admin panel for content management
  • Manage career pages and resources
  • Monitor platform activity
  • Moderate content

πŸ“ Project Structure

desempregados.com/
β”œβ”€β”€ config/                    # Configuration files
β”‚   β”œβ”€β”€ cloudinary.js         # Cloudinary setup
β”‚   └── db.js                 # MongoDB connection
β”‚
β”œβ”€β”€ middlewares/              # Express middlewares
β”‚   β”œβ”€β”€ auth.js               # Authentication middleware
β”‚   β”œβ”€β”€ errorHandler.js       # Error handling
β”‚   β”œβ”€β”€ getPages.js           # Page fetching middleware
β”‚   └── logEvents.js          # Request logging
β”‚
β”œβ”€β”€ models/                   # Mongoose models
β”‚   β”œβ”€β”€ User.js               # User model (with roles)
β”‚   β”œβ”€β”€ Candidate.js          # Candidate profile
β”‚   β”œβ”€β”€ Company.js            # Company profile
β”‚   β”œβ”€β”€ Job.js                # Job listings
β”‚   β”œβ”€β”€ Career.js             # Career resources
β”‚   └── CareerPage.js         # Career pages
β”‚
β”œβ”€β”€ routes/                   # Express routes
β”‚   β”œβ”€β”€ api/                  # RESTful API routes
β”‚   β”‚   β”œβ”€β”€ index.js          # API router
β”‚   β”‚   β”œβ”€β”€ users.js          # User API
β”‚   β”‚   β”œβ”€β”€ careers.js        # Career API
β”‚   β”‚   β”œβ”€β”€ careerPages.js    # Career Pages API
β”‚   β”‚   └── jobs.js           # Jobs API
β”‚   β”œβ”€β”€ auth.js               # Authentication routes
β”‚   β”œβ”€β”€ careers.js            # Career page routes
β”‚   β”œβ”€β”€ jobs.js               # Job listing routes
β”‚   └── index.js              # Main routes
β”‚
β”œβ”€β”€ views/                    # EJS templates
β”‚   β”œβ”€β”€ layouts/              # Layout templates
β”‚   β”‚   └── boilerplate.ejs   # Main layout
β”‚   β”œβ”€β”€ pages/                # Page templates
β”‚   β”‚   β”œβ”€β”€ auth/             # Login/Register pages
β”‚   β”‚   β”œβ”€β”€ carreiras/        # Career pages
β”‚   β”‚   β”œβ”€β”€ vagas/            # Job pages
β”‚   β”‚   β”œβ”€β”€ index.ejs         # Homepage
β”‚   β”‚   β”œβ”€β”€ candidatos.ejs    # Candidates page
β”‚   β”‚   β”œβ”€β”€ empresas.ejs      # Companies page
β”‚   β”‚   └── sobre.ejs         # About page
β”‚   β”œβ”€β”€ partials/             # Reusable components
β”‚   β”‚   β”œβ”€β”€ auth/             # Auth forms
β”‚   β”‚   β”œβ”€β”€ navbar.ejs        # Navigation bar
β”‚   β”‚   β”œβ”€β”€ footer.ejs        # Footer
β”‚   β”‚   └── flash.ejs         # Flash messages
β”‚   └── error.ejs             # Error page
β”‚
β”œβ”€β”€ public/                   # Static files
β”‚   β”œβ”€β”€ css/                  # Stylesheets
β”‚   β”‚   β”œβ”€β”€ styles.css        # Global styles
β”‚   β”‚   β”œβ”€β”€ auth.css          # Auth page styles
β”‚   β”‚   β”œβ”€β”€ index.css         # Homepage styles
β”‚   β”‚   └── careers/          # Career page styles
β”‚   β”œβ”€β”€ js/                   # Client-side JavaScript
β”‚   β”‚   β”œβ”€β”€ app.js            # Main app JS
β”‚   β”‚   β”œβ”€β”€ auth/             # Auth scripts
β”‚   β”‚   β”œβ”€β”€ careers/          # Career scripts
β”‚   β”‚   └── jobs/             # Job scripts
β”‚   β”œβ”€β”€ img/                  # Images
β”‚   β”‚   β”œβ”€β”€ home/             # Homepage images
β”‚   β”‚   └── footer/           # Footer icons
β”‚   └── bootstrap/            # Bootstrap files
β”‚       β”œβ”€β”€ bootstrap.min.css
β”‚       β”œβ”€β”€ bootstrap.bundle.js
β”‚       β”œβ”€β”€ validateForm.js
β”‚       └── icons/            # Bootstrap Icons
β”‚
β”œβ”€β”€ utils/                    # Utility functions
β”‚   β”œβ”€β”€ CustomError.js        # Custom error class
β”‚   β”œβ”€β”€ validation.js         # Validation helpers
β”‚   └── string.js             # String utilities
β”‚
β”œβ”€β”€ .env                      # Environment variables (not in repo)
β”œβ”€β”€ .gitignore               # Git ignore rules
β”œβ”€β”€ index.js                 # Application entry point
β”œβ”€β”€ package.json             # Dependencies and scripts
β”œβ”€β”€ package-lock.json        # Dependency lock file
β”œβ”€β”€ README.md                # This file (English)
└── README-ptbr.md           # Portuguese README

πŸ”Œ API Routes

Authentication

  • POST /cadastro - User registration
  • POST /login - User login
  • GET /logout - User logout

Jobs (Vagas)

  • GET /vagas - List all jobs
  • GET /vagas/new - New job form (companies only)
  • POST /vagas - Create new job
  • GET /vagas/:id - View job details
  • GET /vagas/:id/edit - Edit job form
  • PUT /vagas/:id - Update job
  • DELETE /vagas/:id - Delete job

Careers (Carreiras)

  • GET /carreiras - List all careers
  • GET /carreiras/new - New career form (admin only)
  • POST /carreiras - Create new career
  • GET /carreiras/:id - View career details
  • GET /carreiras/:id/edit - Edit career form
  • PUT /carreiras/:id - Update career
  • DELETE /carreiras/:id - Delete career
  • GET /carreiras/:id/pages - Career pages

RESTful API (JSON)

  • GET /api/users - Get users
  • GET /api/jobs - Get jobs (JSON)
  • GET /api/careers - Get careers (JSON)
  • GET /api/careerPages - Get career pages (JSON)

Public Pages

  • GET / - Homepage
  • GET /candidatos - Candidates page
  • GET /empresas - Companies page
  • GET /sobre - About page

🀝 Contributing

Contributions make the open-source community an amazing place to learn and create. Any contributions are greatly appreciated!

How to Contribute

  1. Fork the Project

  2. Create your Feature Branch

    git checkout -b feature/AmazingFeature
  3. Commit your Changes

    git commit -m 'feat: Add some AmazingFeature'
  4. Push to the Branch

    git push origin feature/AmazingFeature
  5. Open a Pull Request

πŸ“ Commit Standards

We follow Conventional Commits:

  • feat: - New feature
  • fix: - Bug fix
  • docs: - Documentation changes
  • style: - Code formatting
  • refactor: - Code refactoring
  • test: - Adding tests
  • chore: - Maintenance tasks

🌍 Language Guidelines

  • Code: English comments preferred
  • UI/UX: Portuguese (pt-BR) required
  • Documentation: Both English and Portuguese
  • Commits: English preferred, Portuguese accepted
  • Issues/PRs: Either language acceptable

πŸ› Reporting Bugs

Use GitHub Issues:

  • Clear description of the problem
  • Steps to reproduce
  • Expected vs actual behavior
  • Screenshots if applicable
  • Environment details (browser, OS)

πŸ“ License

Distributed under the MIT License. See LICENSE file for more information.


πŸ“§ Contact

Adrian - @adrian1715

Project Link: https://github.com/adrian1715/desempregados.com

Live Demo: https://desempregados-com.onrender.com/


πŸ™ Acknowledgments

  • Node.js - JavaScript runtime
  • Express.js - Web framework
  • MongoDB - NoSQL database
  • Mongoose - MongoDB ODM
  • Passport.js - Authentication middleware
  • EJS - Embedded JavaScript templating
  • Bootstrap - CSS framework
  • Cloudinary - Image hosting and management
  • Render.com - Free and reliable hosting
  • The Brazilian tech community for their support
  • All contributors who helped build this platform

πŸ’ͺ Support the Project

  • ⭐ Star this repository
  • πŸ› Report bugs and suggest improvements
  • πŸ’» Contribute code
  • πŸ“’ Share with other professionals
  • πŸ’¬ Provide feedback

πŸ“Š Project Status

GitHub last commit GitHub commit activity GitHub top language


πŸ‡§πŸ‡· Para falantes de portuguΓͺs

Este README estΓ‘ disponΓ­vel em portuguΓͺs brasileiro. Clique aqui para ler em portuguΓͺs.


"Unemployed today, employed tomorrow. We believe in you!"

"Desempregado hoje, empregado amanhΓ£. NΓ³s acreditamos em vocΓͺ!"

⬆ Back to Top

About

A full-stack web platform built with Node.js, Express, and MongoDB for the Brazilian job market.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors