GreenShadow API is a RESTful backend system for managing crops, fields, equipment, vehicles, staff, and logs. Built with Node.js, Express, Prisma ORM tool and supports JWT authentication for secure access to resources.
-
Secure:
- Implements robust login and signup functionality with JWT tokens.
- Offers role-based access control, accommodating roles such as ADMIN, MANAGER, SCIENTIST, and OTHER.
-
Resource Management:
- CRUD operations for crops, fields, equipment, vehicles, staff, and logs.
- Runtime Environment: Node.js
- Security: Spring Security with JWT
- Database: MySQL (configurable)
- Environment Management: dotenv
- Java 21 or later.
- Gradle build tool.
- MySQL database.
-
Clone the repository:
https://github.com/DasunNirmal/Green-Shadow-With-Prisma.git
-
Install dependencies:
npm install
-
Set up environment variables in .env file:
DATABASE_URL="mysql://your-user-name:your-password@localhost:3306/green_shadow_prisma?createDatabaseIfNotExist=true"
-
Then run this commands to create the database:
npx prisma db push npx prisma generate
GreenShadow API employs Spring Security to ensure secure access to resources. JWT tokens, issued upon successful authentication, are mandatory for accessing protected endpoints.
- ADMIN: Full access to all endpoints.
- MANAGER: Restricted access to certain CRUD operations.
- SCIENTIST/OTHER: Limited read/write permissions.