https://github.com/imseanconroy/cookbook
All your recipes in one place
https://github.com/imseanconroy/cookbook
express full-stack nodejs postgres react typescript
Last synced: 8 months ago
JSON representation
All your recipes in one place
- Host: GitHub
- URL: https://github.com/imseanconroy/cookbook
- Owner: ImSeanConroy
- License: mit
- Created: 2025-06-22T16:47:11.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-08-28T19:54:52.000Z (10 months ago)
- Last Synced: 2025-08-29T01:37:49.895Z (10 months ago)
- Topics: express, full-stack, nodejs, postgres, react, typescript
- Language: TypeScript
- Homepage:
- Size: 13.2 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cookbook: all your recipes in one place
Fullstack cookbook application built using PostgreSQL, Express, React, and Node.
## Table of Contents
- [Getting Started](#getting-started)
- [1. Prerequisites](#1-prerequisites)
- [2. Installation](#2-installation)
- [3. Frontend Setup:](#3-frontend-setup)
- [4. Backend \& Database Setup:](#4-backend--database-setup)
- [Development and Testing](#development-and-testing)
- [Project Structure](#project-structure)
- [Contributing](#contributing)
- [License](#license)
- [Support](#support)
## Getting Started
### 1. Prerequisites
Before getting started, ensure you have the following installed:
- [Node.js](https://nodejs.org/)
- [npm](https://www.npmjs.com/)
### 2. Installation
Follow these steps to set up the application locally:
1. **Clone the repository**:
```bash
git clone https://github.com/imseanconroy/cookbook.git
cd cookbook
```
### 3. Frontend Setup:
1. **Install Dependencies**: Navigate to the `frontend` directory and install required dependencies:
```bash
cd frontend
npm install
```
2. **Configure Environment Variables**: Create a `.env` file in the frontend directory with the following content:
```env
VITE_API_BASE_URL=http://localhost:8000
```
3. **Start Frontend Development Server**: Run the following command to start the frontend development server:
```bash
npm run dev
```
### 4. Backend & Database Setup:
1. **Install Backend Dependencies**: Navigate to the `backend` directory and install the required dependencies:
```bash
cd backend
npm install
```
2. **Configure Environment Variables**: Create a `.env` file in the `backend` directory with the following content:
```env
PORT=8000
NODE_ENV=development
READ_ONLY=false
SESSION_SECRET=example
SESSION_EXPIRES_IN=1d
FRONTEND_ORIGIN=http://localhost:5173
PGADMIN_DEFAULT_EMAIL=
PGADMIN_DEFAULT_PASSWORD=
POSTGRES_PASSWORD=
POSTGRES_USER=
POSTGRES_DB=
POSTGRES_PORT=5432
POSTGRES_HOST=localhost
DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
```
3. **Start Docker Container**: Run the following command to start the Docker container:
```env
docker compose up -d
```
4. **Access PGAdmin**: Open your browser and go to `localhost:5050` to log in to PGAdmin using the credentials defined in the .env file. Once logged in, connect to PostgreSQL and connect to the database matching the name defined in `{POSTGRES_DB}`.
5. **Run Database Migrations**: Use PG-migrate to set up the database tables by running:
```
DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB} npm run migrate:up
```
6. **Start Backend Development Server**: Run the following command to start the backend development server:
```bash
npm run dev
```
## Development and Testing
Run all backend tests with the following command:
```bash
cd backend
npm run test
```
## Project Structure
```
cookbook/
├── frontend/ # React application for the user interface
├── backend/ # Express.js server with PostgreSQL integration
│ ├── migrations/ # Database migration files
│ ├── test/ # Backend tests
│ ├── src/ # Backend source code
│ │ ├── config/ # Database and environment configurations
│ │ ├── controllers/ # API request handlers
│ │ ├── middleware/ # Request processing logic (e.g., auth, logging)
│ │ ├── repositories/ # Database queries and schema models
│ │ ├── routes/ # API endpoint definitions
│ │ ├── services/ # Core business logic
│ │ └── util/ # Utility functions (e.g., validation, logging)
└── README.md # Project documentation
```
## Contributing
Contributions are welcome. Please open an issue or submit a pull request for any enhancements or bug fixes.
## License
This project is Distributed under the MIT License - see the [LICENSE](LICENSE) file for information.
## Support
If you are having problems, please let me know by [raising a new issue](https://github.com/ImSeanConroy/cookbook/issues/new/choose).