Social media site for gamers built using React, Node.js, Express.js, and PostgreSQL (PERN stack)
git clone https://github.com/saifulislamny/gamedia
- Create a .env file in resulting folder
cd gamedia/
touch .env
- Provide environment variables in .env (example values are shown below - feel free to have different values)
# Port Number for API
PORT=5000
# Database config
DB_USERNAME=ctp_user
DB_PASSWORD=ctp_pass
DB_DATABASE=Gamedia
DB_HOST=127.0.0.1
For local development you will need two terminals open, one for the API and another for the client.
- Backend terminal
npm install
npm run dev
- Frontend terminal
cd client/
npm install
npm start
- Go to http://localhost:PORT for viewing the backend (e.g. http://localhost:5000 if you specified the PORT to be 5000 in your .env file)
- Go to http://localhost:3000 for viewing the frontend
In production, only a single app is deployed. The react client will build into static files that will be served from the backend.
- More readable code in
/api/models/
- Address TODO comments