This is an inventory app, made with nodejs, hono and remix. These are some of the features:
- End to end authorization and authentication, the app is fully auth guarded so only logged in users can access. Login and register with ease.
- Role based authorization of actions, there are 2 roles,
admin
andguest
, and admin can create, read, update and delete an item while theguest
can onlyread
. - Search, sort and paginate inventory items.
- Profile page to view user details.
Screen.Recording.2024-03-16.at.3.48.33.AM.mov
Visit the live demo here
Note
Your session might be revoked if there is another new active session with the same login. If you find data not showing, that might be the case. Fixing it is simply logout and login again(Yes, the other user will be logged off).
- Go to backend directory
cd backend
- Create your
.env
or rename the.env.development
- Start a local postgres db, replace the
DATABASE_URL
in the.env
with your postgres url - Run
pnpm run setup
and then runpnpm run dev:all
- Your server should be running on port 3000, visit http://localhost:3000/health_check and if it returns "ok", you are good to go!
- Go to frontend directory
cd frontend
- Create your
.env
or rename the.env.development
- Run
pnpm install
&pnpm run dev
- Your app should be running on port 5173, visit
http://localhost:5173/login
and if it returns the login page, you are good to go!
- You can seed the db by running
pnpm run seed
from thebackend
directory. - Upon seeding, you should have 2 users:
khairul
with guest role, andadmin
with admin role, the passwords are in/backend/scripts/seed.ts
- You can run the backend tests with
pnpm run test
from thebackend
directory
- You can deploy at any service that supports docker. For me I used fly.io, and you can use the same configuration.
- Make sure you have installed fly cli with an account. Go to
backend
directory, runfly launch
, then, runfly deploy
. - Your app is deployed ๐
- Same method as frontend, the only difference is you run it from the
frontend
directory.