A robust backend system designed for the management and administration of cemetery spaces. This project was developed as a technical proof of concept to demonstrate scalable architecture in managing spatial inventories, reservations, and user assignments within a defined sector/park structure.
- Structural Management: Define and organize cemetery layouts through Parks and Sectors (Heads).
- Space Inventory (Details): Granular control over individual spaces (graves/niches) including coordinates (row/column), pricing, and types (Border, Center, Path).
- Status Tracking: Real-time status management for every space (Available, Sold, Reserved, Not Available).
- Reservation System: Logic to link users to specific spaces, handling availability checks and assignment.
- User Management: Basic structure for managing client data.
- Modular Architecture: Built with NestJS modules for high maintainability and separation of concerns.
- Framework: NestJS (Node.js)
- Language: TypeScript
- Database: PostgreSQL
- ORM: TypeORM
- Containerization: Docker & Docker Compose
- Package Manager: NPM
Note: Please check
package.jsonfor the full list of dependencies.
Follow these instructions to get a copy of the project up and running on your local machine for development and testing purposes.
- Node.js (v16 or higher)
- npm (v9 or higher)
- Docker & Docker Compose (for the database) (Optional)
-
Clone the repository:
git clone https://github.com/igidio/bdi-backend.git cd bdi-backend -
Install the dependencies:
npm install
-
Environment Configuration: Rename the template environment file and configure your variables:
cp .template.env .env
-
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
-
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
-
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- 📁 src/
- 📁 head/: Manages the macro structure (Parks/Sectors).
- 📁 detail/: Manages individual units/spaces and their coordinates.
- 📁 reservation/: Handles the logic for booking spaces.
- 📁 user/: User entity management.
- 📁 database/: Database configuration and connection logic.
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.
This project is licensed under the MIT License - see the 📄LICENSE.md file for details.