diff --git a/README.md b/README.md index 2ac51c7..5eade70 100644 --- a/README.md +++ b/README.md @@ -1 +1,65 @@ -# LabManager \ No newline at end of file +# VR Lab Manager + +The purpose of this project of is to create system for organizing and managing equipment in addition to managing borrowing and returning of equipment. +Initially made for the IMTEL VR Lab at NTNU but it is also usable for other inventories. + +## Features + +- Add edit and delete equipment +- Manage borrowing and returning of equipment +- Keep track of borrowers and equipment usage +- Manage inventory administrators + +## Build and run your own instance + +### Requirements + +- A computer with Docker installed + +### Instructions + +1. Build a Docker image using the Dockerfile in ./labman. Run ``docker build -t labman .`` +2. Use the provided compose.yaml to run the application and make to make a .env file in the same directory containing the variables reqiored by compose.yaml. +3. In compose.yaml, replace the labman image with name of the image you built in step 1. +4. Start the application by running `docker compose up -d` in the same directory as compose.yaml +5. Open `http://localhost:5000` and login with your own preferred credentials to start using the application + +## Develop + +### Database +This project uses PostgreSQL as the database, using Prisma as the ORM. + +1. Create a PostgreSQL database using your preferred method +2. Make an .env file with the database connection string: `DATABASE_URL=postgres://{username}:{password}@{route}/{database}?schema=public + +### Run the application + +1. Clone the repository +2. Run `cd labman` +3. Run `npm install` +4. Run `npm prisma generate` to generate the Prisma client +5. Run `npm prisma migrate dev` to run the database migrations +6. Run `npm run dev` to start the development server +7. Open `http://localhost:3000` and login with your own preferred credentials to make a user to access the application + + +# FAQ + +- **Can I use this application for managing other types of inventory?** + +Yes, the current name is misleading. The application is perfectly suitable for other things than VR equipment too. + +- **I forgot the credentials to my accounts?** + +As of now, there is no way to recover lost accounts. If no one has access to create a new account for you, you can directly manipulate the database to delete all users, +which will force the creation of a new account on the next login attempt. + +- **Is it safe to store sensitive information in the database?** + +Everything is hosted locally with no external connections, and the login passwords are encrypted. Though if you are hosting the application publicly, it is your own responsibility to host it securely. + + + + + + diff --git a/labman/LabManager-task-definition.json b/labman/LabManager-task-definition.json deleted file mode 100644 index 1d33584..0000000 --- a/labman/LabManager-task-definition.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "taskDefinitionArn": "arn:aws:ecs:eu-north-1:861353196312:task-definition/LabManager-task:1", - "containerDefinitions": [ - { - "name": "nextjs-lab", - "image": "861353196312.dkr.ecr.eu-north-1.amazonaws.com/lab-repository@sha256:e7cdbf6f8318d5c7a55d534faa467df83a3dd9f9e9663068abef74fd19ff41d1", - "cpu": 0, - "portMappings": [ - { - "name": "main", - "containerPort": 3000, - "hostPort": 3000, - "protocol": "tcp", - "appProtocol": "http" - } - ], - "essential": true, - "environment": [], - "environmentFiles": [], - "mountPoints": [], - "volumesFrom": [], - "ulimits": [], - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": "/ecs/LabManager-task", - "awslogs-create-group": "true", - "awslogs-region": "eu-north-1", - "awslogs-stream-prefix": "ecs" - }, - "secretOptions": [] - }, - "systemControls": [], - "secrets": [ - { - "name": "DATABASE_URL", - "valueFrom": "arn:aws:secretsmanager:eu-north-1:861353196312:secret:lab/prod/db-connection-3F8gP9:DATABASE_URL::" - - } - ] - } - ], - "family": "LabManager-task", - "executionRoleArn": "arn:aws:iam::861353196312:role/ecsTaskExecutionRole", - "networkMode": "awsvpc", - "revision": 1, - "volumes": [], - "status": "ACTIVE", - "requiresAttributes": [ - { - "name": "com.amazonaws.ecs.capability.logging-driver.awslogs" - }, - { - "name": "ecs.capability.execution-role-awslogs" - }, - { - "name": "com.amazonaws.ecs.capability.ecr-auth" - }, - { - "name": "com.amazonaws.ecs.capability.docker-remote-api.1.19" - }, - { - "name": "com.amazonaws.ecs.capability.docker-remote-api.1.21" - }, - { - "name": "ecs.capability.execution-role-ecr-pull" - }, - { - "name": "com.amazonaws.ecs.capability.docker-remote-api.1.18" - }, - { - "name": "ecs.capability.task-eni" - }, - { - "name": "com.amazonaws.ecs.capability.docker-remote-api.1.29" - } - ], - "placementConstraints": [], - "compatibilities": [ - "EC2", - "FARGATE", - "MANAGED_INSTANCES" - ], - "requiresCompatibilities": [ - "FARGATE" - ], - "cpu": "1024", - "memory": "3072", - "runtimePlatform": { - "cpuArchitecture": "X86_64", - "operatingSystemFamily": "LINUX" - }, - "registeredAt": "2026-01-29T14:16:22.647Z", - "registeredBy": "arn:aws:iam::861353196312:root", - "enableFaultInjection": false, - "tags": [] -} \ No newline at end of file diff --git a/labman/src/app/(auth)/login/page.tsx b/labman/src/app/(auth)/login/page.tsx index f51a5a7..e6b1b15 100644 --- a/labman/src/app/(auth)/login/page.tsx +++ b/labman/src/app/(auth)/login/page.tsx @@ -30,18 +30,22 @@ export default function Home() { } return ( -
-

VR Lab Management

-
-

Login

-
- setUsername(e.target.value)} type="text" name="username" placeholder="Username" className="bg-white rounded-md p-2 m-2 placeholder-black text-black" /> - setPassword(e.target.value)} type="password" name="password" placeholder="Password" className="bg-white rounded-md p-2 m-2 placeholder-black text-black" /> - -
-
- -
+ <> +
+

VR Lab Management

+
+

Login

+
+ setUsername(e.target.value)} type="text" name="username" placeholder="Username" className="bg-white rounded-md p-2 m-2 placeholder-black text-black" /> + setPassword(e.target.value)} type="password" name="password" placeholder="Password" className="bg-white rounded-md p-2 m-2 placeholder-black text-black" /> + +
+
+
+

v1.0.0

+ + + );