This project features a completely fictional company named Tailor'Pulp, created for illustrative purposes. All company names, brands, products, employees, or locations mentioned in the code, frontend are fictitious.
Any resemblance to a real company, whether existing or defunct, is purely coincidental. These references do not imply any affiliation with or endorsement by any real entity.
The project is an e-commerce web application with :
- NodeJS server back-end (Dockerfile)
- React front-end (Dockerfile)
- db : init.sql file for PostgreSQL database
- docker-compose.yml at the root to orchestrate services
The App set up section details all the steps to set up and launch the web application with Docker
Have a Stripe account in developer mode with API keys associated with the test environment specifically :
Secret Stripe key format : sk_test_...
Public Stripe key format : pk_test_...
Use the test card numbers provided by Stripe for fake transactions. More information on https://docs.stripe.com/
Have generated an ID for Google OAuth2.0 Have generated the secret key for reCAPTCHA
More information on https://console.cloud.google.com/
Have generated an App Password for Google SMTP (optional if another SMTP service is selected)
e.g. Cookies, JWT Token
git clone https://github.com/alextechbuild/.gitNavigate to the repository
cd your_repositoryCreate .env files. Two .env files are necessary
Create .env file and add the following environment variables (the values should be adapted according to your API keys for the different services) :
# --- Db host (dev mode : complete with 'localhost' for dev mode, otherwise complete with db service name for Docker (postgres_db by default))
DB_HOST="postgres_db"
# --- Front-end URL ---
FRONT_END_URL="https://localhost:3000"
# --- Cron (leader variable on this specific instance only (mettre false sur tout le reste des .env)) ---
IS_LEADER="true"
# --- Nodemailer ---
SMTP_DOMAIN="smtp.gmail.com"
SMTP_PORT="587"
ASSISTANCE_EMAIL="tailorpulpassistance@example.com"
# --- Db credentials ---
PGHOST="localhost"
PGPORT="5432"
PGDATABASE="tailor_pulp_db"
# --- Back-end port ---
PORT="4000"
# --------------------------- TO BE COMPLETED ---------------------------
# --- Cookies (e.g. jose) ---
COOKIE_SECRET="cookie_secret"
# --- JWT Token (e.g. jose) ---
JWT_SECRET="jwt_secret"
# --- Google OAuth2.0 Client ID (for .aud) ---
GOOGLE_OAUTH_CLIENT_ID=""
# --- Payment Service (Stripe) ---
STRIPE_SECRET_KEY=""
# --- Google reCAPTCHA ---
RECAPTCHA_SECRET_KEY=""
# --- Nodemailer host email (e.g. for Google : @gmail.com address) ---
HOST_EMAIL=""
# --- Nodemailer host password (e.g. for @gmail.com address : Google App Password) ---
HOST_PASSWORD=""
# --- Asymmetric encryption public key (for data encryption between server and db) ---
PUBLIC_KEY=""
# --- Asymmetric encryption private key (for data encryption between server and db) ---
PRIVATE_KEY=""
# --- Db credentials ---
PGUSER=""
PGPASSWORD=""
Create .env file and add the following environment variables (the values should be adapted according to your API keys for the different services) :
# --- HTTPS ---
VITE_HTTPS="true"
# --- Front-end port ---
PORT="3000"
# --- Back-end URL ---
VITE_BACKEND_URL="https://localhost:4000"
# --------------------------- TO BE COMPLETED ---------------------------
# --- Google OAuth2.0 Client ID ---
VITE_GOOGLE_OAUTH_CLIENT_ID=""
# --- Google reCAPTCHA ---
VITE_RECAPTCHA_WEBSITE_KEY=""
sudo apt install libnss3-tools
wget -O mkcert https://github.com/FiloSottile/mkcert/releases/latest/download/mkcert-v1.4.4-linux-amd64
chmod +x mkcert
sudo mv mkcert /usr/local/bin/mkcert -installIn './back-end/certs/' folder :
mkdir certs
cd certs
mkcert localhost 127.0.0.1 ::12 files will be generated :
localhost+2.pem localhost+2-key.pem
sudo apt update -y
sudo apt upgrade -y
sudo apt install postgresql postgresql-contribsudo systemctl status postgresqlOtherwise, for launching and activating postgreSQL on boot :
sudo systemctl start postgresql
sudo systemctl enabled postgresqlsudo -i -u postgrespsqlCREATE USER nickname WITH PASSWORD 'your_password';ALTER USER nickname CREATEDB;
CREATE DATABASE tailor_pulp_db WITH OWNER nickname;
\qpsql -h localhost -U nickname -d tailor_pulp_db -W;Then copy paste init.sql
psql -h localhost -U nickname -d tailor_pulp_db -W;sudo apt update -y
sudo apt upgrade -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"sudo apt-get install docker-ce docker-ce-cli containerd.io -ysudo docker --versionsudo systemctl start docker
sudo systemctl enable dockersudo docker run hello-worldsudo usermod -aG docker $USERdocker-compose up --builddocker-compose upIn a web browser, type https://localhost:3000
This project uses images generated by artificial intelligence for illustrative purposes
- Tool : Perchance
- Purpose : illustrative visuals for the front-end
- No image depicts a real or identifiable person
- The images were generated solely for artistic and non-commercial purposes
- The prompts used comply with the ethical rules and terms of use of the Perchance platform
- Images generated via Perchance may be used freely within the scope of this project
- Their use remains subject to the Perchance Terms of Use
- Please mention Perchance as the source if you reuse these visuals in another public context
For licence compatibility reasons, the original font used in the design of the site (CabinetGrotesk) is not included in this MIT version.
All CSS declarations of the type :
font-family: 'CabinetGrotesk-Variable', ...;have been replaced by :
font-family: Arial, Helvetica, sans-serif;The screenshots shown in the repository use the original font solely for visual purposes only. If you wish to find or use this font, you can download or embed it for free from FontShare.
- ⭐️ By leaving a star on this GitHub repository
- 📢 By sharing this project with your network
- 📝 By leaving feedback
