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.
- 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.
Visit the live version of the application hosted at MotorShop - Website to see it in action.
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>
Installing and running the project is easy and fast. Just follow these steps:
- Clone this repository to your local machine.
- Install dependencies:
yarn install
. - Make sure you have a PostgreSQL database set up and update the DATABASE_URL variable in the .env file with your database information.
- Run
npx prisma migrate dev
to apply the database migrations. - 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.
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
- 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.
To contribute to this project, please follow these guidelines:
- Fork the repository
- Create a new branch:
git checkout -b feat/yourFeatureName
- Make your changes and commit them using Conventional Commits
- Push to the branch:
git push origin feat/yourFeatureName
- Submit a pull request