Skip to content

G9-fullstack/motorshop-server

Repository files navigation

MotorShop


MotorShop is an application that allows the registration and management of regular users and car sellers. Sellers can create car ads for sale and manage their ads through a control panel. Users can register, buy available cars, visit the seller’s profile, and view detailed information about each ad, including description, photos, values, and comments. The home page displays cars recently added by sellers and offers various search filters.


This repository contains the code for the back-end of the application. The front-end code can be found in the MotorShop repository.


Features

  • Secure registration and login system for regular users and car sellers;
  • Personal dashboard for sellers to manage their car ads;
  • Sellers can create, edit, and delete car ads;
  • Detailed information about each ad, including description, photos, values, and comments;
  • Home page displays cars recently added by sellers and offers various search filters;
  • Users can buy available cars and visit the seller’s profile;
  • Developed with modern technologies such as Nest.js, Prisma.js, TypeScript, and PostgreSQL.

Live Version

Visit the live version of the application hosted at MotorShop - Website to see it in action.


Configuration

Before starting to use the project, it is necessary to configure some environment variables. Create a .env file in the root of the project with the following information:

APP_PORT=<port>
DATABASE_URL="postgresql://<username>:<password>@<host>:<port>/<database>?schema=public"
SECRET_KEY=<secret_key>

Installation

Installing and running the project is easy and fast. Just follow these steps:

  1. Clone this repository to your local machine.
  2. Install dependencies: yarn install.
  3. Make sure you have a PostgreSQL database set up and update the DATABASE_URL variable in the .env file with your database information.
  4. Run npx prisma migrate dev to apply the database migrations.
  5. Start the development server by running yarn dev.

The application should now be running on http://localhost:<port>, where <port> is the value of the APP_PORT variable in the .env file.


Database Commands

The project includes some commands for managing the database. Here is a list of available commands:

  • npx prisma migrate dev --name <migration_name>: generates a new migration with the specified name and applies it to the development database.
  • npx prisma migrate dev: applies pending migrations to the development database.
  • npx prisma migrate reset: resets the development database and applies all migrations from scratch.

To use these commands, simply type the desired command into your terminal. For example:

npx prisma migrate dev --name create_users_table
npx prisma migrate dev
npx prisma migrate reset

Technologies used

  • Nest.js: progressive Node.js framework for building efficient and scalable server-side applications.
  • Prisma.js: next-generation ORM for Node.js and TypeScript.
  • TypeScript: typed programming language that increases code productivity and readability.
  • PostgreSQL: robust and reliable relational database management system.

Contributing

To contribute to this project, please follow these guidelines:

  1. Fork the repository
  2. Create a new branch: git checkout -b feat/yourFeatureName
  3. Make your changes and commit them using Conventional Commits
  4. Push to the branch: git push origin feat/yourFeatureName
  5. Submit a pull request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published