This guide provides exact steps to set up and run the Architect X project (The Unknowns S-T) locally.
- Frontend: React + Vite + Tailwind CSS
- Backend: Node.js (Express) + Prisma (PostgreSQL)
Ensure you have the following installed on your system:
- Node.js (v18 or higher recommended)
- npm (comes with Node.js)
- PostgreSQL (or a cloud provider like Neon)
Navigate to the Backend directory and install the required dependencies:
cd Backend
npm installCreate a .env file in the Backend directory. You can use the provided .env.example as a template:
cp .env.example .envDefine the following variables in your .env file:
DATABASE_URL: Your PostgreSQL connection string. (e.g.,postgresql://user:password@host:port/database?sslmode=require)JWT_SECRET: A secure random string for signing JWT tokens. (e.g.,your_very_secret_key_here)PORT: (Optional) The port where the backend server will run. Defaults to3001.
OR use this Backend .env Template:
DATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/DATABASE?sslmode=require"
JWT_SECRET="your_secret_key"
PORT=3001After configuring the DATABASE_URL, initialize the database schema using Prisma:
npx prisma generate
npx prisma db pushStart the backend server in development mode:
npm run devThe server will start on http://localhost:3001.
Navigate to the Frontend directory and install the required dependencies:
cd Frontend
npm installThe frontend is pre-configured to connect to the backend at http://localhost:3001/api. If you change the backend port, update the baseURL in:
Frontend/src/api/axiosConfig.js
Start the Vite development server:
npm run devThe frontend will usually be accessible at http://localhost:5173.
- Core:
express,cors,dotenv,pg - Database:
prisma,@prisma/client - Security:
bcrypt,jsonwebtoken - Validation:
joi - Dev Tools:
nodemon,tsx,typescript,jest
- Core:
react,react-dom,react-router-dom - Build/Styling:
vite,tailwindcss,postcss,autoprefixer - API/Utilities:
axios,lottie-web,lucide-react,sweetalert2 - Linting:
eslint
- Database Connection Error: Ensure your
DATABASE_URLis correct and the PostgreSQL server is reachable. - CORS Issues: If the frontend cannot reach the backend, verify the CORS origin setting in
Backend/index.jsmatches your frontend URL. - Node Version: If you encounter installation errors, ensure you are using a compatible Node.js version.