A marketplace application where users can buy, sell, and rent products.
- Node.js (version 16 or higher)
- Docker
- pnpm (package manager)
Follow these steps in order:
Open your terminal in the project folder and run:
pnpm installThis will download and install all the required packages for both the frontend and backend.
The project uses PostgreSQL as its database, which runs in a Docker container.
Start the PostgreSQL container:
docker compose up -d postgresWait a few seconds for the database to fully start up.
Create a .env file in the apps/server folder with the database connection:
cd apps/serverCreate a file named .env and add this line:
DATABASE_URL=postgres://teebay:123@localhost:5432/teebay
Run the database migrations:
npx prisma migrate devThis creates all the necessary tables in your database.
Go back to the root folder and start everything:
cd ../..
docker compose upThis command starts both:
- The backend server
- The frontend web application
Once everything is running, open your browser and go to:
http://localhost:8000
The backend API will be running at:
http://localhost:5173
Press Ctrl + C in the terminal where docker compose up is running.
To stop all containers completely:
docker compose downProblem: Database connection errors
Solution: Make sure the PostgreSQL container is running with docker compose up -d postgres
Problem: Port already in use
Solution: Stop any other applications using ports 8000 or 5173
Problem: Changes to database not showing
Solution: Run migrations again: cd apps/server && npx prisma migrate dev
This project uses a monorepo setup, which means multiple applications live in one repository and share dependencies.
Instead of having separate repositories for the frontend and backend, everything is in one place. This makes it easier to:
- Share code between applications
- Manage dependencies in one place
- Run everything together with a single command
teebay/
├── apps/
│ ├── server/ # Backend API (Node.js + GraphQL)
│ │ ├── prisma/ # Database schema and migrations
│ │ ├── src/ # Server source code
│ │ └── .env # Database configuration
│ └── web/ # Frontend application (React)
│ ├── src/ # Frontend source code
│ └── public/ # Static files
├── docker-compose.yaml # Defines all containers (database, server, frontend)
├── package.json # Root dependencies and scripts
└── pnpm-workspace.yaml # Tells pnpm this is a monorepo
- apps/server: Handles all the business logic, database operations, and provides a GraphQL API
- apps/web: The user interface that talks to the server API
- Docker Compose: Runs everything in containers so you don't need to manually start each service
- pnpm workspaces: Manages all dependencies for both apps from the root folder
- User registration and login
- List products for sale or rent
- Browse available products
- Buy products
- Rent products for specific durations
- View product details and statistics
- Manage your own products