Coder Social home page Coder Social logo

pandakn / react-nest-take-home Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 12.95 MB

repo for take home assignment

Makefile 1.27% JavaScript 6.40% Dockerfile 0.54% HTML 0.56% TypeScript 88.57% CSS 2.68%
docker nestjs reactjs shadcn-ui take-home-test

react-nest-take-home's Introduction

React-Nestjs Take Home Assignment

Getting started ๐Ÿš€

Clone this repository

git clone https://github.com/pandakn/react-nest-take-home.git

cd react-nest-take-home

Install dependencies using npm

cd client
npm install

cd server
npm install

After this step, you will get node_modules folder in the root of the project.

Start Docker Compose for Database ๐Ÿณ

docker-compose -p blog-take-home-dev -f docker-compose-dev.yml up -d

Setup .env for Database ๐Ÿณ

// Create a `.env` file in the root of the project.
touch .env

// .env
POSTGRES_HOST=host.docker.internal
POSTGRES_PORT=5432
POSTGRES_USER=pandakn
POSTGRES_PASSWORD=secretpassword
POSTGRES_DB=blog_take_home

Setup .env for Client ๐Ÿ‘€

cd client
touch .env

// .env
VITE_API_URL=http://localhost:8080

Setup .env for Server ๐ŸŒ

cd server
touch .env

// .env
NODE_ENV=development
APP_PORT=8080

PUBLIC_KEY=GP+ycIZcNictqKJcKzlAFdMFhshX60n3K8Q6LQjPxDA

POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER=pandakn
POSTGRES_PASSWORD=secretpassword
POSTGRES_DB=blog_take_home

# cli for generate a secure random string -> `openssl rand -base64 32`
JWT_SECRET_KEY=KFSBsWrhiNipEf2g/4Slh2jREDw0mtFKwFfu+DWXrog

Note : You can find all .env file configurations in .env.example each folder

Start Client ๐Ÿ‘€

cd client

npm run dev

The frontend will run at localhost:3000 or you can port change

Start Server ๐ŸŒ

cd server

npm run start:dev

The backend will run at localhost:8080 or you can port change

Run Seed Data ๐ŸŒฑ

cd server

npm run seed:run

How to run test backend ๐Ÿงช

cd server

npm run test

Note : This test for users.service.ts is so simple because I am learning unit testing and TDD. I'm ready to improve myself.

Mock User for Login

username: takehome
password: 12345678

Screenshot ๐Ÿ“ธ

image

image

image

image

react-nest-take-home's People

Contributors

pandakn avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.