Code Monkey home page Code Monkey logo

nest-template's Introduction

Tipicos Delivery - Ravn Challenge V2

Welcome to Tipicos Delivery.

Getting Started

Requirements

Setting up the project

  1. Clone the repository

    git clone https://github.com/jramaya/Ravn-Challenge-V2-EdgarAmaya.git
    cd Ravn-Challenge-V2-EdgarAmaya
  1. Install dependencies

    Using npm:

    npm install

    Using yarn:

    yarn install
  2. Set up the PostgreSQL database with Docker

    The project uses Docker to run PostgreSQL. Use the provided docker-compose.db.yml file to spin up the database.

    docker-compose -f docker-compose.db.yml up -d
  3. Create the .env file

    Copy the .env.example file and rename it to .env.

    cp .env.example .env

    Update the variables in the .env file according to your PostgreSQL setup:

    POSTGRES_USER=<your_postgres_user>
    POSTGRES_PASSWORD=<your_postgres_password>
    POSTGRES_DB=<your_database_name>
    DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:5432/${POSTGRES_DB}?schema=public
  4. Run Prisma migrations

    To set up the database schema, run the Prisma migrations:

    npx prisma migrate dev

    Alternatively, if you want to customize the migration SQL file:

    npx prisma migrate dev --create-only
  5. Generate Prisma Client

    After running the migration, generate the Prisma Client for database interaction:

    npx prisma generate
  6. Seed the database

    Run the seeding script to populate the database with some initial data:

    npm run seed
  7. Start the NestJS server

    For development mode with hot reload:

    npm run start:dev

    For production mode:

    npm run start:prod

    For debugging with VSCode:

    npm run start:debug
  8. Access the API

    The REST API documentation is available via Swagger at:

    http://localhost:3000/api
    

    GraphQL Playground can be accessed at:

    http://localhost:3000/graphql
    

Features

  • Authentication Endpoints
    • Signup
    • Signin
    • Signout (by deleting jwt on client)
  • Product Management
    • List products with pagination
    • Search products by category
    • Add, update, delete, and disable products (for managers)
  • User Roles
    • Manager: Full control over products, view client orders
    • Client: Browse products, see details, buy products
  • Testing
    • Unit tests with Jest (aiming for 80% coverage)
  • Linting
    • Use npm run lint

Next Steps

  • Finish implementing CRUD for Cart and Order
  • like products
  • Implement extra features for bonus points, including:
    • E2E testing
    • Forgot password functionality
    • Email notifications for product stock
    • Deployment on Heroku

Checklist

  • Authentication endpoints (sign up, sign in, sign out)
  • List products with pagination
  • Search products by category
  • Manager role functionality (create, update, delete, disable products, view orders)
  • Client role functionality (view products, product details, like products, buy products)
  • Cart functionality (CRUD operations for cart)
  • Order functionality (CRUD operations for orders)
  • Email notifications
  • Swagger documentation
  • Unit tests
  • Extra features (e2e testing, stock notifications, password reset)
  • Deploy to Heroku

Notes

This project uses the template from nestjs-prisma-starter for initial setup.

nest-template's People

Contributors

marcjulian avatar renovate-bot avatar jramaya avatar leohxj avatar dependabot-support avatar luluhoc avatar sitogi avatar chaunceyau avatar edbond88 avatar fabiofdsantos avatar longtomjr avatar oupsla avatar therocket avatar alan2207 avatar ruheni avatar haotan19 avatar hymair avatar mfakhrusy avatar 100lvlmaster avatar cha2hyun avatar thomaschaaf avatar megazoll avatar pluveto avatar dependabot[bot] avatar yuval-hazaz avatar zlwu 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.