Skip to content

CyriacduChatenet/ESD-Travel-tailor

Repository files navigation

Travel tailor

TypeScript Nest.js PostgreSQL

TypeScript next Tailwind.CSS

docker vercel pnpm Prettier

mapbox stripe aws s3 supabase

jest


Project structure

Lib schema



API structure

Lib schema


This project use multiple internal libs and apps. all are orgnaized in two folders at the PNPM workspace root (apps & packages).

- apps
| - api
| - client
- packages
| - constants
| - contexts
| - functions
| - hooks
| - services
| - types
| - utils

.env example

  • API env var
    API_PORT =
    ADMINER_PORT =
    CLIENT_APP_URL =
    API_URL =
    JWT_SECRET =
    POSTGRESQL_DATABASE_TYPE =
    POSTGRESQL_DATABASE_HOST =
    POSTGRESQL_DATABASE_PORT =
    POSTGRESQL_DATABASE_NAME =
    POSTGRESQL_DATABASE_USERNAME =
    POSTGRESQL_DATABASE_PASSWORD =
    MAILDEV_PORT =
    STRIPE_API_KEY =
  • Client env var
    NEXT_PUBLIC_API_URL =
    NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN =
    NEXT_PUBLIC_STRIPE_API_KEY =

API makefile

.PHONY: up
up:
	docker-compose up -d

.PHONY: down
down:
	docker-compose down

.PHONY: install
install:
	npm install

.PHONY: reset
reset:
	docker volume rm $$(docker volume ls -q) && docker rmi $$(docker images -q)

.PHONY: resetf
resetf:
	docker stop $$(docker ps -a -q) \
	&& docker rm $$(docker ps -a -q) \
	&& docker rmi $$(docker images -q) \
	&& docker volume rm $$(docker volume ls -q) \
	&& docker system prune -a -f

.PHONY: dev
dev: 
	npm run start:dev

.PHONY: init
init: up install dev

Run project

install dependancies

pnpm i

run project in parallel

pnpm -r --parallel run dev

run project individualy

pnpm

pnpm --filter api run dev 
pnpm --filter client run dev 

npm

cd apps/api && npm run dev
cd apps/client && npm run dev

Build project

  • build client web app

    pnpm

    pnpm --filter client run build

    npm

    cd apps/client && npm run build

  • build api

    pnpm

    pnpm --filter api run build

    npm

    cd apps/api && npm run build

Deployed environements


Class diagram