Before running the project, ensure you have the following installed:
- Node.js (v14 or higher) - Download Node.js
- PostgreSQL - Download PostgreSQL
- pgAdmin - Download pgAdmin
- Open pgAdmin and log in.
- Create a new database named
CooksyTest(or any name you prefer). - Open Query Tool in pgAdmin.
- Click on Open File and select the provided
CooksyInit.sqlfile. - Execute the script to set up the database schema and seed data.
- Open your terminal and navigate to the
/backenddirectory:cd backend - Install the required Node.js packages:
npm install
-
Create a
.envfile in the/backenddirectory: -
Add the following environment variables:
GOOGLE_CLIENT_ID="80723078627-5ddlpq0m430tv125huoesjdaennfqo7b.apps.googleusercontent.com" GOOGLE_CLIENT_SECRET="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" SESSION_SECRET="TOPSECRETWORD" # App Configuration PORT=5000 NODE_ENV=development # Database Configuration PG_USER="postgres" PG_HOST="localhost" PG_DATABASE="CooksyTest" PG_PASSWORD="postgres" PG_PORT="5432" # JWT Secret JWT_SECRET="B982C2D692D51C11AFC7A8595C7CC" JWT_EXPIRATION=1d # Email Service Configuration EMAIL_HOST=smtp.gmail.com EMAIL_PORT=587 EMAIL_USER=cooksy.info@gmail.com EMAIL_PASSWORD=vskr eheu ueqz btsa EMAIL_FROM=cooksy.info@gmail.com # Crypto Key for Verification Codes CRYPTO_SECRET="Y0U3RV3RY50D3CR3TK3Y"
Note:
- Update
PG_USERandPG_PASSWORDaccording to your PostgreSQL credentials. - You can use the provided Google account for SMTP services (for account activation).
npm run dev- Open a new terminal and navigate to the
/frontenddirectory:cd frontend - Install the required Node.js packages:
npm install
-
Create a
.envfile in the/frontenddirectory: -
Add the following variables:
VITE_APP_BACKEND_URL="http://localhost:5000" VITE_APP_SPOONACULAR_API_KEY="" VITE_APP_SPOONACULAR_BASE_URL="https://api.spoonacular.com"
Note:
- Sign up at Spoonacular and add your API key to
VITE_APP_SPOONACULAR_API_KEY.
npm run dev- Open your browser and go to
http://localhost:5173. - The application should now be running smoothly!
- Ensure PostgreSQL is running and accessible.
- Verify
.envvariables are correctly set. - Check for any missing dependencies with
npm install.
Enjoy using Cooksy! 🍳