Skip to content

Commit

Permalink
Merge branch 'main' into fix-dropdown-menu-component-modal-behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
Rash-Hit committed Mar 24, 2024
2 parents 6bc09d7 + 128f8c2 commit a9e6d45
Show file tree
Hide file tree
Showing 47 changed files with 2,574 additions and 289 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
.pnp.js
.yarn/install-state.gz

# docker volume
/postgres-data/

# testing
/coverage

Expand Down
45 changes: 15 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,26 @@
<h1 align='center'>CMS</h1>

## Setup procedure
## Setup Procedure

- Docker
* Docker

or

- Copy .env.example to .env
- Get a postgres db from https://neon.tech/ (or any other provider)
- replace the DATABASE_URL in .env
- Run `npx prisma migrate dev` to setup schema
- cd migrations, Seed SQL data -

```
psql -h your_db_host -d your_db -U your_username < neondb_backup.sql
```

For example

```
psql -h ep-super-wildflower-a5sqjjhz.us-east-2.aws.neon.tech -d neondb -U harkirat < neondb_backup.sql
```

---
OR

* Copy .env.example to .env
* Get a postgres db from https://neon.tech/ (or any other provider)
* Replace the DATABASE_URL in .env
* Run ```npx prisma migrate dev``` to setup schema
## Steps to run locally
With Docker

#### With Docker

- docker compose up

#### Without Docker
* ```docker compose up```

- npm install
- npm run dev
- Login using any userid and password 123456
- You should be able to see some test courses
Without Docker
* ```npm install```
* ```npm run db:seed``` to seed the database
* ```npm run dev```
* Login using any userid and password 123456
* You should be able to see some test courses

---

Expand Down
11 changes: 9 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ services:
- .:/usr/src/app
- /usr/src/app/node_modules
depends_on:
- db
db:
condition: service_healthy

db:
image: postgres:9.6
container_name: db
restart: always
environment:
POSTGRES_USER: postgres
Expand All @@ -23,4 +25,9 @@ services:
ports:
- 5432:5432
volumes:
- /postgres-data:/var/lib/postgresql/data
- ./postgres-data:/var/lib/postgresql/data
healthcheck:
test: [ 'CMD-SHELL', 'pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}' ]
interval: 10s
timeout: 5s
retries: 5
Loading

0 comments on commit a9e6d45

Please sign in to comment.