nogw / violetit

Violetit is a Reddit clone developed as a monorepo with React + Relay and a few more things

Home Page:https://violetit.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Violetit - Woovi Challenge

Logo

Violetit is a Reddit clone
View Demo · Report Bug

NOTE: Some scripts of this project have been written based on Unix commands (e.g, cp, rm), so if you are running this project on a Windows-based system, you may face difficulties with the yarn copy-envs command. In this case, you can manually copy the .env.example files and rename them to .env

Table of contents

Project Archicteture

├── apps/
|   └── server
|   └── web
|   └── next #wip
├── packages/
|   └── babel
|   └── types
|   └── ui
└── ...

Stack

> Root

  • Linter (Eslint)
  • Prettier
  • Commitlint
  • Editorconfig
  • Lint staged
  • Pre-commit
  • CI/CD (Github Actions)
  • Dockerfile

> Server

  • TypeScript
  • Koa
  • GraphQL
  • Relay
  • MongoDB
  • Mongoose
  • Jest
  • Linter (Eslint)
  • Prettier
  • Entria helpers
  • Webpack + Babel

> Web

  • TypeScript
  • ReactTS
  • Vite
  • Semantic UI
  • Tailwind
  • Linter (Eslint)
  • Prettier
  • Routing (react-router-dom)
  • Jest + Testing Library

Getting Started

Installation

Clone the repo

git clone https://github.com/nogw/violetit.git

Developer environment

Setup Docker + MongoDB

### remember to start docker before executing the command!
docker run -d -p 27017:27017 --name CONTAINER_NAME -d mongo:latest

Copy environment files

yarn copy-envs

Fill environment files

MONGO_URI can be set as mongodb://127.0.0.1:27017/violetit if you run in localhost

### apps/server/.env
PORT=4000
JWT_KEY=
MONGO_URI=

VITE_GRAPHQL_URL can be set as http://localhost:4000/graphql if you run in localhost

### apps/web/.env
VITE_GRAPHQL_URL=

Update path to schema

### apps/web/relay.config.js
schema: '../server/graphql/schema.graphql',

Install the dependencies

yarn

Running server

To begin, generate the schema.graphql file:

yarn workspace @violetit/server schema:generate

Start the server in development mode:

yarn workspace @violetit/server start:dev

Running web

To begin, generate the artifacts using the Relay Compiler:

yarn workspace @violetit/web relay

Start the web app in development mode:

yarn workspace @violetit/web start:dev

Run both web and server packages

If you have completed the necessary setup for the required packages, you can run them concurrently with a single command:

yarn dev:all

Contributing

Contributions are welcome from everyone! Here's how you can get started:

Issues

If you encounter any bugs or have any feature requests, please create an issue with a description of the problem

Pull Requests

Pull requests from anyone are appreciated and can help make this project better! To get started, follow these steps:

  1. Fork the repository
  2. Clone the repository to your local machine
  3. Create a new branch for your changes and switch to it (git checkout -b feature/featureName)
  4. Make your changes and commit them (git commit -m 'Add some featureName')
  5. Push your changes to your fork (git push origin feature/featureName)
  6. Create a pull request in the original repository

References

Contact

  • Twitter - @nogchou
  • Discord - noge#4932

Back To The Top

About

Violetit is a Reddit clone developed as a monorepo with React + Relay and a few more things

https://violetit.vercel.app

License:MIT License


Languages

Language:TypeScript 97.4%Language:JavaScript 2.3%Language:CSS 0.2%Language:HTML 0.1%Language:Shell 0.0%