Skip to content

mle-moni/galadrim-tools

Repository files navigation

Galadrim Tools

  • real time room booking tool
  • real time restaurant rating tool

galadrim tools home

see some other sample images here

Setup

  • use Node.js 20 (.nvmrc)
  • corepack enable
  • pnpm install
  • for the backend you will need a mysql database (docker setup)

Environment

on the frontend you need to create a .env you can copy and use the default .env.example

VITE_API_URL=http://localhost:3000/api
VITE_SOCKET_API_URL=http://localhost:3333

on the backend you need to create a .env you can copy and modify .env.example

the part you will need to adapt is the database connection settings

DB_HOST
DB_PORT
DB_USER
DB_PASSWORD
DB_DATABASE

Database

Docker mysql database (optional)

If you have Docker installed, you can run

  • docker compose up -d db

It will launch a MySQL server exposed on localhost:3310 (edit this in docker-compose.yml if needed).

Backend env values when using Docker defaults:

  • DB_HOST=127.0.0.1
  • DB_PORT=3310
  • DB_USER=root
  • DB_PASSWORD=root
  • DB_DATABASE=galadrim_tools

database setup

  • cd libs/shared
  • pnpm build
  • cd ./apps/backend
  • node ace migration:run
  • node ace db:seed

Start project

  • pnpm dev

⚠️ when updating a file in libs/shared you might need to restart frontend watcher

Adonis CLI tool

on the backend you have access to a node script file ace: cd ./apps/backend node ace --help

you can read documentation about it here

some commands that you could need

# display all API routes with controller method used
node ace list:routes

# start a read-eval-print-loop with your project loaded
node ace repl

adonis repl documentation

Test project

When you write complex logic, try to write tests

to test all, you can run pnpm test

or to test only one project, you can do pnpm test:backend pnpm test:frontend

Build project

pnpm build:shared pnpm build:backend pnpm build:frontend

Contributing

  • fork the repo
  • create a branch: git checkout -b feat/awesomeNewFeature
  • commit and push your changes
  • make sure project can be built without errors, and tests still pass
  • create pull request

About

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors