Codex is a social platform built for developers to share projects, discuss ideas, and connect with peers. We've built this functionality using Laravel and React, aiming to provide a smooth and engaging experience.
We utilize a modern stack to ensure performance and developer experience:
- Backend: Laravel
- Frontend: React with Inertia.js
- UI Components: shadcn/ui
- Runtime: Bun (for JavaScript environment)
- Database: Compatible with MySQL, MariaDB, or SQLite
- Authentication: Integrated GitHub OAuth
To help you navigate the codebase, here is a brief overview of the key directories:
app/Http/Controllers: This directory contains the backend logic and API endpoints (e.g.,RepoController,PostController).app/Models: Here you will find the Eloquent models representing our database tables (e.g.,User,Repo,Post).resources/js/Pages: This directory houses the frontend views which are rendered by Inertia.js.resources/js/components: Our reusable UI components, primarily built using shadcn/ui, are located here.routes/web.php: This file defines all the web routes for the application.
If you'd like to run Codex locally for testing or development, please follow these steps. We hope this guide makes the process straightforward.
Before starting, please ensure you have the following installed on your machine:
-
Clone the repository Start by cloning the codebase to your local machine:
git clone <repository-url> cd codex
-
Install Backend Dependencies Use Composer to install the PHP dependencies:
composer install
-
Install Frontend Dependencies We use Bun for managing frontend packages (you can also use npm/yarn if you prefer):
bun install
-
Environment Configuration Create your environment configuration file by copying the example:
cp .env.example .env
Open the
.envfile in your text editor and update the database credentials and GitHub OAuth settings:APP_NAME=Codex APP_URL=http://localhost:8000 DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=codex DB_USERNAME=root DB_PASSWORD=your_password # GitHub OAuth credentials (required for login) GITHUB_CLIENT_ID=your_github_client_id GITHUB_CLIENT_SECRET=your_github_client_secret GITHUB_REDIRECT_URI="${APP_URL}/auth/github/callback"
-
Generate Application Key Generate a unique application key for your instance:
php artisan key:generate
-
Run Migrations Set up the database tables by running the migrations:
php artisan migrate
-
Run the Application To start the development environment, you will need to run the backend and frontend servers simultaneously in separate terminal windows.
Terminal 1 (Backend):
php artisan serve
Terminal 2 (Frontend):
bun run dev
Once both are running, open your browser and visit
http://localhost:8000to see the application in action.
We are grateful for any contributions! If you encounter issues or have suggestions, please feel free to open an issue or submit a pull request. We appreciate your specific feedback.
The Laravel framework is open-sourced software licensed under the MIT license.