Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 65 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,65 @@
# LabManager
# 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.






97 changes: 0 additions & 97 deletions labman/LabManager-task-definition.json

This file was deleted.

28 changes: 16 additions & 12 deletions labman/src/app/(auth)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,22 @@ export default function Home() {

}
return (
<div className="mx-auto w-fit">
<h1 className="mx-auto w-fit font-bold text-6xl my-8">VR Lab Management</h1>
<div className="my-80">
<h1 className="font-bold text-5xl mx-auto w-fit">Login</h1>
<form onSubmit={handleSubmit} className="flex flex-col gap-5 pt-4">
<input value={username} onChange={(e) => setUsername(e.target.value)} type="text" name="username" placeholder="Username" className="bg-white rounded-md p-2 m-2 placeholder-black text-black" />
<input value={password} onChange={(e) => setPassword(e.target.value)} type="password" name="password" placeholder="Password" className="bg-white rounded-md p-2 m-2 placeholder-black text-black" />
<button type="submit" className="bg-green-500 text-black rounded-md p-2 m-2 font-bold">LOGIN</button>
</form>
</div>

</div>
<>
<div className="mx-auto w-fit">
<h1 className="mx-auto w-fit font-bold text-6xl my-8">VR Lab Management</h1>
<div className="my-80">
<h1 className="font-bold text-5xl mx-auto w-fit">Login</h1>
<form onSubmit={handleSubmit} className="flex flex-col gap-5 pt-4">
<input value={username} onChange={(e) => setUsername(e.target.value)} type="text" name="username" placeholder="Username" className="bg-white rounded-md p-2 m-2 placeholder-black text-black" />
<input value={password} onChange={(e) => setPassword(e.target.value)} type="password" name="password" placeholder="Password" className="bg-white rounded-md p-2 m-2 placeholder-black text-black" />
<button type="submit" className="bg-green-500 text-black rounded-md p-2 m-2 font-bold">LOGIN</button>
</form>
</div>
</div>
<p className={"text-gray-300 text-2xl mb-3 ml-3 fixed bottom-0"}>v1.0.0</p>
</>




);
Expand Down
Loading