Skip to content

Commit

Permalink
Merge branch 'code100x:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
prasanth7890 authored Mar 12, 2024
2 parents 21c70fe + 2bf6062 commit 023f11e
Show file tree
Hide file tree
Showing 11 changed files with 419 additions and 48 deletions.
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
143 changes: 142 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "cms",
"version": "0.1.0",
"private": true,
"prisma": {
"seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts"
},
"scripts": {
"postinstall": "prisma generate",
"dev": "next dev",
Expand All @@ -13,6 +16,8 @@
"format:check": "prettier --check \"**/*.{ts,tsx,json}\"",
"dev:docker": "npm run prisma:migrate && next dev",
"prisma:migrate": "prisma migrate deploy",
"db:seed": "prisma db seed",
"db:reset": "prisma migrate reset",
"prepare": "husky install",
"studio": "prisma studio"
},
Expand Down Expand Up @@ -73,6 +78,7 @@
"prettier": "^3.2.4",
"prisma": "^5.6.0",
"tailwindcss": "^3.3.0",
"ts-node": "^10.9.2",
"typescript": "^5"
}
}
Loading

0 comments on commit 023f11e

Please sign in to comment.