Skip to content

paluras/adoptProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Animal Adoption

This is a full-stack animal adoption application built with React, TypeScript, Redux, and Vite on the frontend, and Node.js, Express, and PostgreSQL on the backend.

First image Second image

Features

  • User Management: Users can register, log in, and manage their posted animals.
  • Animal Listings: Users can upload animals available for adoption, including images and details.
  • Animations: Smooth UI animations powered by @react-spring/web.
  • Markdown Support: Use of a markdown editor for rich-text content with sanitation for security.
  • Routing: Dynamic routing for navigating between pages using react-router-dom.
  • State Management: Efficient global state management with @reduxjs/toolkit.
  • Form Handling: Axios is used for form submissions and API interactions.
  • File Uploads: Handle image uploads using Multer.
  • Input Validation: Express-validator for request validation.
  • Authentication: Secure JWT-based authentication with bcrypt for password hashing.
  • Responsive Design: Styled with TailwindCSS for a mobile-friendly and responsive design.

Tech Stack

Frontend

  • React, TypeScript, Vite
  • Redux for state management
  • React Router for routing
  • TailwindCSS for styling
  • Axios for HTTP requests
  • @react-spring/web for animations
  • Markdown Support: react-md-editor and react-markdown

Backend

  • Node.js, Express, TypeScript
  • PostgreSQL database
  • JWT Authentication with jsonwebtoken and bcrypt
  • File Uploads with Multer
  • Validation using express-validator
  • Testing setup with Jest, Supertest, and pg-mem for database testing

Getting Started

Prerequisites

Ensure you have the following installed:

  • Node.js (version 14+)
  • PostgreSQL

Installation

  1. Clone the repository:
git clone https://github.com/paluras/adoptProject.git
  1. Navigate to the project directory:
cd animal-adoption
  1. Install frontend and backend dependencies:
cd frontend/animal-adoption
npm install

cd backend
npm install
  1. Set up environment variables for both the frontend and backend. Copy .env.example to .env and configure the database and API credentials.

Running the Frontend

  • Start the development server:
npm run dev
  • Build for production:
npm run build
  • Preview the production build locally:
npm run preview

Running the Backend

  • Start the development server with Nodemon:
npm run dev
  • Start the production server:
npm start

Running Tests

For the backend, run the test suite with Jest:

npm test

To watch for file changes and re-run tests:

npm run test:watch

Folder Structure

Frontend

  • src/: Contains the React components, Redux store, and other frontend logic.
  • public/: Static assets and HTML file for the frontend.

Backend

  • src/server.ts: Entry point for the backend server.
  • src/controllers/: Business logic for API routes.
  • src/routes/: Defines all API routes.
  • src/middleware/: Custom middleware (authentication, error handling, etc.).
  • src/models/: Contains database models and interactions.

Contributing

Feel free to open issues or pull requests. Contributions are welcome!

License

This project is licensed under the ISC License.

About

A small CRUD app for animal adoptions

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors