Skip to content

Tonio2/boilerplate

Repository files navigation

Project Name

Description

This project is a full-stack application with a React frontend and an Express backend. It includes user authentication, email verification, password reset, and more.

For more detailed documentation, please refer to the prd.

Prerequisites

Installation

  1. Clone the repository:
git clone https://github.com/Tonio2/boilerplate.git
cd boilerplate
  1. Create environment variable files:
# Gloabl env variables
cp .env.example .env
  1. Update the .env files with your configuration.

  2. Install dependencies for both client and server:

# Install server dependencies
cd server
npm install

# Install client dependencies
cd ../client
npm install
  1. Initiate db schemas:
# Start db
docker compose up -d

# Initiate schemas
cd server
npm run db:push

Running the Project

  1. Start the postgres server:
docker compose up -d
  1. Start the backend server:
cd server
npm run dev
  1. Start the frontend client:
cd client
npm start

Testing

The server uses Vitest with a dedicated PostgreSQL container for integration tests.

docker compose up -d postgres-test   # Start the test database
cd server && npm test                # Push schema + run tests
cd server && npm run test:watch      # Watch mode

Push to prod

TODO

Your app is accessible at http://localhost:5000 and the api at http://localhost:5000/api

Database Management

Development Commands

# Push schema changes to database (development only)
npm run db:push

# Generate migration files
npm run db:generate

# Run migrations (production)
npm run db:migrate

# Open Drizzle Studio (database GUI)
npm run db:studio

Accessing the Database

Via Drizzle Studio:

cd server
npm run db:studio

Opens at https://local.drizzle.studio

Via psql CLI:

docker exec -it boilerplate-postgres psql -U postgres -d boilerplate

Via any PostgreSQL client:

  • Host: localhost
  • Port: 5432
  • Database: boilerplate
  • Username: postgres
  • Password: postgres

Start a new project

Initialize the project

git clone https://github.com/Tonio2/boilerplate.git new_project
cd new_project

Update remotes

git remote rename origin upstream
git remote add origin git@github.com:toi/mon-nouveau-projet.git
git push -u origin main

Update boiler

git fetch upstream
git merge upstream/main

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors