Skip to content

back end services to users scheduling appointments, or accessing records.

Notifications You must be signed in to change notification settings

snoozexx/Siap_Be

Repository files navigation

Siap Backend

This is a Clean Architecture Express.js backend for Siap App.

Prerequisites

  • Node.js
  • MySQL Database

Setup

  1. Install Dependencies

    npm install
  2. Environment Variables Copy .env.example (or just check .env) and update your database credentials and Brevo API key.

    DATABASE_URL="mysql://root:password@localhost:3306/siap_db"
    JWT_SECRET="your_secret"
    BREVO_API_KEY="your_brevo_api_key"
  3. Database Setup Make sure your MySQL server is running. Then run migrations:

    npx prisma migrate dev --name init
  4. Seed Data Populate the database with initial data (Home menus, activities, etc.):

    npm run prisma:seed

Running the App

  • Development:

    npm run dev
  • Production:

    npm run build
    npm start

API Endpoints

Auth

  • POST /api/v1/auth/register - { firstName, email, password }
  • POST /api/v1/auth/verify-otp - { email, otp }
  • POST /api/v1/auth/login - { email, password }

Profile

  • GET /api/v1/profile/me - Get current user profile (Headers: Authorization: Bearer )
  • PUT /api/v1/profile/me - Update profile { firstName, lastName, dob, country }

Home

  • GET /api/v1/home - Get Menus, Activities, Job Recommendations

Project Structure

  • src/domain: Entities and Interfaces (Business Rules)
  • src/application: Use Cases (Application Logic)
  • src/data: Repositories (Data Access)
  • src/infrastructure: External Services (DB, Mail, Auth)
  • src/presentation: Controllers, Routes, Middlewares (HTTP Layer)

About

back end services to users scheduling appointments, or accessing records.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published