Skip to content

dave-hay/creativaitor

Repository files navigation

CreativAItor

Monorepo for CreativAItor.

Apps and Packages

  • apps/api: backend built with express.
  • apps/web: primary web app built with next.js.
  • apps/landing: landing page built with next.js.
  • packages/eslint-config-custom: base ESLint configs.
  • packages/tsconfig: base tsconfig configs.

Getting Started

Follow these instructions to set up the project on your local machine for development and testing purposes.

Prerequisites

  • Node.js Hydrogen >= 18.17
  • pnpm
  • Docker / Docker Compose running locally
  • MongoDB running locally or a remote MongoDB Atlas cluster
  • Upstash Redis account

Installation

  1. Clone the repository:
git clone https://github.com/dave-hay/creativaitor.git
cd creativaitor
  1. Install dependencies:
pnpm install
  1. Createa a copy of the .env.example file in the root folder and update with the neccessary variables.
cp .env
  1. Start the development enviroment:
pnpm run dev

Below are the default urls for each app:

Testing

You can test all apps at once or a particular app.

# all
pnpm test
# api
pnpm test:api
# web
pnpm test:web

Set up MongoDB Locally

  1. Install mongosh
brew install mongosh
  1. Pull the docker image
docker pull mongodb/mongodb-community-server:latest
  1. Run the image as a container
docker run --name mongodb -p 27017:27017 -d mongodb/mongodb-community-server:latest

This -p 27017:27017 maps container port to host port. Allowing you to connect to mongodb://127.0.0.1:27017/.

  1. Connect with mongosh
mongosh --port 27017
db.runCommand(
   {
      hello: 1
   }
)

Further reading here.