This repository contains a full-stack web application, Orchid, built with a React frontend and a NestJS backend. It's designed as a social media or blogging platform, featuring user authentication, story/post management, commenting, and liking functionalities.
The project is organized as a monorepo with two main applications:
orchid-api-nest/: The backend API built with NestJS.orchid-react/: The frontend client built with React.
A robust and scalable RESTful API built with NestJS.
- Framework: NestJS
- Database/ORM: PostgreSQL with Prisma ORM
- Authentication: Passport.js (JWT, Local strategies)
- API Documentation: Swagger (OpenAPI) and Scalar API Reference
- Data Mapping: AutoMapper for object-to-object mapping.
- Validation:
class-validator - Configuration:
@nestjs/configfor environment variables. - Package Manager: pnpm
- User Authentication: Secure user login/registration with JWT-based authentication.
- User Management: CRUD operations for users.
- Story Management: Create, read, update, and delete stories/posts.
- Commenting System: Users can comment on stories.
- Liking Mechanism: Functionality to like stories or comments.
- API Documentation: Automatically generated interactive API documentation available at
/referenceendpoint. - CORS Configuration: Configured to allow requests from the React frontend running on
http://localhost:5173.
- Navigate to the backend directory:
cd orchid-api-nest - Install dependencies (using pnpm):
pnpm install
- Configure Environment Variables:
Create a
.envfile inorchid-api-nest/and configure your PostgreSQL database connection string and JWT secrets.DATABASE_URL="postgresql://user:password@localhost:5432/database_name" JWT_SECRET="your_jwt_secret" # Add any other environment variables as required by the application
- Run Prisma Migrations and Seed (Optional):
npx prisma migrate dev --name init npx prisma db seed
- Start the Backend API:
The API will be available at
pnpm run start:dev
http://localhost:3000(or your configured port). API documentation will be accessible athttp://localhost:3000/reference.
A dynamic and interactive client application built with React.
- Framework: React
- Build Tool: Vite (using
rolldown-vitefor optimized performance) - UI/Styling:
- Material-UI (MUI) for rich UI components.
- Tailwind CSS for utility-first styling.
- Icon libraries:
lucide-react,remixicon,react-icons.
- State Management: Redux Toolkit
- Routing: React Router
- HTTP Client: Axios
- User Interface: Modern and responsive UI built with Material-UI and Tailwind CSS.
- Dynamic Content: Fetches and displays stories, comments, and user profiles from the NestJS API.
- Interactive Elements: Users can create, edit, delete, comment on, and like stories.
- Client-side Routing: Seamless navigation using React Router.
- Global State Management: Manages application state efficiently with Redux Toolkit.
- Navigate to the frontend directory:
cd orchid-react - Install dependencies (using pnpm):
pnpm install
- Start the Frontend Development Server:
The frontend application will be available at
pnpm run dev
http://localhost:5173(or your configured Vite port).
To run the complete full-stack application, you need to:
- Follow the Backend Installation & Setup steps to get the NestJS API running.
- Follow the Frontend Installation & Setup steps to get the React client running.
Ensure both applications are running concurrently in separate terminal windows.