Skip to content

Commit

Permalink
Fixes for yesterday's UI Revamp PR (#1140)
Browse files Browse the repository at this point in the history
* ui refresh

* fixed static pages (tnc, privacy-policy), fixed Navbar being rendered twice on landing page

* fixed thumbnails, added momentjs and qs to package.json

* Update README.md

* lint fix

* Update pnpm-lock.yaml

* revert to older pnpm-lock.yaml

* minor fixes

* Update pnpm-lock.yaml

* Update src/components/CourseCard.tsx

---------

Co-authored-by: Sargam <[email protected]>
  • Loading branch information
keshav-exe and devsargam authored Sep 7, 2024
1 parent c56cba7 commit 881b135
Show file tree
Hide file tree
Showing 3 changed files with 222 additions and 63 deletions.
275 changes: 216 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,85 +1,229 @@
<h1 align='center'>CMS</h1>
<h1>CMS - 100xDevs</h1>

## Table of contents
## Table of Contents

- [Installation](#installation)

- [With Docker](#with-docker)

- [Without Docker](#without-docker)

- [Usage](#usage)

- [Contributing](#contributing)

- [Contributors](#contributors)

- [Troubleshooting](#troubleshooting)

## Installation

### With Docker

1. Clone the repository:
```bash
git clone https://github.com/code100x/cms.git
```

```bash

git clone https://github.com/code100x/cms.git

```

```bash

git clone https://github.com/code100x/cms.git

```

2. Navigate to the project directory:
```bash
cd cms
```

```bash

cd cms

```

```bash

cd cms

```

3. Run the following command to start the application:
```bash
docker volume create postgres-data # (optional) run this command if you face any mount volume / volume not exist error
docker-compose up
```

```bash

docker volume create postgres-data # (optional) run this command if you face any mount volume / volume not exist error

docker-compose up

```

```bash

docker volume create postgres-data # (optional) run this command if you face any mount volume / volume not exist error

docker-compose up

```

### Without Docker

1. clone the repository:
```bash
git clone https://github.com/code100x/cms.git
```
1. Clone the repository:

```bash

git clone https://github.com/code100x/cms.git

```

2. Navigate to the project directory:
```bash
cd cms
```
3. (optional) Start a PostgreSQL database using Docker:
```bash
docker run -d \
--name cms-db \
-e POSTGRES_USER=myuser \
-e POSTGRES_PASSWORD=mypassword \
-e POSTGRES_DB=mydatabase \
-p 5432:5432 \
postgres
```
based on this command the connection url will be
```
DATABASE_URL=postgresql://myuser:mypassword@localhost:5432/mydatabase?schema=public
```
4. Create a `.env` file based on the `.env.example` file and configure the `DATABASE_URL` with your postgreSQL connection string.

```bash

cd cms

```

3. (Optional) Start a PostgreSQL database using Docker:

```bash

docker run -d \

--name cms-db \

-e POSTGRES_USER=myuser \

-e POSTGRES_PASSWORD=mypassword \

-e POSTGRES_DB=mydatabase \

-p 5432:5432 \

postgres

```

The connection URL for this setup will be:

```
DATABASE_URL=postgresql://myuser:mypassword@localhost:5432/mydatabase?schema=public
```

4. Create a `.env` file based on the `.env.example` file and configure the `DATABASE_URL` with your PostgreSQL connection string.

```bash

cd cms

```

3. (Optional) Start a PostgreSQL database using Docker:

```bash

docker run -d \

--name cms-db \

-e POSTGRES_USER=myuser \

-e POSTGRES_PASSWORD=mypassword \

-e POSTGRES_DB=mydatabase \

-p 5432:5432 \

postgres

```

The connection URL for this setup will be:

```
DATABASE_URL=postgresql://myuser:mypassword@localhost:5432/mydatabase?schema=public
```

4. Create a `.env` file based on the `.env.example` file and configure the `DATABASE_URL` with your PostgreSQL connection string.

5. Install dependencies:
```bash
npm install
```

```bash

pnpm install

```

6. Run database migrations:
```bash
npm run prisma:migrate
```

```bash

pnpm run prisma:migrate

```

7. Seed the database:
```bash
npm run db:seed
```

```bash

pnpm run db:seed

```

8. Start the development server:
```bash
npm run dev
```

```bash

pnpm run dev

```

## Usage

1. Access the aplication in your browser at `http://localhost:3000`
2. Login using any provided user credentials
- (email: `[email protected]`, password: `123456`)
- (email: `[email protected]`, password: `123456`)
1. Access the application in your browser at `http://localhost:3000`

2. Login using any of the following provided user credentials:

- Email: `[email protected]`, Password: `123456`

- Email: `[email protected]`, Password: `123456`

## Contributing

We welcome contributions from the community! To contribute to CMS, follow these steps:

1. Fork the repository.

2. Create a new branch (`git checkout -b feature/fooBar`).

3. Make your changes and commit them (`git commit -am 'Add some fooBar'`).
> Make sure to lint and format your code before commiting
>
> - `npm run lint:check` to check for lint errors
> - `npm run lint:fix` to fix lint errors
> - `npm run format:check` to format the code
> - `npm run format:fix` to fix the formatting

> Before committing, ensure your code is properly formatted and linted:
> - Run `npm run lint:check` to check for lint errors
> - Run `npm run lint:fix` to automatically fix lint errors
> - Run `npm run format:check` to check code formatting
> - Run `npm run format:fix` to automatically fix formatting issues
> Before committing, ensure your code is properly formatted and linted:
> - Run `npm run lint:check` to check for lint errors
> - Run `npm run lint:fix` to automatically fix lint errors
> - Run `npm run format:check` to check code formatting
> - Run `npm run format:fix` to automatically fix formatting issues
4. Push to the branch (`git push origin feature/fooBar`).

5. Create a new Pull Request.

For major changes, please open an issue first to discuss what you would like to change.
Expand All @@ -88,9 +232,22 @@ Read our [contribution guidelines](./CONTRIBUTING.md) for more details.

## Contributors

<a href="https://github.com/code100x/cms/graphs/contributors">
<img src="https://contrib.rocks/image?repo=code100x/cms&max=400&columns=20" />
<a href="https://github.com/code100x/cms/graphs/contributors">

<img src="https://contrib.rocks/image?repo=code100x/cms&max=400&columns=20" />

</a>

## Issues on mac Silicon
## Troubleshooting

### Issues on macOS Silicon

If you encounter issues on macOS with Silicon chips, you may need to install some additional dependencies. Run the following command:

```
brew install pkg-config cairo pango libpng jpeg giflib librsvg
```

If you continue to face issues, please open a GitHub issue with details about the problem you're experiencing.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,15 @@
"jose": "^5.2.2",
"jsonwebtoken": "^9.0.2",
"lucide-react": "^0.321.0",
"moment": "^2.30.1",
"next": "14.0.2",
"next-auth": "^4.24.5",
"next-themes": "^0.2.1",
"nextjs-toploader": "^1.6.11",
"node-fetch": "^3.3.2",
"notion-client": "^6.16.0",
"pdf-lib": "^1.17.1",
"qs": "^6.13.0",
"react": "^18",
"react-big-calendar": "^1.13.2",
"react-day-picker": "8.10.1",
Expand Down
8 changes: 4 additions & 4 deletions src/components/CourseCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ export const CourseCard = ({
onClick: () => void;
}) => {
const router = useRouter();
const imageUrl = 'banner_placeholder.png';
// course.imageUrl && course.imageUrl !== ''
// ? course.imageUrl
// : 'banner_placeholder.png';
const imageUrl =
course.imageUrl
? course.imageUrl
: 'banner_placeholder.png';
return (
<div
className={`flex w-full cursor-pointer flex-col rounded-2xl bg-primary/5 transition-all duration-300 hover:-translate-y-2 hover:border-primary/20`}
Expand Down

0 comments on commit 881b135

Please sign in to comment.