Frontend Vue3 + Typescript + Vite + Pinia + Vue Router
Backend TypeScript + Express + Mongoose + MongoDB
I created a backend API made with NodeJs Express Typescript and use a dummy/public API in frontend. Basically the users are created in mongodb database (MongoDB Atlas) and the backend API is fetching the user from the public API and return the user info and token in login.
What I am showcasing here is a can create a full-stack application with different tooling, environments and testing while I can integrate third-party APIs and microservices.
Note: Please Read README.md inside subdirectories for best practices and features
Clone the repo:
$ git clone --depth 1 git@github.com:ratribiana/vue3-vite-typesript-pinia-exam.git
$ cd vue3-vite-typesript-pinia-exam
Go to the backend directory and install the dependencies:
$ cd backend
$ yarn install or npm install
Note: Disregard the error in husky (postinstall), that will run after the full install is finish. It is used for linting commit messages, running tests, linting code, etc... when commiting or pushing code to repo
Go to the frontend directory and install the dependencies:
$ cd frontend
$ yarn install or npm install
Make sure to copy the .env.example
/.env-example
or rename them to .env.development
in each sub directories (backend/frontend).
Note: Env files are not suppose to push in repo but for this case I used .env.example
and .env-example
to put the database and mail service credentials
$ cd backend
$ yarn dev
yarn build
yarn test
yarn seed ${model} <number> [type(optional)] [role(optional)]
yarn seed roles 1 newrole NewRole
yarn seed users 1 users users
yarn clearDB
$ cd frontend
$ yarn dev
yarn build
Run Unit Tests with Vitest
yarn test:unit
Run End-to-End Tests with Cypress
yarn test:e2e:dev
Once you are setup, you can use these credentials or you can register your own user. The backend API will send you the OTP directly to your email
$ test3@mailinator.com
$ P@ssw0rd01