Skip to content

Repository files navigation

✨ Scribe Project Setup Guide ✨

Welcome to the Scribe Project! 🚀

This guide will help you get the backend (PHP) and frontend (React/Vite) up and running in no time. Let's make your dev experience smooth and fun! 😎


🗂️ Project Structure

/ (root)
├── api/            # PHP backend
│   ├── ...
│   └── .env        # Backend environment variables
├── src/            # React frontend
│   ├── components/
│   ├── pages/
│   └── ...
├── .env            # Frontend environment variables
└── README.md       # This file!

⚡ Quick Start

1. Clone the Repo

git clone <your-repo-url>
cd <your-project-folder>

2. Backend Setup (PHP)

  1. Install Composer dependencies:
    cd api
    composer install
    cd ..
  2. Create your backend .env file:
    # api/.env
    DB_HOST=localhost
    DB_NAME=your_db
    DB_USER=your_user
    DB_PASS=your_pass
    MAIL_HOST=smtp.gmail.com
    MAIL_USERNAME=your_email@gmail.com
    MAIL_PASSWORD=your_mail_password
    MAIL_PORT=587
    MAIL_ENCRYPTION=tls
    MAIL_FROM=your_email@gmail.com
    MAIL_FROM_NAME="Scribe Blog"
    APP_URL=http://localhost/api
    UPLOADS_DIR=uploads
  3. Run your PHP server:
    cd api
    php -S localhost:8000
    # Or use XAMPP/Laragon/etc. and point to the api/ folder

3. Frontend Setup (React + Vite)

  1. Install Node dependencies:
    npm install
    # or
    yarn install
  2. Create your frontend .env file:
    # .env (in project root)
    VITE_API_BASE_URL=http://localhost/api
  3. Run the React app:
    npm run dev
    # or
    yarn dev

🧪 Testing the Project


🛠️ Developer Tips

  • .env files are 🔑! Double-check your API URLs and credentials.
  • Use the service layer: All frontend API calls go through src/services/api.service.ts.
  • Need to add a new API?
    1. Add the PHP file in the correct api/ subfolder.
    2. Add a function in api.service.ts.
    3. Import and use it in your React code.
  • Having CORS issues? Make sure your APP_URL and VITE_API_BASE_URL match and your PHP headers allow the frontend origin.

💡 Fun Stuff

  • This project uses modern React, Vite, and PHP best practices.
  • The UI is powered by beautiful components in src/components/ui/.
  • Want to contribute? Fork, branch, and PR! We love new ideas. 💡
  • Found a bug? 🐛 Open an issue and let's squash it together!

🦄 Need Help?

  • Check the comments in the code for extra tips.
  • Ask your teammates or open a discussion.
  • Or just add more emojis to your commit messages! 🎉

Happy coding!

About

Scribe Blog is a community-driven platform where users can request to publish their articles. The platform is monetized through ads, and both the article creators and readers share in the ad revenue..

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages