Skip to content

August7337/SAE_Leboncoin_CS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

237 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SAE Leboncoin CS

.NET 8 Vue 3 Vite Tailwind CSS PostgreSQL

Full-stack school project inspired by Leboncoin: listings, users, bookings, messaging, and incident management, with a .NET 8 API and a Vue 3 client.

Table of Contents

  1. Overview
  2. Tech Stack
  3. Project Structure
  4. Prerequisites
  5. Installation
  6. Environment Variables Configuration
  7. Running the Project
  8. Migrations Entity Framework
  9. Useful Commands

Overview

This repository contains a full rental marketplace application:

  • Backend: REST API in ASP.NET Core (.NET 8) with Entity Framework Core
  • Frontend: SPA Vue 3 avec Vite et Tailwind CSS
  • Database: PostgreSQL

Tech Stack

  • Backend: ASP.NET Core, Entity Framework Core, Swagger
  • Frontend: Vue 3, Vue Router, Vite, Tailwind CSS
  • Data: PostgreSQL
  • Tooling: dotnet-ef, npm

Project Structure

SAE_Leboncoin_CS/
|- LeboncoinAPI/
|  |- LeboncoinAPI.sln
|  |- LeboncoinAPI/
|     |- Controllers/
|     |- Models/
|     |- Migrations/
|     |- Program.cs
|
|- LeboncoinClient/
	|- src/
	|- tests/
	|- vite.config.js

Prerequisites

  • .NET SDK 8
  • Node.js 18+ et npm
  • PostgreSQL
  • (optional) global dotnet-ef tool

Installation

1. Clone the project

git clone <repository-url>
cd SAE_Leboncoin_CS

2. Install frontend dependencies

cd LeboncoinClient
npm install

3. Restore backend dependencies

cd ../LeboncoinAPI/LeboncoinAPI
dotnet restore

Environment Variables Configuration

The backend reads database configuration from a .env file in LeboncoinAPI/LeboncoinAPI/.

Example:

DB_HOST=localhost
DB_PORT=5432
DB_NAME=leboncoin
DB_USER=postgres
DB_PASS=postgres

The frontend can use VITE_API_BASE_URL via .env or .env.local in LeboncoinClient/.

Example:

VITE_API_BASE_URL=http://localhost:5150

Running the Project

Open 2 terminals:

Terminal 1 - API

cd LeboncoinAPI/LeboncoinAPI
dotnet run --launch-profile "https"

API available by default at:

  • https://localhost:7057
  • http://localhost:5150

Swagger (dev mode):

  • https://localhost:7057/swagger

Terminal 2 - Frontend

cd LeboncoinClient
npm run dev

Frontend available by default at:

  • http://localhost:5173

Migrations Entity Framework

Install the tool (if needed):

dotnet tool install --global dotnet-ef --version 8.0.23

From the LeboncoinAPI/LeboncoinAPI folder:

# Add a migration
dotnet ef migrations add <NomMigration> --project "LeboncoinAPI"

# Apply migrations
dotnet ef database update --project "LeboncoinAPI"

# Generate SQL script
dotnet ef migrations script --project "LeboncoinAPI"

# Remove the last migration (not applied)
dotnet ef migrations remove --project "LeboncoinAPI"

Useful Commands

Backend

cd LeboncoinAPI/LeboncoinAPI
dotnet build
dotnet test ../LeboncoinAPITests

Frontend

cd LeboncoinClient
npm run dev
npm run build
npm run format

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors