Skip to content

igidio/emplea.me-backend-services

Repository files navigation

EMPLEAME Backend Services

The EMPLEAME Backend is the server-side application that handles business logic, data management, and integrations with external services. It's an API focused on efficiently serving data using GraphQL and managing real-time events via WebSockets.

Features

  • GraphQL API: Flexible and typed data querying using Apollo Server (Code-First).
  • Advanced Authentication: JWT-based auth with support for Local, Google, and Facebook strategies.
  • Role-Based Access Control: Granular permissions for Admins, Employers, and Job Seekers.
  • Payment Ecosystem: Full integration with Stripe for subscriptions and one-time payments.
  • Real-time Engine: WebSockets gateway for instant notifications and updates.
  • Media Management: Cloudinary integration for optimized image uploading and processing.
  • Transactional Email: Automated email workflows via Nodemailer.

Technologies Used

  • Core: NestJS (v10)
  • Language: TypeScript
  • Database: PostgreSQL & TypeORM
  • API: GraphQL & Socket.io
  • Payments: Stripe SDK
  • Validation: Class-validator & Joi

Getting Started

Prerequisites

  • Node.js (v18+)
  • PostgreSQL (running locally or via Docker)
  • npm or pnpm

Installation

  1. Clone the repository:

    git clone https://github.com/igidio/emplea.me-backend-services.git
    cd emplea.me-backend-services
  2. Install dependencies:

    npm install
    # or
    pnpm install
  3. Environment Configuration: Rename the template environment file and configure your variables:

    cp .template.env .env
  4. Database Setup: If you have Docker installed, configure the file 📄 docker-compose.yaml with the appropriate settings for your PostgreSQL instance. Then, run the following command to start the PostgreSQL database:

    docker-compose up -d
  5. Run Database Migrations and Seeds: Ensure your database is running and execute the migrations and seeds to set up the schema:

    # Run TypeORM migrations
    npm run typeorm:generate
    # Run seeders to populate initial data
    npm run seed:fresh
  6. Start the Application:

    npm run start:dev

If everything is set up correctly, the application should now be running on http://localhost:3000.

Extra: if you want to use husky for git hooks and commit lints, run:

npx husky init

Project Structure

  • 📁 src/
    • 📄 app.module.ts - Main application module
    • 📄 main.ts - Entry point of the application
    • 📁 common/ - Shared utilities, guards, interceptors, and decorators
    • 📁 config/ - Configuration files and environment settings
    • 📁 modules/ - Feature modules (Auth, Users, Jobs, Payments, etc.)
    • 📁 gateways/ - WebSocket gateways for real-time communication
    • 📁 prisma/ - Esquema de base de datos y seeds

Scripts

  • npm run start:dev - Start the application in development mode with hot-reloading.
  • npm run build - Compile the TypeScript code into JavaScript.
  • npm run typeorm:generate - Generate database migrations based on entity changes.
  • npm run typeorm:migrate - Run pending migrations to update the database schema.
  • npm run typeorm:drop - Drop the database schema (use with caution).
  • npm run seed:fresh - Run seeders to populate the database with initial data.
  • npm run seed - Run seeders without dropping the database.

License

This project is licensed under the MIT License - see the 📄LICENSE.md file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published