Skip to content

A minimal Github clone built on nextjs app router.

License

Notifications You must be signed in to change notification settings

KyryloPikhno/gh-next

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple clone of github in Next.JS

A simple github alternative open source on github (ironic right ?), it aims is to be fully functionnal with some of the core features of github working.

See #84 for more info on the supported features.

⚠️ THIS PROJECT IS IN ACTIVE DEVELOPMENT ⚠️

Expect stuff to break.

Roadmap

Click to see more

Stack

Requirements

  • Node >= v18.x
  • pnpm >= v8.x
  • docker installed for local development
  • A registered github app for authenticating users

🚀 How to work on the project ?

  1. First you have to clone the repository

    git clone https://github.com/Fredkiss3/gh-next.git
  2. Start the docker compose instance to start the DB + redis instance :

    docker-compose up -d --remove-orphans
  3. Install the dependencies :

    pnpm install
  4. Rename .env.example to .env.local And change the file to your needs,

  5. And launch the project :

    pnpm run dev

    The app will show at https://localhost:3000.

  6. Open the source code and start rocking ! 😎

🧐 Project structure

A quick look at the top-level files and directories you will see in this project.

  .
  ├── src/
  │    ├── app/
  │    │   ├── (actions)
  │    │   ├── (components)
  │    │   ├── (models)
  │    │   └── (routes)
  │    └──lib/
  │        ├── db/schema
  │        └── hooks
  ├── .prettierrc
  ├── pnpm-lock.yaml
  └── tsconfig.json
  1. src/app/: this folder contains the source code to our app :

    1. (actions) : this folder contains all the logic of our app.

    2. (components) : this folder contains all the components of our app.

    3. (models) : this folder contains all the DB models of our app.

    4. (routes) : this folder contains all the routes & pages of our app.

  2. src/lib/: this folder contains utils & helpers used throughout our app :

    1. db/schema : this folder contains all the drizzle sqlite schema for our DB.

    2. hooks : this folder contains all the react custom hooks used in the app.

  3. .prettierrc: this file contains the configuration for prettier to enable autoformatting.

  4. pnpm-lock.yaml: this file contains the dependencies lock for the repo.

  5. tsconfig.json: this file contains the configuration for typescript, that are used by the all the underlying packages

🍳 ENV VARIABLES USED

Nom role
SESSION_SECRET random 32 chars length string used to encode the session id
REDIS_HTTP_URL The URL to the connect to redis HTTP for a key/value store
DATABASE_URL The URL to the connect to the Postres Database
REDIS_HTTP_USERNAME LOCAL file server URL for storing key values
REDIS_HTTP_PASSWORD LOCAL file server URL for storing key values
GITHUB_CLIENT_ID github client id stored for our app used for authenticating users with github
GITHUB_PERSONAL_ACCESS_TOKEN github client token stored for our app used for authenticating users with github
GITHUB_REDIRECT_URI URL to redirect when a user has been authenticated
GITHUB_SECRET github secret stored for our app

About

A minimal Github clone built on nextjs app router.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 96.9%
  • JavaScript 1.3%
  • CSS 1.2%
  • PLpgSQL 0.6%